forms-angular 0.12.0-beta.196 → 0.12.0-beta.198

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.
@@ -3986,6 +3986,7 @@ var fng;
3986
3986
  }, $scope.handleHttpError);
3987
3987
  },
3988
3988
  deleteRecord: function deleteRecord(id, $scope, ctrlState) {
3989
+ $scope.phase = "deleting";
3989
3990
  SubmissionsService.deleteRecord($scope.modelName, id)
3990
3991
  .then(function () {
3991
3992
  if (typeof $scope.dataEventFunctions.onAfterDelete === "function") {
@@ -4024,8 +4025,12 @@ var fng;
4024
4025
  }
4025
4026
  else {
4026
4027
  $scope.showError(data);
4028
+ $scope.phase = "ready";
4027
4029
  }
4028
- }, $scope.handleHttpError);
4030
+ }, function (err) {
4031
+ $scope.handleHttpError(err);
4032
+ $scope.phase = "ready";
4033
+ });
4029
4034
  },
4030
4035
  createNew: function createNew(dataToSave, options, $scope, ctrlState) {
4031
4036
  SubmissionsService.createRecord($scope.modelName, dataToSave)
@@ -4387,7 +4392,7 @@ var fng;
4387
4392
  };
4388
4393
  $scope.isCancelDisabled = function () {
4389
4394
  var _a;
4390
- if ($scope[$scope.topLevelFormName] && $scope[$scope.topLevelFormName].$pristine) {
4395
+ if (($scope[$scope.topLevelFormName] && $scope[$scope.topLevelFormName].$pristine) || $scope.phase !== "ready") {
4391
4396
  return true;
4392
4397
  }
4393
4398
  else if (typeof ((_a = $scope.disableFunctions) === null || _a === void 0 ? void 0 : _a.isCancelDisabled) === "function") {
@@ -4468,7 +4473,7 @@ var fng;
4468
4473
  else {
4469
4474
  $scope.whyDisabled = "Top level form name invalid";
4470
4475
  }
4471
- if (pristine || !!$scope.whyDisabled) {
4476
+ if (pristine || !!$scope.whyDisabled || $scope.phase !== "ready") {
4472
4477
  return true;
4473
4478
  }
4474
4479
  else if (typeof ((_a = $scope.disableFunctions) === null || _a === void 0 ? void 0 : _a.isSaveDisabled) !== "function") {
@@ -4487,7 +4492,7 @@ var fng;
4487
4492
  };
4488
4493
  $scope.isDeleteDisabled = function () {
4489
4494
  var _a;
4490
- if (!$scope.id) {
4495
+ if (!$scope.id || $scope.phase !== "ready") {
4491
4496
  return true;
4492
4497
  }
4493
4498
  else if (typeof ((_a = $scope.disableFunctions) === null || _a === void 0 ? void 0 : _a.isDeleteDisabled) === "function") {
@@ -5379,7 +5384,7 @@ var fng;
5379
5384
  var formsAngular = fng.formsAngular;
5380
5385
 
5381
5386
  angular.module('formsAngular').run(['$templateCache', function($templateCache) {$templateCache.put('base-analysis.html','<div ng-controller="AnalysisCtrl">\n <error-display></error-display>\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');
5382
- $templateCache.put('base-edit.html','<div ng-controller="BaseCtrl">\n <error-display></error-display>\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');
5387
+ $templateCache.put('base-edit.html','<div ng-controller="BaseCtrl">\n <error-display></error-display>\n <div ng-hide="phase == \'ready\'" 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');
5383
5388
  $templateCache.put('base-list-view.html','<div ng-controller="BaseCtrl">\n <error-display></error-display>\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');
5384
5389
  $templateCache.put('base-list.html','<div ng-controller="BaseCtrl">\n <error-display></error-display>\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');
5385
5390
  $templateCache.put('base-view.html','<div ng-controller="BaseCtrl">\n <error-display></error-display>\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 ng-repeat="field in listSchema" ng-bind-html="getListData(record, field.name) + \' \'"></span>\n </h1>\n </div>\n </div>\n <div class="container-fluid page-body edit-body">\n <form-input name="baseForm" schema="baseSchema()" formstyle="compact" viewform="true"></form-input>\n </div>\n</div>\n');