Merge pull request #1785 from automatisch/make-stages-dynamic-in-pipedrive
feat(pipedrive/create-deal): add dynamic stages
This commit is contained in:
@@ -64,33 +64,18 @@ export default defineAction({
|
|||||||
value: '1',
|
value: '1',
|
||||||
description:
|
description:
|
||||||
'The ID of the stage this deal will be added to. If omitted, the deal will be placed in the first stage of the default pipeline.',
|
'The ID of the stage this deal will be added to. If omitted, the deal will be placed in the first stage of the default pipeline.',
|
||||||
options: [
|
variables: true,
|
||||||
|
source: {
|
||||||
|
type: 'query',
|
||||||
|
name: 'getDynamicData',
|
||||||
|
arguments: [
|
||||||
{
|
{
|
||||||
label: 'Qualified (Pipeline)',
|
name: 'key',
|
||||||
value: 1,
|
value: 'listStages',
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Contact Made (Pipeline)',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Prospect Qualified (Pipeline)',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Needs Defined (Pipeline)',
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Proposal Made (Pipeline)',
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Negotiations Started (Pipeline)',
|
|
||||||
value: 6,
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Owner',
|
label: 'Owner',
|
||||||
key: 'userId',
|
key: 'userId',
|
||||||
|
@@ -1,23 +1,25 @@
|
|||||||
import listActivityTypes from './list-activity-types/index.js';
|
import listActivityTypes from './list-activity-types/index.js';
|
||||||
import listCurrencies from './list-currencies/index.js';
|
import listCurrencies from './list-currencies/index.js';
|
||||||
import listDeals from './list-deals/index.js';
|
import listDeals from './list-deals/index.js';
|
||||||
import listLeads from './list-leads/index.js';
|
|
||||||
import listLeadLabels from './list-lead-labels/index.js';
|
import listLeadLabels from './list-lead-labels/index.js';
|
||||||
import listOrganizations from './list-organizations/index.js';
|
import listLeads from './list-leads/index.js';
|
||||||
import listOrganizationLabelField from './list-organization-label-field/index.js';
|
import listOrganizationLabelField from './list-organization-label-field/index.js';
|
||||||
|
import listOrganizations from './list-organizations/index.js';
|
||||||
import listPersonLabelField from './list-person-label-field/index.js';
|
import listPersonLabelField from './list-person-label-field/index.js';
|
||||||
import listPersons from './list-persons/index.js';
|
import listPersons from './list-persons/index.js';
|
||||||
|
import listStages from './list-stages/index.js';
|
||||||
import listUsers from './list-users/index.js';
|
import listUsers from './list-users/index.js';
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
listActivityTypes,
|
listActivityTypes,
|
||||||
listCurrencies,
|
listCurrencies,
|
||||||
listDeals,
|
listDeals,
|
||||||
listLeads,
|
|
||||||
listLeadLabels,
|
listLeadLabels,
|
||||||
listOrganizations,
|
listLeads,
|
||||||
listOrganizationLabelField,
|
listOrganizationLabelField,
|
||||||
|
listOrganizations,
|
||||||
listPersonLabelField,
|
listPersonLabelField,
|
||||||
listPersons,
|
listPersons,
|
||||||
|
listStages,
|
||||||
listUsers,
|
listUsers,
|
||||||
];
|
];
|
||||||
|
@@ -0,0 +1,23 @@
|
|||||||
|
export default {
|
||||||
|
name: 'List stages',
|
||||||
|
key: 'listStages',
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const stages = {
|
||||||
|
data: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
const { data } = await $.http.get('/api/v1/stages');
|
||||||
|
|
||||||
|
if (data.data?.length) {
|
||||||
|
for (const stage of data.data) {
|
||||||
|
stages.data.push({
|
||||||
|
value: stage.id,
|
||||||
|
name: stage.name,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return stages;
|
||||||
|
},
|
||||||
|
};
|
Reference in New Issue
Block a user