adds compliance action buttons to affirm or discard suggestions

This commit is contained in:
Seyi Adebajo 2017-08-18 04:36:14 -07:00
parent 0d49e59392
commit 6543eca32c
5 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import Ember from 'ember';
const { Component, computed } = Ember;
export default Component.extend({
tagName: 'button',
classNames: ['compliance-auto-suggester-action'],
classNameBindings: ['isAffirmative:compliance-auto-suggester-action--accept'],
/**
* Determines the type of suggestion action this is
* if type property is passed in
*/
isAffirmative: computed.equal('type', 'accept')
});

View File

@ -1,3 +1,4 @@
@import "compliance-container";
@import "compliance-prompts";
@import "compliance-table";
@import "compliance-auto-suggester-action";

View File

@ -0,0 +1,16 @@
/// Defines styles for the compliance auto suggestion action button
.compliance-auto-suggester-action {
text-decoration: none;
text-align: center;
padding: 0;
border: 0;
background-color: transparent;
display: inline-block;
vertical-align: middle;
color: set-color(red, red5);
margin: 0 5px;
&--accept {
color: set-color(green, green5);
}
}

View File

@ -0,0 +1,15 @@
{{#if (eq type "accept")}}
<svg viewBox="0 0 24 24" width="24px" height="24px" x="0" y="0" preserveAspectRatio="xMinYMin meet">
<g class="large-icon" style="fill: currentColor">
<path d="M19.68,4L9,17.7,4.36,12,3,13.06l5.42,6.67A0.72,0.72,0,0,0,9,20a0.7,0.7,0,0,0,.59-0.28L21,5.05Z"></path>
</g>
</svg>
{{else}}
<svg viewBox="0 0 24 24" width="24px" height="24px" x="0" y="0" preserveAspectRatio="xMinYMin meet">
<g class="large-icon" style="fill: currentColor">
<path
d="M20,5.32L13.32,12,20,18.68,18.66,20,12,13.33,5.34,20,4,18.68,10.68,12,4,5.32,5.32,4,12,10.69,18.68,4Z"></path>
</g>
</svg>
{{/if}}

View File

@ -259,6 +259,8 @@
{{#row.cell}}
{{#if row.suggestion}}
{{row.suggestion.confidence}}%
{{auto-suggest-action type="accept"}}
{{auto-suggest-action}}
{{else}}
&mdash;
{{/if}}