@rh-support/utils
Advanced tools
Comparing version 0.0.82 to 0.0.83
@@ -1,2 +0,2 @@ | ||
define(['exports', 'lodash/isEmpty', 'lodash/includes', 'lodash/filter', 'lodash/forEach', 'lodash/map', 'lodash/isFunction', 'lodash/reduce', 'lodash/concat', 'lodash/merge', 'js-markdown-extra', 'lodash/assign', 'lodash/get', 'lodash/isString', 'marked', 'lodash/orderBy', 'lodash/remove', 'solr-query-builder', 'qs', 'lodash/sortBy'], function (exports, isEmpty, includes, filter, forEach, map, isFunction, reduce, concat, merge, jsMarkdownExtra, assign, get, isString, marked, orderBy, filter$1, SolrQueryBuilder, qs, sortBy) { 'use strict'; | ||
define(['exports', 'lodash/isEmpty', 'lodash/includes', 'lodash/filter', 'lodash/forEach', 'lodash/map', 'lodash/isFunction', 'lodash/reduce', 'lodash/concat', 'lodash/merge', 'js-markdown-extra', 'lodash/assign', 'lodash/get', 'lodash/isString', 'marked', 'lodash/orderBy', 'lodash/remove', 'lodash/find', 'solr-query-builder', 'qs', 'lodash/sortBy'], function (exports, isEmpty, includes, filter, forEach, map, isFunction, reduce, concat, merge, jsMarkdownExtra, assign, get, isString, marked, orderBy, filter$1, find, SolrQueryBuilder, qs, sortBy) { 'use strict'; | ||
@@ -18,2 +18,3 @@ isEmpty = isEmpty && isEmpty.hasOwnProperty('default') ? isEmpty['default'] : isEmpty; | ||
filter$1 = filter$1 && filter$1.hasOwnProperty('default') ? filter$1['default'] : filter$1; | ||
find = find && find.hasOwnProperty('default') ? find['default'] : find; | ||
SolrQueryBuilder = SolrQueryBuilder && SolrQueryBuilder.hasOwnProperty('default') ? SolrQueryBuilder['default'] : SolrQueryBuilder; | ||
@@ -597,11 +598,7 @@ qs = qs && qs.hasOwnProperty('default') ? qs['default'] : qs; | ||
// import { ITopProducts } from '@rh-support/api'; | ||
const handleProductSearchResponse = (response) => { | ||
const productsResult = response; | ||
// adding selectedVersion | ||
for (let product of productsResult) { | ||
if (product.versions) { | ||
product.selectedVersion = product.versions.includes(product.featuredVersion) ? product.featuredVersion : product.versions[0]; | ||
} | ||
} | ||
const handleProductSearchResponse = (productsResultAll, productsResultEntitled = []) => { | ||
const productsResult = map(productsResultAll, product => { | ||
var _a, _b, _c; | ||
return Object.assign(Object.assign({}, product), { isEntitledProduct: !isEmpty(find(productsResultEntitled, p => p.name === product.product)), selectedVersion: ((_a = product.versions) === null || _a === void 0 ? void 0 : _a.includes(product.featuredVersion)) ? product.featuredVersion : (_c = (_b = product) === null || _b === void 0 ? void 0 : _b.versions[0], (_c !== null && _c !== void 0 ? _c : '')) }); | ||
}); | ||
// first top 5 products before sorting | ||
@@ -608,0 +605,0 @@ // we get products based on the highest number of support cases |
@@ -1,2 +0,3 @@ | ||
import { IProductResponse } from '@rh-support/api'; | ||
export declare const handleProductSearchResponse: (response: any) => IProductResponse; | ||
import { IProductResponse, ITopProducts } from '@rh-support/api'; | ||
import { IProduct as IHydraProduct } from 'hydrajs/@types/models/product'; | ||
export declare const handleProductSearchResponse: (productsResultAll: ITopProducts[], productsResultEntitled?: IHydraProduct[]) => IProductResponse; |
import orderBy from 'lodash/orderBy'; | ||
import filter from 'lodash/remove'; | ||
// import { ITopProducts } from '@rh-support/api'; | ||
export const handleProductSearchResponse = (response) => { | ||
const productsResult = response; | ||
// adding selectedVersion | ||
for (let product of productsResult) { | ||
if (product.versions) { | ||
product.selectedVersion = product.versions.includes(product.featuredVersion) ? product.featuredVersion : product.versions[0]; | ||
} | ||
} | ||
import map from 'lodash/map'; | ||
import find from 'lodash/find'; | ||
import isEmpty from 'lodash/isEmpty'; | ||
export const handleProductSearchResponse = (productsResultAll, productsResultEntitled = []) => { | ||
const productsResult = map(productsResultAll, product => { | ||
var _a, _b, _c; | ||
return Object.assign(Object.assign({}, product), { isEntitledProduct: !isEmpty(find(productsResultEntitled, p => p.name === product.product)), selectedVersion: ((_a = product.versions) === null || _a === void 0 ? void 0 : _a.includes(product.featuredVersion)) ? product.featuredVersion : (_c = (_b = product) === null || _b === void 0 ? void 0 : _b.versions[0], (_c !== null && _c !== void 0 ? _c : '')) }); | ||
}); | ||
// first top 5 products before sorting | ||
@@ -13,0 +12,0 @@ // we get products based on the highest number of support cases |
{ | ||
"name": "@rh-support/utils", | ||
"version": "0.0.82", | ||
"version": "0.0.83", | ||
"description": "> TODO: description", | ||
@@ -57,4 +57,4 @@ "author": "Vikas Rathee <vrathee@redhat.com>", | ||
"dependencies": { | ||
"@rh-support/api": "^0.0.82", | ||
"@rh-support/types": "^0.0.82", | ||
"@rh-support/api": "^0.0.83", | ||
"@rh-support/types": "^0.0.83", | ||
"dot": "^1.1.3", | ||
@@ -75,3 +75,3 @@ "hydrajs": "git+https://gitlab.cee.redhat.com/redhataccess/hydrajs.git#2.0.37", | ||
}, | ||
"gitHead": "d8b2f591c2ef59040af14cfb90cd48b5a17db73e" | ||
"gitHead": "18f71eac5a86e4586553b4f71eff30bed5a88480" | ||
} |
96378
+ Added@rh-support/api@0.0.83(transitive)
+ Added@rh-support/types@0.0.83(transitive)
- Removed@rh-support/api@0.0.82(transitive)
- Removed@rh-support/types@0.0.82(transitive)
Updated@rh-support/api@^0.0.83
Updated@rh-support/types@^0.0.83