Skip to content

Commit d6b7645

Browse files
authored
Merge pull request #45 from cloudblue/LITE-22276-Add-default-filter-in-Get-New-Cases
LITE-22276 Add default filter and set to 10 records to show
2 parents 6706c25 + 21c4890 commit d6b7645

File tree

6 files changed

+17
-34
lines changed

6 files changed

+17
-34
lines changed

lib/connect/api/caseRequests/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const CASE_COMMENTS_FILTERS_MAP = {
2727
};
2828

2929
const searchCases = async (client, data) => {
30-
const limit = data.records_per_page || 100;
30+
const limit = data.records_per_page || 10;
3131
let offset = 0;
3232
let results = [];
3333
let response = [];

lib/fields/input/search_cases.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,6 @@ const FILTER_FIELDS = {
1616
list: false,
1717
},
1818
},
19-
status: {
20-
default: {
21-
key: 'state',
22-
label: 'Case Status',
23-
helpText: 'Using this filter only cases matching the requested status will be available for the Zap.',
24-
required: false,
25-
choices: {
26-
pending: 'Pending',
27-
inquiring: 'Inquiring',
28-
resolved: 'Resolved',
29-
closed: 'Closed',
30-
},
31-
list: false,
32-
},
33-
},
3419
priority: {
3520
default: {
3621
key: 'priority',
@@ -104,13 +89,24 @@ async function getFilterFields(z, bundle) {
10489
}
10590

10691
module.exports = [
92+
{
93+
key: 'state',
94+
label: 'Case Status',
95+
helpText: 'Using this filter only cases matching the requested status will be available for the Zap.',
96+
required: true,
97+
choices: {
98+
pending: 'Pending',
99+
inquiring: 'Inquiring',
100+
resolved: 'Resolved',
101+
closed: 'Closed',
102+
},
103+
},
107104
{
108105
key: 'filters',
109106
label: 'Additional filters',
110107
type: 'string',
111108
choices: {
112109
id: 'Case ID',
113-
status: 'Case Status',
114110
priority: 'Priority',
115111
from_account: 'From Acccount',
116112
from_actor: 'From Actor',

lib/triggers/caseRequest/new_case.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
+ 'this option is especially useful in the case you are creating a Zap for an account either with a lot '
3030
+ 'of requests or to limit the amount of samples obtained while designing the zap.',
3131
type: 'integer',
32-
default: '100',
32+
default: '10',
3333
required: false,
3434
},
3535
]),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "connect-fulfillment-zapier-app",
3-
"version": "24.0.0",
3+
"version": "24.0.1",
44
"description": "A Zapier App to automate Cloud Blue Connect Fulfillment workflows.",
55
"repository": {
66
"type": "git",

tests/specs/connect/api/caseRequests/actions.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('caseRequests.actions', () => {
4343
$le: '2019-12-05T09:11:22.000Z'
4444
},
4545
offset: 0,
46-
limit: 100,
46+
limit: 10,
4747
});
4848
});
4949

@@ -57,7 +57,7 @@ describe('caseRequests.actions', () => {
5757
await searchCases(client, data);
5858
expect(mockedFn).toHaveBeenCalledWith({
5959
offset: 0,
60-
limit: 100,
60+
limit: 10,
6161
});
6262
});
6363

tests/specs/fields/input/searchCases.spec.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,6 @@ describe('search cases', () => {
2525
const fn = _.filter(inputFields, (item) => typeof item === 'function')[0];
2626
const fields = await fn(null, bundle);
2727
expect(fields).toEqual([
28-
{
29-
key: 'state',
30-
required: false,
31-
label: 'Case Status',
32-
helpText: 'Using this filter only cases matching the requested status will be available for the Zap.',
33-
list: false,
34-
choices: {
35-
'closed':'Closed',
36-
'inquiring':'Inquiring',
37-
'pending':'Pending',
38-
'resolved':'Resolved',
39-
}
40-
},
4128
{
4229
key: 'priority',
4330
label: 'Using this filter only cases matching the requested Priority will be available for the Zap.',

0 commit comments

Comments
 (0)