Skip to content

Commit

Permalink
[NIFI-2480] remove explicit angular $sanitize to fix multibyte chars …
Browse files Browse the repository at this point in the history
…in breadcrumbs and flow status bar. All values are escapoed through the angular ng-bind. This closes apache#957
  • Loading branch information
scottyaslan authored and mcgilman committed Aug 26, 2016
1 parent 2ed5891 commit c8ae7fc
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"font-awesome": "fontawesome#4.6.1",
"angular-material": "1.0.8",
"angular-resource": "1.5.5",
"angular-route": "1.5.5",
"angular-sanitize": "1.5.5"
"angular-route": "1.5.5"
},
"resolutions": {
"angular": "1.5.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<script type="text/javascript" src="assets/angular-aria/angular-aria.min.js"></script>
<script type="text/javascript" src="assets/angular-animate/angular-animate.min.js"></script>
<script type="text/javascript" src="assets/angular-material/angular-material.min.js"></script>
<script type="text/javascript" src="assets/angular-sanitize/angular-sanitize.min.js"></script>
<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>
<script type="text/javascript" src="js/nf/nf-ng-namespace.js?${project.version}"></script>
${nf.bulletin.board.script.tags}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
<script type="text/javascript" src="assets/angular-aria/angular-aria.min.js"></script>
<script type="text/javascript" src="assets/angular-animate/angular-animate.min.js"></script>
<script type="text/javascript" src="assets/angular-material/angular-material.min.js"></script>
<script type="text/javascript" src="assets/angular-sanitize/angular-sanitize.min.js"></script>
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>
<script type="text/javascript" src="js/nf/nf-ng-namespace.js?${project.version}"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
<script type="text/javascript" src="assets/angular-aria/angular-aria.min.js"></script>
<script type="text/javascript" src="assets/angular-animate/angular-animate.min.js"></script>
<script type="text/javascript" src="assets/angular-material/angular-material.min.js"></script>
<script type="text/javascript" src="assets/angular-sanitize/angular-sanitize.min.js"></script>
<script type="text/javascript" src="js/nf/nf-namespace.js?${project.version}"></script>
<script type="text/javascript" src="js/nf/nf-ng-namespace.js?${project.version}"></script>
${nf.summary.script.tags}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* global nf, d3 */

nf.ng.BreadcrumbsCtrl = function (serviceProvider, $sanitize) {
nf.ng.BreadcrumbsCtrl = function (serviceProvider) {
'use strict';

function BreadcrumbsCtrl() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* global nf, d3 */

nf.ng.Canvas.FlowStatusCtrl = function (serviceProvider, $sanitize) {
nf.ng.Canvas.FlowStatusCtrl = function (serviceProvider) {
'use strict';

var config = {
Expand Down Expand Up @@ -364,7 +364,7 @@ nf.ng.Canvas.FlowStatusCtrl = function (serviceProvider, $sanitize) {
}
}
this.connectedNodesCount =
nf.Common.isDefinedAndNotNull(clusterSummary.connectedNodes) ? $sanitize(clusterSummary.connectedNodes) : '-';
nf.Common.isDefinedAndNotNull(clusterSummary.connectedNodes) ? clusterSummary.connectedNodes : '-';
} else {
this.connectedNodesCount = 'Disconnected';
color = '#BA554A';
Expand All @@ -386,29 +386,29 @@ nf.ng.Canvas.FlowStatusCtrl = function (serviceProvider, $sanitize) {
$('#controller-invalid-count').parent().css('color', controllerInvalidCountColor);

// update the report values
this.activeThreadCount = $sanitize(status.activeThreadCount);
this.totalQueued = $sanitize(status.queued);
this.activeThreadCount = status.activeThreadCount;
this.totalQueued = status.queued;

// update the component counts
this.controllerTransmittingCount =
nf.Common.isDefinedAndNotNull(status.activeRemotePortCount) ?
$sanitize(status.activeRemotePortCount) : '-';
status.activeRemotePortCount : '-';

this.controllerNotTransmittingCount =
nf.Common.isDefinedAndNotNull(status.inactiveRemotePortCount) ?
$sanitize(status.inactiveRemotePortCount) : '-';
status.inactiveRemotePortCount : '-';

this.controllerRunningCount =
nf.Common.isDefinedAndNotNull(status.runningCount) ? $sanitize(status.runningCount) : '-';
nf.Common.isDefinedAndNotNull(status.runningCount) ? status.runningCount : '-';

this.controllerStoppedCount =
nf.Common.isDefinedAndNotNull(status.stoppedCount) ? $sanitize(status.stoppedCount) : '-';
nf.Common.isDefinedAndNotNull(status.stoppedCount) ? status.stoppedCount : '-';

this.controllerInvalidCount =
nf.Common.isDefinedAndNotNull(status.invalidCount) ? $sanitize(status.invalidCount) : '-';
nf.Common.isDefinedAndNotNull(status.invalidCount) ? status.invalidCount : '-';

this.controllerDisabledCount =
nf.Common.isDefinedAndNotNull(status.disabledCount) ? $sanitize(status.disabledCount) : '-';
nf.Common.isDefinedAndNotNull(status.disabledCount) ? status.disabledCount : '-';

},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ $(document).ready(function () {
if (nf.Canvas.SUPPORTS_SVG) {

//Create Angular App
var app = angular.module('ngCanvasApp', ['ngResource', 'ngRoute', 'ngMaterial', 'ngSanitize', 'ngMessages']);
var app = angular.module('ngCanvasApp', ['ngResource', 'ngRoute', 'ngMaterial', 'ngMessages']);

//Define Dependency Injection Annotations
nf.ng.AppConfig.$inject = ['$mdThemingProvider', '$compileProvider'];
nf.ng.AppCtrl.$inject = ['$scope', 'serviceProvider', '$compile', 'headerCtrl', 'graphControlsCtrl'];
nf.ng.ServiceProvider.$inject = [];
nf.ng.BreadcrumbsCtrl.$inject = ['serviceProvider', '$sanitize'];
nf.ng.BreadcrumbsCtrl.$inject = ['serviceProvider'];
nf.ng.Canvas.HeaderCtrl.$inject = ['serviceProvider', 'toolboxCtrl', 'globalMenuCtrl', 'flowStatusCtrl'];
nf.ng.Canvas.FlowStatusCtrl.$inject = ['serviceProvider', '$sanitize'];
nf.ng.Canvas.FlowStatusCtrl.$inject = ['serviceProvider'];
nf.ng.Canvas.GlobalMenuCtrl.$inject = ['serviceProvider'];
nf.ng.Canvas.ToolboxCtrl.$inject = ['processorComponent',
'inputPortComponent',
Expand Down

0 comments on commit c8ae7fc

Please sign in to comment.