Compare commits

...

4 Commits

Author SHA1 Message Date
Pete Richards
32b6560af3 Plot uses range defined in telemetry for autoscaling 2018-12-11 08:27:11 -08:00
Pete Richards
927232919d mutation listener adds via transaction manager
Update the TransactingMutationListener to add items to a transaction
using the transactionManager so that they can be properly removed
from the transaction at a later date.

Prevents showing error dialogs during successful save, and also
prevents persisting duplicate objects.
2018-11-23 16:04:30 -08:00
Pete Richards
78a9779fb8 Merge remote-tracking branch 'origin/clear-transction-during-undirty-1468' into vista-r40-dev 2018-11-14 11:13:12 -08:00
Pete Richards
23723e589c Save As clears transaction while undirtying 2018-07-20 16:04:51 -07:00
6 changed files with 19 additions and 5 deletions

View File

@@ -72,6 +72,10 @@ define([
{
value: 1,
string: "ON"
},
{
value: 2,
string: "FAULT"
}
],
hints: {

View File

@@ -50,6 +50,7 @@ define([
this.injectObjectService = function () {
this.objectService = $injector.get("objectService");
};
this.$injector = $injector;
this.policyService = policyService;
this.dialogService = dialogService;
this.copyService = copyService;

View File

@@ -365,7 +365,7 @@ define([
"runs": [
{
"implementation": TransactingMutationListener,
"depends": ["topic", "transactionService", "cacheService"]
"depends": ["topic", "transactionService", "cacheService", "transactionManager"]
}
],
"constants": [

View File

@@ -32,7 +32,8 @@ define([], function () {
function TransactingMutationListener(
topic,
transactionService,
cacheService
cacheService,
transactionManager
) {
function hasChanged(domainObject) {
@@ -52,7 +53,8 @@ define([], function () {
transactionService.startTransaction();
}
transactionService.addToTransaction(
transactionManager.addToTransaction(
domainObject.getId(),
persistence.persist.bind(persistence),
persistence.refresh.bind(persistence)
);

View File

@@ -60,10 +60,10 @@ define([
valueMetadata.values = _.pluck(valueMetadata.enumerations, 'value');
}
if (!valueMetadata.hasOwnProperty('max')) {
valueMetadata.max = _.max(valueMetadata.values) + 1;
valueMetadata.max = _.max(valueMetadata.values);
}
if (!valueMetadata.hasOwnProperty('min')) {
valueMetadata.min = _.min(valueMetadata.values) - 1;
valueMetadata.min = _.min(valueMetadata.values);
}
}

View File

@@ -204,6 +204,13 @@ define([
*/
resetStats: function () {
this.unset('stats');
let yMetadata = this.metadata.value(this.get('yKey'));
if (yMetadata.hasOwnProperty('min') && yMetadata.hasOwnProperty('max')) {
this.set('stats', {
minValue: yMetadata.min,
maxValue: yMetadata.max
});
}
this.data.forEach(this.updateStats, this);
},