Skip to content

Commit

Permalink
Merge pull request #85 from ServiceInventoryManagementSystem/remove-s…
Browse files Browse the repository at this point in the history
…earch-text

Added remove search text button, and changed some css for seed and de…
  • Loading branch information
arwassa authored May 28, 2018
2 parents 32d9ca0 + 32aecef commit 1bc6272
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
12 changes: 11 additions & 1 deletion src/assets/css/AdminPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ h1{
.deleteAll {
display: inline-block;
float: right;
margin-right: 7.1%;
margin-right: 0%;
}

.seedButton {
display: inline-block;
float: right;
margin-right: 1%;
}

table{
Expand Down Expand Up @@ -149,6 +155,10 @@ table{

}

/********* Clear search button placement **********/
.clearSearchButton {
margin-left: 1%;
}

/********* CSS for table on admin page with delete buttons **********/
table{
Expand Down
27 changes: 25 additions & 2 deletions src/components/containers/AdminPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class AdminPage extends Component {
tableDialog: false,
deleteDialog: false,
sortingOrder: "none",
searchValue: ""
};
this.icons = {
active: "check_circle_outline",
Expand Down Expand Up @@ -120,6 +121,13 @@ export class AdminPage extends Component {
});
}

//Clear search text
handleClickClearSearch(){
this.onChange("")

}


//Handles table dialog, closes it.
handleTableClose(){
this.setState({
Expand Down Expand Up @@ -197,8 +205,12 @@ export class AdminPage extends Component {
}

onChange(value){

this._refreshSubunsub();
this.querySubject.next(value); // må gjøre så category funker, eget parameter eller objekt
this.querySubject.next(value); // må gjøre så category funker, eget parameter eller objek
this.setState({
searchValue: value
})
}

clearError(){
Expand Down Expand Up @@ -294,14 +306,25 @@ export class AdminPage extends Component {
<TextField
onChange = {(e, v)=> this.onChange(v)}
hintText="Search on Name"
value = {this.state.searchValue}
/>



<RaisedButton primary={true} style={ModuleStyle.button}
label = "Clear search"
className={_s.clearSearchButton}
onClick = { () => this.handleClickClearSearch()}
/>



{this.props.user && this.props.user.isAdmin() ?
<RaisedButton className={_s.deleteAll} onClick={ () => {
this.handleClickDelete()
}} label="Delete all" secondary={true}/> : null}
{this.props.user && this.props.user.isAdmin() ?
<RaisedButton className={_s.deleteAll} onClick={ () => {
<RaisedButton className={_s.seedButton} onClick={ () => {
this.seedServices()
}} label="Example data" primary={true}/> : null}

Expand Down

0 comments on commit 1bc6272

Please # to comment.