Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/sdk/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const validOptions = [
"ltl",
"lt",
"rcz",
"jte",
"bom",
"bom_at",
"bom_rqp",
Expand Down
22 changes: 19 additions & 3 deletions plugins/sdk/frontend/public/javascripts/countly.views.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
var v2_web = "25.4.1";
var v2_flutter = "25.4.1";
var v2_react_native = "25.4.0";
// Initial SDKs that support Journey Trigger Events
var v3_android = "26.1.0";
var v3_ios = "26.1.0";
var v3_web = "26.1.0";
var v3_flutter = "26.1.0";
var v3_react_native = "26.1.0";
// dart sdk placeholder version to indicate experimental support
var v0_dart = "25.0.0";
// Supporting SDK Versions for the SC options
Expand All @@ -41,6 +47,7 @@
ltl: { android: v1_android, ios: v1_ios, web: v1_web, flutter: v2_flutter, react_native: v2_react_native },
lt: { android: v1_android, ios: v1_ios, web: v1_web, flutter: v2_flutter, react_native: v2_react_native },
rcz: { android: v1_android, ios: v1_ios, web: v1_web, flutter: v2_flutter, react_native: v2_react_native },
jte: { android: v3_android, ios: v3_ios, web: v3_web, flutter: v3_flutter, react_native: v3_react_native },
bom_preset: { android: v2_android, ios: v2_ios, web: v2_web, flutter: v2_flutter, react_native: v2_react_native },
bom: { android: v2_android, ios: v2_ios, web: v2_web, flutter: v2_flutter, react_native: v2_react_native },
bom_at: { android: v2_android, ios: v2_ios, web: v2_web, flutter: v2_flutter, react_native: v2_react_native },
Expand All @@ -59,7 +66,7 @@
esw: { dart: v0_dart }
};

var nonJSONExperimentalKeys = ['eb', 'upb', 'sb', 'ew', 'upw', 'sw'];
var nonJSONExperimentalKeys = ['eb', 'upb', 'sb', 'ew', 'upw', 'sw', 'jte'];
var jsonExperimentalKeys = ['esb', 'esw'];
var shouldShowExperimental = true;
var experimentalKeys = ['upcl', 'filter_preset'].concat(nonJSONExperimentalKeys, jsonExperimentalKeys);
Expand Down Expand Up @@ -222,7 +229,7 @@
},
experimental: {
label: "Experimental",
list: ["upcl", "filter_preset", "eb", "upb", "sb", "esb", "ew", "upw", "sw", "esw"]
list: ["upcl", "filter_preset", "jte", "eb", "upb", "sb", "esb", "ew", "upw", "sw", "esw"]
},
},
configs: {
Expand Down Expand Up @@ -475,6 +482,15 @@
enforced: false,
value: null
},
jte: {
type: "text",
name: "Journey Trigger Events",
description: "CSV* list of event keys that should trigger a Journey<br>* Use double quotes for values with commas",
default: "",
enforced: false,
value: null,
attrs: { type: 'textarea', rows: 4, placeholder: 'event1,event2 or "event3"' }
},
filter_preset: {
type: "preset",
name: "Filtering Preset",
Expand Down Expand Up @@ -1131,7 +1147,7 @@
for (var key in this.configs) {
this.configs[key].experimental = false;
this.configs[key].tooltipMessage = "No SDK data present. Please use the latest versions of Android, Web, iOS, Flutter or RN SDKs to use this option.";
if (key === 'upcl' || key === 'eb' || key === 'upb' || key === 'sb' || key === 'esb' || key === 'ew' || key === 'upw' || key === 'sw' || key === 'esw' || key === 'filter_preset') {
if (key === 'upcl' || key === 'eb' || key === 'upb' || key === 'sb' || key === 'esb' || key === 'ew' || key === 'upw' || key === 'sw' || key === 'esw' || key === 'filter_preset' || key === 'jte') {
this.configs[key].experimental = true;
this.configs[key].tooltipMessage = "This is an experimental option. SDK support for this option may be limited or unavailable.";
}
Expand Down
1 change: 1 addition & 0 deletions plugins/sdk/tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var validOptions = {
"ltl": false,
"lt": false,
"rcz": false,
"jte": false,
"bom": false,
"bom_at": false,
"bom_rqp": false,
Expand Down
34 changes: 33 additions & 1 deletion plugins/sdk/tests/validation_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ describe('CSV/Array and JSON validation', function() {
eb: true,
upb: true,
sb: true,
esb: true
esb: true,
jte: true
};

request
Expand Down Expand Up @@ -139,6 +140,37 @@ describe('CSV/Array and JSON validation', function() {
done();
});
});

it('4. should save arrays for jte when provided as array', function(done) {
const parameter = {
jte: ['event1', 'event,2']
};

request
.post('/i/sdk-config/update-parameter')
.send({ api_key: API_KEY_ADMIN, app_id: APP_ID, parameter: JSON.stringify(parameter) })
.expect(200)
.end(function(err, res) {
should.not.exist(err);
res.body.should.have.property('result', 'Success');

request
.get('/o/sdk')
.query({ method: 'sc', app_key: APP_KEY, device_id: 'test' })
.expect(200)
.end(function(err, res) {
should.not.exist(err);
res.body.should.have.property('c');
const c = res.body.c;
c.should.have.property('jte');
c.jte.should.be.an.Array();
c.jte.should.have.length(2);
c.jte.should.containEql('event1');
c.jte.should.containEql('event,2');
done();
});
});
});
});

// CSV unit tests
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/cypress/e2e/sdk/tool_01.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ describe('1.Neutral tooltip (default at app creation)', () => {
});
it('1.3-Test', function() {
goToConfigTab(true);
checkTooltipAppears('neutral', 34);
checkTooltipAppears('neutral', 35);
});
});
2 changes: 1 addition & 1 deletion ui-tests/cypress/e2e/sdk/tool_02.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ describe('2.Warning tooltip (old Web SDK version)', () => {
});
it('2.3-Test', function() {
goToConfigTab(true);
checkTooltipAppears('warning', 34);
checkTooltipAppears('warning', 35);
});
});
2 changes: 1 addition & 1 deletion ui-tests/cypress/e2e/sdk/tool_04.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ describe('4.Mixed tooltip (old Android SDK version)', () => {
it('4.3-Test', function() {
goToConfigTab(true);
checkTooltipAppears('success', 2, true);
checkTooltipAppears('warning', 32, true);
checkTooltipAppears('warning', 33, true);
});
});
2 changes: 1 addition & 1 deletion ui-tests/cypress/e2e/sdk/tool_05.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ describe('5.Mixed tooltip (old iOS SDK version)', () => {
it('5.3-Test', function() {
goToConfigTab(true);
checkTooltipAppears('success', 2, true);
checkTooltipAppears('warning', 32, true);
checkTooltipAppears('warning', 33, true);
});
});
2 changes: 1 addition & 1 deletion ui-tests/cypress/e2e/sdk/tool_06.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ describe('6.Danger tooltip (unsupported SDK)', () => {
});
it('6.3-Test', function() {
goToConfigTab(true);
checkTooltipAppears('danger', 34);
checkTooltipAppears('danger', 35);
});
});
2 changes: 1 addition & 1 deletion ui-tests/cypress/e2e/sdk/tool_09.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ describe('9.Mixed tooltip (multiple SDK versions)', () => {
it('9.3-Test', function() {
goToConfigTab(true);
checkTooltipAppears('success', 2, true);
checkTooltipAppears('warning', 32, true);
checkTooltipAppears('warning', 33, true);
});
});
Loading