Modernize web GUI and make it installable on BMC
1. Move from gulp server to webpack. This allows the proper
compression to allow the webui to be embedded in the BMC.
2. Update js paths to use requires, not hardcoded paths. This was
required to make the packaging work correctly.
3. Add babel config to do translation.
4. Update angularjs directive calls to use the angular 1.6 syntax for
promises intead of success and fail.
https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$http
5. As a consequence of using NPM/webpack, the versions of angular and
associated modules that were checked in have been updated.
Change-Id: Icb71e2eedb0d9a8943fc914f9dc4be11d0983c00
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/app/common/directives/app-header.html b/app/common/directives/app-header.html
index 0ba8607..e5071e4 100644
--- a/app/common/directives/app-header.html
+++ b/app/common/directives/app-header.html
@@ -5,7 +5,7 @@
<a href="" class="header__logout" ng-click="logout()">Log out</a>
</header>
<div class="header__functions-wrapper" role="heading">
- <div class="logo__wrapper"><img src="assets/images/logo.svg" class="header__logo" alt="company logo"/></div>
+ <div class="logo__wrapper"><img src="../../assets/images/logo.svg" class="header__logo" alt="company logo"/></div>
<!-- <button class="inline header__multi-server" aria-label="multi server select" ng-class="{'active': multi_server_recent}" ng-click="multiRecent();">
<span class="icon icon-angle" aria-hidden="true"></span><span class="accessible-text">Multi server switcher</span>
</button>-->
@@ -31,4 +31,4 @@
</div>
<!-- multi-server recent dropdown -->
-<div ng-include="" src="'multi-server/controllers/multi-server-recent-controller.html'"></div>
\ No newline at end of file
+<div ng-include="" src="'multi-server/controllers/multi-server-recent-controller.html'"></div>
diff --git a/app/common/directives/app-header.js b/app/common/directives/app-header.js
index 6844c9c..69a9c7b 100644
--- a/app/common/directives/app-header.js
+++ b/app/common/directives/app-header.js
@@ -6,7 +6,7 @@
.directive('appHeader', ['APIUtils', function (APIUtils) {
return {
'restrict': 'E',
- 'templateUrl': 'common/directives/app-header.html',
+ 'template': require('./app-header.html'),
'scope': {
'path': '='
},
diff --git a/app/common/directives/app-navigation.js b/app/common/directives/app-navigation.js
index daccb2f..2b7ad32 100644
--- a/app/common/directives/app-navigation.js
+++ b/app/common/directives/app-navigation.js
@@ -6,7 +6,7 @@
.directive('appNavigation', function () {
return {
'restrict': 'E',
- 'templateUrl': 'common/directives/app-navigation.html',
+ 'template': require('./app-navigation.html'),
'scope': {
'path': '=',
'showNavigation': '='
diff --git a/app/common/directives/confirm.js b/app/common/directives/confirm.js
index ed8c9dc..5bb699a 100644
--- a/app/common/directives/confirm.js
+++ b/app/common/directives/confirm.js
@@ -6,7 +6,7 @@
.directive('confirm', ['$timeout', function($timeout){
return {
'restrict': 'E',
- 'templateUrl': 'common/directives/confirm.html',
+ 'template': require('./confirm.html'),
'scope': {
'title': '@',
'message': '@',
diff --git a/app/common/directives/firmware-list.js b/app/common/directives/firmware-list.js
index 6cfa3a1..781257e 100644
--- a/app/common/directives/firmware-list.js
+++ b/app/common/directives/firmware-list.js
@@ -6,7 +6,7 @@
.directive('firmwareList', ['APIUtils', function (APIUtils) {
return {
'restrict': 'E',
- 'templateUrl': 'common/directives/firmware-list.html',
+ 'template': require('./firmware-list.html'),
'scope': {
'title': '@',
'firmwares': '=',
diff --git a/app/common/directives/loader.js b/app/common/directives/loader.js
index 9a06055..b37a898 100644
--- a/app/common/directives/loader.js
+++ b/app/common/directives/loader.js
@@ -6,11 +6,11 @@
.directive('loader', function () {
return {
'restrict': 'E',
- 'templateUrl': 'common/directives/loader.html',
+ 'template': require('./loader.html'),
scope: {
loading: '='
}
};
});
-})(window.angular);
\ No newline at end of file
+})(window.angular);
diff --git a/app/common/directives/log-event.html b/app/common/directives/log-event.html
index 350cc8d..970598d 100644
--- a/app/common/directives/log-event.html
+++ b/app/common/directives/log-event.html
@@ -41,7 +41,7 @@
<div>
<div class="event__actions">
<button class="btn-meta-copy" clipboard text="event.additional_data" on-copied="copySuccess(event)" on-error="copyfailed(err)">
- <img class="event__icon" src="assets/images/icon-copy.svg" alt=""/><span ng-if="!event.copied">Copy</span><span ng-if="event.copied">Copied</span>
+ <img class="event__icon" src="../../assets/images/icon-copy.svg" alt=""/><span ng-if="!event.copied">Copy</span><span ng-if="event.copied">Copied</span>
</button>
<button
class="btn-delete"
@@ -50,10 +50,10 @@
ng-disabled="multiSelected">
<img
class="event__icon"
- src="assets/images/icon-trashcan.svg"
+ src="../../assets/images/icon-trashcan.svg"
alt=""/>Delete
</button>
- <button class="btn-resolve" ng-class="{'disabled': (event.Resolved == 1 || multiSelected)}" ng-click="resolveEvent(event)" ng-disabled="event.Resolved == 1 || multiSelected"><img class="event__icon" src="assets/images/icon-check.svg" alt=""/>Mark as resolved</button>
+ <button class="btn-resolve" ng-class="{'disabled': (event.Resolved == 1 || multiSelected)}" ng-click="resolveEvent(event)" ng-disabled="event.Resolved == 1 || multiSelected"><img class="event__icon" src="../../assets/images/icon-check.svg" alt=""/>Mark as resolved</button>
</div>
<div class="event__related" ng-show="event.related_items.length">
<p class="inline event__related-label">Related items:</p>
@@ -62,4 +62,4 @@
</div>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
diff --git a/app/common/directives/log-event.js b/app/common/directives/log-event.js
index 51bb5dd..e858239 100644
--- a/app/common/directives/log-event.js
+++ b/app/common/directives/log-event.js
@@ -6,7 +6,7 @@
.directive('logEvent', ['APIUtils', function (APIUtils) {
return {
'restrict': 'E',
- 'templateUrl': 'common/directives/log-event.html',
+ 'template': require('./log-event.html'),
'scope': {
'event': '=',
'tmz': '=',
diff --git a/app/common/directives/log-filter.js b/app/common/directives/log-filter.js
index 527d347..bc2da0e 100644
--- a/app/common/directives/log-filter.js
+++ b/app/common/directives/log-filter.js
@@ -6,7 +6,7 @@
.directive('logFilter', ['APIUtils', function (APIUtils) {
return {
'restrict': 'E',
- 'templateUrl': 'common/directives/log-filter.html',
+ 'template': require('./log-filter.html'),
'controller': ['$rootScope', '$scope','dataService', '$location', function($rootScope, $scope, dataService, $location){
$scope.dataService = dataService;
$scope.toggleSeverityAll = function(){
diff --git a/app/common/directives/log-search-control.js b/app/common/directives/log-search-control.js
index b198f2d..c610c18 100644
--- a/app/common/directives/log-search-control.js
+++ b/app/common/directives/log-search-control.js
@@ -6,7 +6,7 @@
.directive('logSearchControl', ['APIUtils', function (APIUtils) {
return {
'restrict': 'E',
- 'templateUrl': 'common/directives/log-search-control.html',
+ 'template': require('./log-search-control.html'),
'controller': ['$rootScope', '$scope','dataService', '$location', function($rootScope, $scope, dataService, $location){
$scope.dataService = dataService;
$scope.doSearchOnEnter = function (event) {