forms-angular 0.12.0-beta.228 → 0.12.0-beta.229

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4412,29 +4412,39 @@ var fng;
4412
4412
  }
4413
4413
  });
4414
4414
  $scope.showError = function (error, alertTitle) {
4415
- $scope.alertTitle = alertTitle ? alertTitle : "Error!";
4416
- $timeout(function () {
4417
- $scope.phase = 'ready';
4418
- }, 25);
4419
- if (typeof error === "string") {
4420
- $scope.errorMessage = $sce.trustAsHtml(error);
4421
- }
4422
- else if (!error) {
4423
- $scope.errorMessage = "An error occurred - that's all we got. Sorry.";
4424
- }
4425
- else if (error.message && typeof error.message === "string") {
4426
- $scope.errorMessage = error.message;
4415
+ function generateErrorText() {
4416
+ $timeout(function () {
4417
+ $scope.phase = "ready";
4418
+ }, 25);
4419
+ if (typeof error === "string") {
4420
+ return $sce.trustAsHtml(error);
4421
+ }
4422
+ else if (!error) {
4423
+ return "An error occurred - that's all we got. Sorry.";
4424
+ }
4425
+ else if (error.message && typeof error.message === "string") {
4426
+ return error.message;
4427
+ }
4428
+ else if (error.data && error.data.message) {
4429
+ return error.data.message;
4430
+ }
4431
+ else {
4432
+ try {
4433
+ return JSON.stringify(error);
4434
+ }
4435
+ catch (e) {
4436
+ return error;
4437
+ }
4438
+ }
4427
4439
  }
4428
- else if (error.data && error.data.message) {
4429
- $scope.errorMessage = error.data.message;
4440
+ if ($scope.errorHideTimer) {
4441
+ // we already have an error showing, so clear timeout and don't overwrite it
4442
+ $scope.clearTimeout();
4443
+ $scope.errorMessage += '<br /><br />' + generateErrorText();
4430
4444
  }
4431
4445
  else {
4432
- try {
4433
- $scope.errorMessage = JSON.stringify(error);
4434
- }
4435
- catch (e) {
4436
- $scope.errorMessage = error;
4437
- }
4446
+ $scope.alertTitle = alertTitle ? alertTitle : "Error!";
4447
+ $scope.errorMessage = generateErrorText();
4438
4448
  }
4439
4449
  $scope.errorHideTimer = window.setTimeout(function () {
4440
4450
  $scope.dismissError();
@@ -5579,7 +5589,7 @@ var fng;
5579
5589
  // expose the library
5580
5590
  var formsAngular = fng.formsAngular;
5581
5591
 
5582
- angular.module('formsAngular').run(['$templateCache', function($templateCache) {$templateCache.put('base-analysis.html','<div ng-controller="AnalysisCtrl">\n <error-display></error-display>\n <div ng-hide="!showLoading" class="loading">Loading&#8230;</div>\n <div class="container-fluid page-header report-header">\n <div ng-class="css(\'rowFluid\')">\n <div class="header-lhs col-xs-7 span7">\n <h1>{{ titleWithSubstitutions }}</h1>\n </div>\n <div class="header-rhs col-xs-5 span5">\n <form-input schema="paramSchema" name="paramForm" ng-show="paramSchema" formstyle="horizontalCompact"></form-input>\n </div>\n </div>\n </div>\n <div class="container-fluid page-body report-body">\n <div class="row-fluid report-grow">\n <div class="gridStyle" style="height:100%;" ui-grid="gridOptions" ui-grid-selection ui-grid-resize-columns></div>\n </div>\n </div>\n</div>\n');
5592
+ angular.module('formsAngular').run(['$templateCache', function($templateCache) {$templateCache.put('base-analysis.html','<div ng-controller="AnalysisCtrl">\n <error-display></error-display>\n <div ng-hide="!showLoading" class="loading">Loading&#8230;</div>\n <div class="container-fluid page-header report-header">\n <div class="header-lhs">\n <h1>{{ titleWithSubstitutions }}</h1>\n </div>\n <div class="header-rhs">\n <form-input schema="paramSchema" name="paramForm" ng-show="paramSchema" formstyle="horizontalCompact"></form-input>\n </div>\n </div>\n <div class="container-fluid page-body report-body">\n <div class="row-fluid report-grow">\n <div class="gridStyle" style="height:100%;" ui-grid="gridOptions" ui-grid-selection ui-grid-resize-columns></div>\n </div>\n </div>\n</div>\n');
5583
5593
  $templateCache.put('base-edit.html','<div ng-controller="BaseCtrl">\n <error-display></error-display>\n <div ng-hide="phase == \'ready\' && !showLoading" class="loading">Loading&#8230;</div>\n <div ng-class="css(\'rowFluid\')" class="page-header edit-header">\n <div class="header-lhs col-sm-8 span8">\n <h1 id="header-text">{{modelNameDisplay}} :\n <span id="header-data-desc">\n <span ng-show="!!editFormHeader" >{{ editFormHeader() }}</span>\n <span ng-hide="!!editFormHeader" ng-repeat="field in listSchema" ng-bind-html="getListData(record, field.name) + \' \'"></span>\n </span>\n </h1>\n </div>\n <div class="header-rhs col-sm-2 span2">\n <div form-buttons></div>\n </div>\n </div>\n <div class="container-fluid page-body edit-body">\n <form-input name="baseForm" schema="baseSchema()" formstyle="compact"></form-input>\n </div>\n<!-- <pre>-->\n <!--Record-->\n <!--{{ record | json }}-->\n <!--formSchema-->\n <!--{{ formSchema | json }}-->\n<!-- </pre>-->\n</div>\n');
5584
5594
  $templateCache.put('base-list-view.html','<div ng-controller="BaseCtrl">\n <error-display></error-display>\n <div ng-hide="!showLoading" class="loading">Loading&#8230;</div>\n <div ng-class="css(\'rowFluid\')" class="page-header list-header">\n <div class="header-lhs col-sm-8 span8">\n <h1>{{modelNameDisplay}}</h1>\n </div>\n </div>\n <div class="page-body list-body">\n <div ng-class="css(\'rowFluid\')" infinite-scroll="scrollTheList()">\n <a ng-repeat="record in recordList" ng-href="{{generateViewUrl(record)}}">\n <div class="list-item">\n <div ng-class="css(\'span\',12/listSchema.length)" ng-repeat="field in listSchema">{{getListData(record, field.name)}} </div>\n </div>\n </a>\n </div>\n </div>\n</div>\n');
5585
5595
  $templateCache.put('base-list.html','<div ng-controller="BaseCtrl">\n <error-display></error-display>\n <div ng-hide="!showLoading" class="loading">Loading&#8230;</div>\n <div ng-class="css(\'rowFluid\')" class="page-header list-header">\n <div class="header-lhs col-sm-8 span8">\n <h1>{{modelNameDisplay}}</h1>\n </div>\n <div class="header-rhs col-sm-2 span2">\n <a ng-href="{{generateNewUrl()}}"><button id="newBtn" class="btn btn-default"><i class="icon-plus"></i> New</button></a>\n </div>\n </div>\n <div class="page-body list-body">\n <div ng-class="css(\'rowFluid\')" infinite-scroll="scrollTheList()">\n <a ng-repeat="record in recordList" ng-href="{{generateEditUrl(record)}}">\n <div class="list-item">\n <div ng-class="css(\'span\',12/listSchema.length)" ng-repeat="field in listSchema">{{getListData(record, field.name)}} </div>\n </div>\n </a>\n </div>\n </div>\n</div>\n');