<af-form> - By default, show an indicator of submission status
authorTim Otten <totten@civicrm.org>
Sat, 14 Sep 2019 02:02:27 +0000 (22:02 -0400)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
ext/afform/core/ang/af/Form.js

index c5098391e6c894ab1a262c181de53c0c0e3ef493..2810e8cfe1ea2b77de4cfb5c25b2c54cee4ef50b 100644 (file)
@@ -13,7 +13,7 @@
           $scope.myCtrl.loadData();
         }
       },
-      controller: function($scope, $routeParams, crmApi4) {
+      controller: function($scope, $routeParams, crmApi4, crmStatus) {
         var schema = {}, data = {};
 
         $scope.$parent[$scope.ctrl] = this;
@@ -59,7 +59,8 @@
         };
 
         this.submit = function submit() {
-          crmApi4('Afform', 'submit', {name: this.getFormMeta().name, args: $routeParams, values: data});
+          var submission = crmApi4('Afform', 'submit', {name: this.getFormMeta().name, args: $routeParams, values: data});
+          return crmStatus({start: ts('Saving'), success: ts('Saved')}, submission);
         };
       }
     };