EdgeEvents: added toast.showError() for deleted entities
This commit is contained in:
parent
8c9aa0c8df
commit
0961c24a35
@ -389,6 +389,19 @@ export default angular.module('thingsboard.types', [])
|
||||
customer: "CUSTOMER",
|
||||
relation: "RELATION"
|
||||
},
|
||||
edgeEventAction: {
|
||||
updated: "UPDATED",
|
||||
added: "ADDED",
|
||||
assignedToEdge: "ASSIGNED_TO_EDGE",
|
||||
deleted: "DELETED",
|
||||
unassignedFromEdge: "UNASSIGNED_FROM_EDGE",
|
||||
alarmAck: "ALARM_ACK",
|
||||
alarmClear: "ALARM_CLEAR",
|
||||
credentialsUpdated: "CREDENTIALS_UPDATED",
|
||||
attributesUpdated: "ATTRIBUTES_UPDATED",
|
||||
attributesDeleted: "ATTRIBUTES_DELETED",
|
||||
timeseriesUpdated: "TIMESERIES_UPDATED"
|
||||
},
|
||||
importEntityColumnType: {
|
||||
name: {
|
||||
name: 'import.column-type.name',
|
||||
|
||||
@ -102,24 +102,28 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $
|
||||
switch(scope.event.edgeEventType) {
|
||||
case types.edgeEventType.relation:
|
||||
content = angular.toJson(scope.event.entityBody);
|
||||
showDialog();
|
||||
break;
|
||||
case types.edgeEventType.ruleChainMetaData:
|
||||
content = ruleChainService.getRuleChainMetaData(scope.event.entityId, {}).then(
|
||||
content = ruleChainService.getRuleChainMetaData(scope.event.entityId, {ignoreErrors: true}).then(
|
||||
function success(info) {
|
||||
showDialog();
|
||||
return angular.toJson(info);
|
||||
}, function fail() {
|
||||
toast.showError($translate.instant('edge.load-entity-error'));
|
||||
showError();
|
||||
});
|
||||
break;
|
||||
default:
|
||||
content = entityService.getEntity(scope.event.edgeEventType, scope.event.entityId, {}).then(
|
||||
content = entityService.getEntity(scope.event.edgeEventType, scope.event.entityId, {ignoreLoading: true, ignoreErrors: true}).then(
|
||||
function success(info) {
|
||||
showDialog();
|
||||
return angular.toJson(info);
|
||||
}, function fail() {
|
||||
toast.showError($translate.instant('edge.load-entity-error'));
|
||||
showError();
|
||||
});
|
||||
break;
|
||||
}
|
||||
function showDialog() {
|
||||
$mdDialog.show({
|
||||
controller: 'EventContentDialogController',
|
||||
controllerAs: 'vm',
|
||||
@ -134,6 +138,10 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $
|
||||
}
|
||||
});
|
||||
}
|
||||
function showError() {
|
||||
toast.showError($translate.instant('edge.load-entity-error'));
|
||||
}
|
||||
}
|
||||
|
||||
scope.checkTooltip = function($event) {
|
||||
var el = $event.target;
|
||||
|
||||
@ -821,7 +821,7 @@
|
||||
"make-private-edge-text": "After the confirmation the edge and all its data will be made private and won't be accessible by others.",
|
||||
"import": "Import edge",
|
||||
"label": "Label",
|
||||
"load-entity-error": "Could not load entity info",
|
||||
"load-entity-error": "Entity not found. Failed to load info",
|
||||
"assign-new-edge": "Assign new edge",
|
||||
"manage-edge-dashboards": "Manage edge dashboards",
|
||||
"unassign-from-edge": "Unassign from edge",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user