PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.2
JetFormBuilder — Dynamic Blocks Form Builder v3.1.2
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / assets / src / admin-vuex-package / store / modules / action / actions.js
jetformbuilder / assets / src / admin-vuex-package / store / modules / action Last commit date
actions.js 2 years ago getters.js 2 years ago index.js 2 years ago mutations.js 2 years ago state.js 2 years ago
actions.js
47 lines
1 import Constants from '../../../constants';
2
3 export default {
4 beforeRunFetch( { getters, rootGetters } ) {
5 if ( Constants.CHOOSE_ACTION !== getters.processContext ) {
6 return;
7 }
8 const label = rootGetters['messages/label'];
9
10 if ( ! getters.getChecked.length ) {
11 throw new Error( label( 'empty_checked' ) );
12 }
13
14 if ( ! getters.getCurrentAction?.endpoint ) {
15 throw new Error( label( 'empty_action' ) );
16 }
17 },
18 runRowAction( { commit, getters } ) {
19 commit( 'toggleDoingAction', null, { root: true } );
20 commit( 'toggleLoading', 'page' );
21
22 const onFinish = () => {
23 commit( 'toggleLoading', 'page' );
24 commit( 'toggleDoingAction', null, { root: true } );
25 //commit( 'clearProcess' );
26 };
27
28 try {
29 getters.getActionPromise().finally( onFinish );
30 } catch ( error ) {
31 onFinish();
32 }
33 },
34 beforeRowAction( { state } ) {
35 const { action, payload = [] } = state.currentProcess;
36
37 if ( 'function' !== typeof state.beforeActions[ action ] ) {
38 return;
39 }
40
41 const promise = state.beforeActions[ action ] ?? false;
42
43 promise( ...payload );
44
45 throw new Error();
46 },
47 };