From 2c5d5bca79014d58f2ebdc15631fc50d5c9e2080 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 1 Mar 2020 21:36:26 -0500 Subject: [PATCH] APIv4 Explorer - add docs for save & execute buttons --- ang/api4Explorer/Explorer.html | 4 ++-- ang/api4Explorer/Explorer.js | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ang/api4Explorer/Explorer.html b/ang/api4Explorer/Explorer.html index c98efef6a9..90d3287deb 100644 --- a/ang/api4Explorer/Explorer.html +++ b/ang/api4Explorer/Explorer.html @@ -25,8 +25,8 @@ - - + +
diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js index 45e9eb9643..b589bdaaf3 100644 --- a/ang/api4Explorer/Explorer.js +++ b/ang/api4Explorer/Explorer.js @@ -681,6 +681,27 @@ return docs.params[name]; }; + $scope.executeDoc = function() { + var doc = { + description: ts('Runs API call on the CiviCRM database.'), + comment: ts('Results and debugging info will be displayed below.') + }; + if ($scope.action === 'delete') { + doc.WARNING = ts('This API call will be executed on the real database. Deleting data cannot be undone.'); + } + else if ($scope.action && $scope.action.slice(0, 3) !== 'get') { + doc.WARNING = ts('This API call will be executed on the real database. It cannot be undone.'); + } + return doc; + }; + + $scope.saveDoc = function() { + return { + description: ts('Save API call as a smart group.'), + comment: ts('Allows you to create a SavedSearch containing the WHERE clause of this API call.'), + }; + }; + $scope.$watch('params', writeCode, true); $scope.$watch('index', writeCode); writeCode(); -- 2.25.1