mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-25 09:38:11 +00:00
adds compliance action buttons to affirm or discard suggestions
This commit is contained in:
parent
0d49e59392
commit
6543eca32c
17
wherehows-web/app/components/auto-suggest-action.js
Normal file
17
wherehows-web/app/components/auto-suggest-action.js
Normal 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')
|
||||||
|
});
|
@ -1,3 +1,4 @@
|
|||||||
@import "compliance-container";
|
@import "compliance-container";
|
||||||
@import "compliance-prompts";
|
@import "compliance-prompts";
|
||||||
@import "compliance-table";
|
@import "compliance-table";
|
||||||
|
@import "compliance-auto-suggester-action";
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -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}}
|
||||||
|
|
@ -259,6 +259,8 @@
|
|||||||
{{#row.cell}}
|
{{#row.cell}}
|
||||||
{{#if row.suggestion}}
|
{{#if row.suggestion}}
|
||||||
{{row.suggestion.confidence}}%
|
{{row.suggestion.confidence}}%
|
||||||
|
{{auto-suggest-action type="accept"}}
|
||||||
|
{{auto-suggest-action}}
|
||||||
{{else}}
|
{{else}}
|
||||||
—
|
—
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user