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, value: 1,
string: "ON" string: "ON"
},
{
value: 2,
string: "FAULT"
} }
], ],
hints: { hints: {

View File

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

View File

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

View File

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

View File

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

View File

@@ -204,6 +204,13 @@ define([
*/ */
resetStats: function () { resetStats: function () {
this.unset('stats'); 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); this.data.forEach(this.updateStats, this);
}, },