Skip to content

Commit

Permalink
Remove js function miUncompressedId
Browse files Browse the repository at this point in the history
  • Loading branch information
imtayadeway committed Nov 1, 2017
1 parent bab834d commit 2d17eef
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
8 changes: 0 additions & 8 deletions app/assets/javascripts/miq_application.js
Original file line number Diff line number Diff line change
Expand Up @@ -1656,14 +1656,6 @@ function miqScrollToSelected(div_name) {
}
}

function miqUncompressedId(id) {
if (id.match(/r/)) {
var splat = id.split('r');
return sprintf('%s%012s', splat[0], splat[1]);
}
return id;
}

function queryParam(name) { return QS(window.location.href).get(name); }

function miqFormatNotification(text, bindings) {
Expand Down
3 changes: 1 addition & 2 deletions app/assets/javascripts/services/catalog/catalog_item_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ ManageIQ.angular.app.service('catalogItemDataFactory', ['API', function(API) {

this.getCatalogItemData = function(st_id) {
if (st_id !== undefined) {
return API.get(urlBase + '/' + miqUncompressedId(st_id));
return API.get(urlBase + '/' + st_id);
}
};
}]);

12 changes: 0 additions & 12 deletions spec/javascripts/miq_application_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,18 +466,6 @@ describe('miq_application.js', function() {
});
});

describe('miqUncompressedId', function () {
it('returns uncompressed id unchanged', function() {
expect(miqUncompressedId('123')).toEqual('123');
expect(miqUncompressedId('12345678901234567890')).toEqual('12345678901234567890');
});

it('uncompresses compressed id', function() {
expect(miqUncompressedId('1r23')).toEqual('1000000000023');
expect(miqUncompressedId('999r123456789012')).toEqual('999123456789012');
});
});

describe('miqFormatNotification', function () {
context('single placeholder', function () {
it('replaces placeholders with bindings', function () {
Expand Down

0 comments on commit 2d17eef

Please sign in to comment.