Commit 12d650c4002bd58a9f570a419c4dffc15a2c11e1

Authored by deaflynx
1 parent 35429c94

Added edgeEventType constants, changed hardcoded values

... ... @@ -376,6 +376,19 @@ export default angular.module('thingsboard.types', [])
376 376 entityView: "ENTITY_VIEW",
377 377 edge: "EDGE"
378 378 },
  379 + edgeEventType:{
  380 + dashboard: "DASHBOARD",
  381 + asset: "ASSET",
  382 + device: "DEVICE",
  383 + entityView: "ENTITY_VIEW",
  384 + alarm: "ALARM",
  385 + rulechain: "RULE_CHAIN",
  386 + ruleChainMetaData: "RULE_CHAIN_METADATA",
  387 + edge: "EDGE",
  388 + user: "USER",
  389 + customer: "CUSTOMER",
  390 + relation: "RELATION"
  391 + },
379 392 importEntityColumnType: {
380 393 name: {
381 394 name: 'import.column-type.name',
... ...
... ... @@ -100,10 +100,10 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $
100 100 }
101 101 var content = '';
102 102 switch(scope.event.edgeEventType) {
103   - case 'RELATION':
  103 + case types.edgeEventType.relation:
104 104 content = angular.toJson(scope.event.entityBody);
105 105 break;
106   - case 'RULE_CHAIN_METADATA':
  106 + case types.edgeEventType.ruleChainMetaData:
107 107 content = ruleChainService.getRuleChainMetaData(scope.event.entityId, {}).then(
108 108 function success(info) {
109 109 return angular.toJson(info);
... ...
... ... @@ -100,7 +100,7 @@ export default function EventTableDirective($compile, $templateCache, $rootScope
100 100 fetchMoreItems_: function () {
101 101 if (scope.events.hasNext && !scope.events.pending) {
102 102 if (scope.entityType && scope.entityId && scope.eventType && scope.tenantId) {
103   - if (scope.eventType !== "EDGE_EVENT") {
  103 + if (scope.eventType !== types.eventType.edgeEvent.value) {
104 104 var promise = eventService.getEvents(scope.entityType, scope.entityId,
105 105 scope.eventType, scope.tenantId, scope.events.nextPageLink);
106 106 } else {
... ...