From 850a6583af1585340fb45542d2d305dceee80a6e Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Fri, 18 Nov 2016 15:52:20 +1000 Subject: [PATCH] WIP: Implementing client side capabilities This commit adds architecture to support client side capabilities. With it are two important custom directives: capability-if (hide or show DOM based on a model capability) and capability-enabled (apply a capability-enabled or capability-disabled class to DOM based on a model capability). capability-if appears to work, however capability-enabled is only partially working. --- .../fileList/fileList.tpl.html | 2 +- src/app/app.js | 1 + src/app/eventDiagnostics.js | 22 +++ src/app/jobs/details/jobDetails.tpl.html | 25 +-- src/app/jobs/list/jobsList.tpl.html | 1 + src/app/navigation/rightNavBar.tpl.html | 2 +- src/app/uiHints/_cornerRibbon.scss | 1 + src/app/uiHints/capability.js | 154 ++++++++++++++++++ src/app/uiHints/uiHints.js | 3 +- src/components/models/analysisJob.js | 30 +++- src/components/models/associations.js | 95 ++++++++++- src/sass/_bootstrapCustomization.scss | 1 - 12 files changed, 317 insertions(+), 20 deletions(-) create mode 100644 src/app/eventDiagnostics.js create mode 100644 src/app/uiHints/capability.js diff --git a/src/app/analysisResults/fileList/fileList.tpl.html b/src/app/analysisResults/fileList/fileList.tpl.html index dca9f77a..e4bb7fea 100644 --- a/src/app/analysisResults/fileList/fileList.tpl.html +++ b/src/app/analysisResults/fileList/fileList.tpl.html @@ -8,7 +8,7 @@ Download this folder - +
diff --git a/src/app/app.js b/src/app/app.js index ed8f5206..c3fc6b53 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -70,6 +70,7 @@ angular.module("baw", "bawApp.configuration", /* a mapping of all static path configurations and a module that contains all app configuration */ "bawApp.predictiveCacheDefaultProfiles", + "bawApp.diagnostics", "http-auth-interceptor", /* the auth module */ "angular-auth", /* the auth module */ diff --git a/src/app/eventDiagnostics.js b/src/app/eventDiagnostics.js new file mode 100644 index 00000000..9f481a31 --- /dev/null +++ b/src/app/eventDiagnostics.js @@ -0,0 +1,22 @@ +//http://plnkr.co/edit/cn3MZynbpTYIcKUWmsBi?p=preview +angular + .module("bawApp.diagnostics", []); + // .config(["$provide", function($provide) { + // $provide.decorator("$rootScope", ["$delegate", function($delegate) { + // var scope = $delegate.constructor; + // var origBroadcast = scope.prototype.$broadcast; + // var origEmit = scope.prototype.$emit; + // + // scope.prototype.$broadcast = function() { + // console.debug("$broadcast was called on $scope " + scope.$id + " with arguments:", + // arguments); + // return origBroadcast.apply(this, arguments); + // }; + // scope.prototype.$emit = function() { + // console.debug("$emit was called on $scope " + scope.$id + " with arguments:", + // arguments); + // return origEmit.apply(this, arguments); + // }; + // return $delegate; + // }]); + // }]); \ No newline at end of file diff --git a/src/app/jobs/details/jobDetails.tpl.html b/src/app/jobs/details/jobDetails.tpl.html index 590c4b48..37adf00f 100644 --- a/src/app/jobs/details/jobDetails.tpl.html +++ b/src/app/jobs/details/jobDetails.tpl.html @@ -1,4 +1,4 @@ - + @@ -20,37 +20,38 @@

  • -
  • - +
  • - +
  • -
  • +
  • -
  • -
  • +
  • - +
  • diff --git a/src/app/jobs/list/jobsList.tpl.html b/src/app/jobs/list/jobsList.tpl.html index fcac8a14..cd4ff786 100644 --- a/src/app/jobs/list/jobsList.tpl.html +++ b/src/app/jobs/list/jobsList.tpl.html @@ -4,6 +4,7 @@ New analysis job +
    diff --git a/src/app/navigation/rightNavBar.tpl.html b/src/app/navigation/rightNavBar.tpl.html index 250c0507..a26ecee6 100644 --- a/src/app/navigation/rightNavBar.tpl.html +++ b/src/app/navigation/rightNavBar.tpl.html @@ -7,7 +7,7 @@


    -