Skip to content

Commit

Permalink
hides delete button on groupings if it's the only group
Browse files Browse the repository at this point in the history
closes #322
  • Loading branch information
frabarz committed Dec 4, 2018
1 parent 91cc138 commit 6673fd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ class GroupingItem extends SidebarCRUDItem {
<div className="group actions">
<Button
text="Delete"
className="pt-small"
className="pt-small action-delete"
onClick={this.handleDelete}
/>
<Button
text={"Edit params"}
className="pt-small pt-intent-primary"
className="pt-small pt-intent-primary action-edit"
onClick={this.handleEdit}
/>
</div>
Expand Down Expand Up @@ -100,12 +100,12 @@ class GroupingItem extends SidebarCRUDItem {
<div className="group actions">
<Button
text={item.level ? "Cancel" : "Delete"}
className="pt-small"
className="pt-small action-reset"
onClick={item.level ? this.handleClose : this.handleDelete}
/>
<Button
text="Apply changes"
className="pt-small pt-intent-primary"
className="pt-small pt-intent-primary action-update"
onClick={this.handleApply}
/>
</div>
Expand Down
4 changes: 4 additions & 0 deletions packages/vizbuilder/src/components/Sidebar/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
border: 1px solid;
}

& .grouping-item:only-child .action-delete {
display: none;
}

& .filter-item .values span {
margin-right: 0.5rem;
}
Expand Down

0 comments on commit 6673fd9

Please sign in to comment.