HP Improvements

- Add scroll bar into the tab content in protocolEditor
- Prevent "Wt." and "Req." fields to go out of screen when constraint value is long
- Add "starts with" and "ends with" comparators
- Fix the issue with empty input value in ruleEntryDialog
This commit is contained in:
Evren Ozkan 2018-01-08 16:35:18 -05:00
parent 646b4df8c9
commit 015e62ebd0
5 changed files with 40 additions and 0 deletions

View File

@ -22,6 +22,18 @@ const comparators = [{
validator: 'doesNotContain',
validatorOption: 'value',
description: 'The attribute must not contain this value.'
}, {
id: 'startsWith',
name: 'Starts with',
validator: 'startsWith',
validatorOption: 'value',
description: 'The attribute must start with this value.'
}, {
id: 'endsWith',
name: 'Ends with',
validator: 'endsWith',
validatorOption: 'value',
description: 'The attribute must end with this value.'
}, {
id: 'onlyInteger',
name: 'Only Integers',

View File

@ -79,6 +79,10 @@ $height = 20px
background: #ffffff
color: #3e3e3e
.tab-content
height: calc(100% - 60px)
overflow: auto;
.protocolEditorSection
padding: 10px
margin: 10px 0

View File

@ -378,6 +378,10 @@ Template.ruleEntryDialog.events({
// Update the ReactiveVar with the user-specified value
template.currentValue.set(value);
// Enforce to update the input value (Otherwise, ReactiveVar does not update input value with the same values)
const currentValueInput = $('.ruleEntryDialog').find('input.currentValue');
currentValueInput.val(value);
},
/**
* Update the currentValue ReactiveVar if the user changes the attribute value

View File

@ -33,6 +33,14 @@ table.ruleTable
td:first-child
text-align: left
overflow-wrap: break-word
word-wrap: break-word
-ms-word-break: break-word
word-break: break-word
-ms-hyphens: auto
-moz-hyphens: auto
-webkit-hyphens: auto
hyphens: auto
.addRuleContainer
margin: 10px 0

View File

@ -24,4 +24,16 @@ v.validators.doesNotContain = function(value, options, key) {
}
};
v.validators.startsWith = function(value, options, key) {
if (options && value.startsWith && !value.startsWith(options.value)) {
return key + 'must start with ' + options.value;
}
};
v.validators.endsWith = function(value, options, key) {
if (options && value.endsWith && !value.endsWith(options.value)) {
return key + 'must end with ' + options.value;
}
};
validate = v;