Skip to content

Commit

Permalink
Use server generated cids
Browse files Browse the repository at this point in the history
- Placement.js: use resource defined cid instead of generating one client side
- _test_responses.js: Updated to include cids
- gulpfile.js: Added task option to skip version bump
- package.json: Bumped minor to 1.14.0
  • Loading branch information
kfitzgerald committed Apr 6, 2020
1 parent 09ba791 commit b54d1f4
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 44 deletions.
9 changes: 5 additions & 4 deletions dist/okanjo-bundle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! okanjo-js v1.13.2 | (c) 2013 Okanjo Partners Inc | https://okanjo.com/ */
/*! okanjo-js v1.14.0 | (c) 2013 Okanjo Partners Inc | https://okanjo.com/ */
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
Expand Down Expand Up @@ -323,7 +323,7 @@ var okanjo = function (window, document) {
/**
* Okanjo version
*/
version: "1.13.2",
version: "1.14.0",

/**
* Placeholder
Expand Down Expand Up @@ -3476,7 +3476,8 @@ var okanjo = function (window, document) {
key: '_handleResourceMouseDown',
value: function _handleResourceMouseDown(type, resource, e) {
// Generate a new click id for this event
var clickId = okanjo.util.shortid();
// const clickId = okanjo.util.shortid();
var clickId = resource._cid;

// Start building the event
var event = okanjo.metrics.create(this._metricBase, {
Expand Down Expand Up @@ -5002,7 +5003,7 @@ var okanjo = function (window, document) {
return okanjo;
}));

/*! okanjo-js v1.13.2 | (c) 2013 Okanjo Partners Inc | https://okanjo.com/ */
/*! okanjo-js v1.14.0 | (c) 2013 Okanjo Partners Inc | https://okanjo.com/ */
(function(okanjo) {(function (window) {

var okanjo = window.okanjo;
Expand Down
12 changes: 6 additions & 6 deletions dist/okanjo-bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/okanjo-bundle.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/okanjo-metrics.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! okanjo-metrics.js v1.13.2 | (c) 2013 Okanjo Partners Inc | https://okanjo.com/ */
/*! okanjo-metrics.js v1.14.0 | (c) 2013 Okanjo Partners Inc | https://okanjo.com/ */
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
Expand Down Expand Up @@ -319,7 +319,7 @@ var okanjo = function (window, document) {
/**
* Okanjo version
*/
version: "1.13.2",
version: "1.14.0",

/**
* Placeholder
Expand Down
4 changes: 2 additions & 2 deletions dist/okanjo-metrics.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/okanjo-metrics.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/okanjo-templates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/okanjo-templates.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/okanjo-templates.min.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions dist/okanjo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! okanjo-js v1.13.2 | (c) 2013 Okanjo Partners Inc | https://okanjo.com/ */
/*! okanjo-js v1.14.0 | (c) 2013 Okanjo Partners Inc | https://okanjo.com/ */
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
Expand Down Expand Up @@ -323,7 +323,7 @@ var okanjo = function (window, document) {
/**
* Okanjo version
*/
version: "1.13.2",
version: "1.14.0",

/**
* Placeholder
Expand Down Expand Up @@ -3476,7 +3476,8 @@ var okanjo = function (window, document) {
key: '_handleResourceMouseDown',
value: function _handleResourceMouseDown(type, resource, e) {
// Generate a new click id for this event
var clickId = okanjo.util.shortid();
// const clickId = okanjo.util.shortid();
var clickId = resource._cid;

// Start building the event
var event = okanjo.metrics.create(this._metricBase, {
Expand Down
8 changes: 4 additions & 4 deletions dist/okanjo.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/okanjo.min.js.map

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ Gulp.task('pre-deploy-bump', function() {

});

Gulp.task('pre-deploy-release', ['pre-deploy-bump', 'full-build'], function() {

function CommitTagPush() {
const Stream = require('stream');
//function cb(obj) {
// var stream = new Stream.Transform({objectMode: true});
Expand Down Expand Up @@ -450,6 +449,14 @@ Gulp.task('pre-deploy-release', ['pre-deploy-bump', 'full-build'], function() {
cb();
});
}));
}

Gulp.task('pre-deploy-release', ['pre-deploy-bump', 'full-build'], function() {
return CommitTagPush();
});

Gulp.task('pre-deploy-release-no-bump', ['full-build'], function() {
return CommitTagPush();
});

Gulp.task('deploy-s3-latest', function() {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "okanjo-js",
"homepage": "https://okanjo.com/",
"version": "1.13.2",
"version": "1.14.0",
"description": "Okanjo JavaScript Widget Framework",
"main": "index.js",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion src/Placement.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@
*/
_handleResourceMouseDown(type, resource, e) {
// Generate a new click id for this event
const clickId = okanjo.util.shortid();
// const clickId = okanjo.util.shortid();
const clickId = resource._cid;

// Start building the event
const event = okanjo.metrics.create(this._metricBase, {
Expand Down
33 changes: 22 additions & 11 deletions test/_test_responses.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ module.exports.getExampleArticlesResponse = () => {
"created": "2017-05-12T14:05:44.567Z",
"updated": "2017-05-12T14:05:45.460Z",
"backfill": false,
"shortfill": false
"shortfill": false,
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ech1"
},
{
"id": "article_test_2gWFnrrPHhoJPDQoA",
Expand Down Expand Up @@ -84,7 +85,8 @@ module.exports.getExampleArticlesResponse = () => {
"created": "2017-05-12T14:05:44.554Z",
"updated": "2017-05-12T14:05:44.561Z",
"backfill": false,
"shortfill": false
"shortfill": false,
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ech2"
},
{
"id": "article_test_2gWFnrrPHhoJPDQoA",
Expand Down Expand Up @@ -118,7 +120,8 @@ module.exports.getExampleArticlesResponse = () => {
"created": "2017-05-12T14:05:44.554Z",
"updated": "2017-05-12T14:05:44.561Z",
"backfill": false,
"shortfill": false
"shortfill": false,
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ech3"
},
{
"id": "article_test_2gWFnrrPHhoJPDQoA",
Expand Down Expand Up @@ -152,7 +155,8 @@ module.exports.getExampleArticlesResponse = () => {
"created": "2017-05-12T14:05:44.554Z",
"updated": "2017-05-12T14:05:44.561Z",
"backfill": false,
"shortfill": false
"shortfill": false,
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ech4"
},
{
"id": "article_test_2gWFnrrPHhoJPDQoA",
Expand Down Expand Up @@ -186,7 +190,8 @@ module.exports.getExampleArticlesResponse = () => {
"created": "2017-05-12T14:05:44.554Z",
"updated": "2017-05-12T14:05:44.561Z",
"backfill": false,
"shortfill": false
"shortfill": false,
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ech5"
}
],
total: 2,
Expand Down Expand Up @@ -245,7 +250,8 @@ module.exports.getExampleProductResponse = () => {
"created": "2017-05-02T19:00:05.519Z",
"updated": null,
"backfill": false,
"shortfill": false
"shortfill": false,
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ech26"
}, {
"id": "product_test_2gT3kBcwVQZ1kpEmb",
"store_id": "store_2gT3kBcwVQZ1kpEmc",
Expand Down Expand Up @@ -278,7 +284,8 @@ module.exports.getExampleProductResponse = () => {
"created": "2017-04-30T19:00:14.114Z",
"updated": "2017-05-02T19:00:18.048Z",
"backfill": false,
"shortfill": false
"shortfill": false,
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ech7"
}
],
total: 2,
Expand Down Expand Up @@ -335,7 +342,8 @@ module.exports.getExampleSplitfillProductResponse = () => {
"updated": null,
"backfill": false,
"shortfill": false,
"splitfill_segment": "test split segment"
"splitfill_segment": "test split segment",
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ech8"
}, {
"id": "product_test_2gT3kBcwVQZ1kpEmb",
"store_id": "store_2gT3kBcwVQZ1kpEmc",
Expand Down Expand Up @@ -369,7 +377,8 @@ module.exports.getExampleSplitfillProductResponse = () => {
"updated": "2017-05-02T19:00:18.048Z",
"backfill": false,
"shortfill": false,
"splitfill_segment": null
"splitfill_segment": null,
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ech9"
}
],
total: 2,
Expand Down Expand Up @@ -414,7 +423,8 @@ module.exports.getExampleSplitfillArticlesResponse = () => {
"updated": "2017-05-12T14:05:45.460Z",
"backfill": false,
"shortfill": false,
"splitfill_segment": "test split segment"
"splitfill_segment": "test split segment",
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ec10"
},
{
"id": "article_test_2gWFnrrPHhoJPDQoA",
Expand Down Expand Up @@ -449,7 +459,8 @@ module.exports.getExampleSplitfillArticlesResponse = () => {
"updated": "2017-05-12T14:05:44.561Z",
"backfill": false,
"shortfill": false,
"splitfill_segment": null
"splitfill_segment": null,
"_cid": "SSCLK2EiyYZ5Y4EriWsEaC0Ec11"
}
],
total: 2,
Expand Down

0 comments on commit b54d1f4

Please sign in to comment.