@rh-support/utils
Advanced tools
Comparing version 2.1.18 to 2.1.19
@@ -31,3 +31,3 @@ "use strict"; | ||
function haventLoadedProductsMetadata(apiResponse) { | ||
return isEmpty_1.default(apiResponse.data.productsResult) && !apiResponse.isFetching && !apiResponse.isError; | ||
return (0, isEmpty_1.default)(apiResponse.data.productsResult) && !apiResponse.isFetching && !apiResponse.isError; | ||
} | ||
@@ -44,3 +44,3 @@ exports.haventLoadedProductsMetadata = haventLoadedProductsMetadata; | ||
if (description) { | ||
const removeSpecialCharacters = trim_1.default(description.replace(/[^a-zA-Z0-9 ]/g, '').replace(/ {2,}/g, ' ')); | ||
const removeSpecialCharacters = (0, trim_1.default)(description.replace(/[^a-zA-Z0-9 ]/g, '').replace(/ {2,}/g, ' ')); | ||
const encodedDescription = encodeURIComponent(removeSpecialCharacters); | ||
@@ -47,0 +47,0 @@ const trimmedDescription = encodedDescription.slice(0, limit); |
@@ -30,3 +30,3 @@ "use strict"; | ||
const getAppVersion = () => { | ||
return get_1.default(window.seVersionInfo || window.supportVersionInfo || {}, 'packageVersion'); | ||
return (0, get_1.default)(window.seVersionInfo || window.supportVersionInfo || {}, 'packageVersion'); | ||
}; | ||
@@ -36,3 +36,3 @@ exports.getAppVersion = getAppVersion; | ||
const getStrataHeaders = (appName, accountNumber) => ({ | ||
redhat_client: `${appName} ${exports.getAppVersion()}`, | ||
redhat_client: `${appName} ${(0, exports.getAppVersion)()}`, | ||
account_number: accountNumber, | ||
@@ -42,3 +42,3 @@ }); | ||
const setStrataHeaders = (appName, accountNumber) => { | ||
const newStrataHeaders = exports.getStrataHeaders(appName, accountNumber); | ||
const newStrataHeaders = (0, exports.getStrataHeaders)(appName, accountNumber); | ||
strataHeaders.redhat_client = newStrataHeaders.redhat_client; | ||
@@ -62,3 +62,3 @@ strataHeaders.account_number = newStrataHeaders.account_number; | ||
const getUserAgentForCaseMode = (isCaseCreate) => { | ||
return isCaseCreate ? `Portal Case Management ${exports.getAppVersion()}` : `Solution Engine ${exports.getAppVersion()}`; | ||
return isCaseCreate ? `Portal Case Management ${(0, exports.getAppVersion)()}` : `Solution Engine ${(0, exports.getAppVersion)()}`; | ||
}; | ||
@@ -65,0 +65,0 @@ exports.getUserAgentForCaseMode = getUserAgentForCaseMode; |
@@ -103,3 +103,3 @@ "use strict"; | ||
if (keys) { | ||
return filter_1.default(keys, (key) => includes_1.default(key, namespace)); | ||
return (0, filter_1.default)(keys, (key) => (0, includes_1.default)(key, namespace)); | ||
} | ||
@@ -123,3 +123,3 @@ else { | ||
const keys = yield this.keys(); | ||
forEach_1.default(keys, (k) => { | ||
(0, forEach_1.default)(keys, (k) => { | ||
this.localForage.getItem(k).then((c) => { | ||
@@ -126,0 +126,0 @@ if (c.expiresAt && +new Date() > c.expiresAt) { |
@@ -21,3 +21,3 @@ "use strict"; | ||
PreviousCaseTypes["OTHER"] = "Other"; | ||
})(PreviousCaseTypes = exports.PreviousCaseTypes || (exports.PreviousCaseTypes = {})); | ||
})(PreviousCaseTypes || (exports.PreviousCaseTypes = PreviousCaseTypes = {})); | ||
// New Case Types | ||
@@ -34,3 +34,3 @@ var NewCaseTypes; | ||
NewCaseTypes["OTHER"] = "Other"; | ||
})(NewCaseTypes = exports.NewCaseTypes || (exports.NewCaseTypes = {})); | ||
})(NewCaseTypes || (exports.NewCaseTypes = NewCaseTypes = {})); | ||
function canManageCase(loggedInUserJwtToken) { | ||
@@ -40,3 +40,3 @@ if (!loggedInUserJwtToken || !loggedInUserJwtToken.realm_access) { | ||
} | ||
return includes_1.default(loggedInUserJwtToken.realm_access.roles, 'portal_manage_cases'); | ||
return (0, includes_1.default)(loggedInUserJwtToken.realm_access.roles, 'portal_manage_cases'); | ||
} | ||
@@ -102,3 +102,3 @@ exports.canManageCase = canManageCase; | ||
function areAllValidCaseNumbers(items) { | ||
return isEmpty_1.default(find_1.default(items, (item) => !isValidCaseNumber(item.trim()))); | ||
return (0, isEmpty_1.default)((0, find_1.default)(items, (item) => !isValidCaseNumber(item.trim()))); | ||
} | ||
@@ -105,0 +105,0 @@ exports.areAllValidCaseNumbers = areAllValidCaseNumbers; |
@@ -22,11 +22,11 @@ "use strict"; | ||
const jsons2arrays = (jsons, headers) => { | ||
headers = headers || exports.jsonsHeaders(jsons); | ||
headers = headers || (0, exports.jsonsHeaders)(jsons); | ||
// allow headers to have custom labels, defaulting to having the header data key be the label | ||
let headerLabels = headers; | ||
let headerKeys = headers; | ||
if (exports.isJsons(headers)) { | ||
if ((0, exports.isJsons)(headers)) { | ||
headerLabels = headers.map((header) => header.label); | ||
headerKeys = headers.map((header) => ({ key: header['key'], transformFn: header['transform'] })); | ||
} | ||
const data = jsons.map((object) => headerKeys.map((header) => exports.getHeaderValue(header.key, object, header.transformFn))); | ||
const data = jsons.map((object) => headerKeys.map((header) => (0, exports.getHeaderValue)(header.key, object, header.transformFn))); | ||
return [headerLabels, ...data]; | ||
@@ -45,3 +45,3 @@ }; | ||
else { | ||
return exports.escapeDoubleQuotes(o[p]); | ||
return (0, exports.escapeDoubleQuotes)(o[p]); | ||
} | ||
@@ -52,3 +52,3 @@ }, obj); | ||
? property in obj | ||
? exports.escapeDoubleQuotes(obj[property]) | ||
? (0, exports.escapeDoubleQuotes)(obj[property]) | ||
: '' | ||
@@ -64,3 +64,3 @@ : transformFn(foundValue); | ||
.map((row) => row | ||
.map((element) => exports.elementOrEmpty(element)) | ||
.map((element) => (0, exports.elementOrEmpty)(element)) | ||
.map((column) => `${enclosingCharacter}${column}${enclosingCharacter}`) | ||
@@ -71,5 +71,5 @@ .join(separator)) | ||
exports.joiner = joiner; | ||
const arrays2csv = (data, headers, separator, enclosingCharacter) => exports.joiner(headers ? [headers, ...data] : data, separator, enclosingCharacter); | ||
const arrays2csv = (data, headers, separator, enclosingCharacter) => (0, exports.joiner)(headers ? [headers, ...data] : data, separator, enclosingCharacter); | ||
exports.arrays2csv = arrays2csv; | ||
const jsons2csv = (data, headers, separator, enclosingCharacter) => exports.joiner(exports.jsons2arrays(data, headers), separator, enclosingCharacter); | ||
const jsons2csv = (data, headers, separator, enclosingCharacter) => (0, exports.joiner)((0, exports.jsons2arrays)(data, headers), separator, enclosingCharacter); | ||
exports.jsons2csv = jsons2csv; | ||
@@ -79,8 +79,8 @@ const string2csv = (data, headers, separator = ',', enclosingCharacter = '"') => headers ? `${headers.join(separator)}\n${data}` : data; | ||
const toCSV = (data, headers, separator = ',', enclosingCharacter = '"') => { | ||
if (exports.isJsons(data)) | ||
return exports.jsons2csv(data, headers, separator, enclosingCharacter); | ||
if (exports.isArrays(data)) | ||
return exports.arrays2csv(data, headers, separator, enclosingCharacter); | ||
if ((0, exports.isJsons)(data)) | ||
return (0, exports.jsons2csv)(data, headers, separator, enclosingCharacter); | ||
if ((0, exports.isArrays)(data)) | ||
return (0, exports.arrays2csv)(data, headers, separator, enclosingCharacter); | ||
if (typeof data === 'string') | ||
return exports.string2csv(data, headers, separator); | ||
return (0, exports.string2csv)(data, headers, separator); | ||
throw new TypeError(`Data should be a "String", "Array of arrays" OR "Array of objects" `); | ||
@@ -90,4 +90,4 @@ }; | ||
const buildURI = (data, headers, uFEFF = true, separator = ',', enclosingCharacter = '"') => { | ||
const csv = exports.toCSV(data, headers, separator, enclosingCharacter); | ||
const type = exports.isSafari() ? 'application/csv' : 'text/csv'; | ||
const csv = (0, exports.toCSV)(data, headers, separator, enclosingCharacter); | ||
const type = (0, exports.isSafari)() ? 'application/csv' : 'text/csv'; | ||
const blob = new Blob([uFEFF ? '\uFEFF' : '', csv], { type }); | ||
@@ -100,3 +100,3 @@ const dataURI = `data:${type};charset=utf-8,${uFEFF ? '\uFEFF' : ''}${csv}`; | ||
const downloadCSV = (data, headers, fileName = 'csvGenerator') => { | ||
const uri = exports.buildURI(data, headers); | ||
const uri = (0, exports.buildURI)(data, headers); | ||
const element = document.createElement('a'); | ||
@@ -103,0 +103,0 @@ element.setAttribute('href', uri); |
@@ -9,3 +9,3 @@ import moment from 'moment-timezone'; | ||
export declare const isFutureDate: (date: string, granularity?: moment.unitOfTime.StartOf) => boolean; | ||
declare type AddToDate = { | ||
type AddToDate = { | ||
days: number; | ||
@@ -12,0 +12,0 @@ date?: string; |
@@ -31,3 +31,3 @@ "use strict"; | ||
} | ||
return exports.formatDate(date, locale, format); | ||
return (0, exports.formatDate)(date, locale, format); | ||
}; | ||
@@ -38,15 +38,15 @@ exports.formatDateTime = formatDateTime; | ||
const getTimezoneOffsetFromTZName = (tzName) => { | ||
return moment_timezone_1.default().tz(tzName).format('Z'); | ||
return (0, moment_timezone_1.default)().tz(tzName).format('Z'); | ||
}; | ||
exports.getTimezoneOffsetFromTZName = getTimezoneOffsetFromTZName; | ||
const getPastUTCDateFromNow = (pastDays) => { | ||
return moment_timezone_1.default().subtract(pastDays, 'days').utc().format(); | ||
return (0, moment_timezone_1.default)().subtract(pastDays, 'days').utc().format(); | ||
}; | ||
exports.getPastUTCDateFromNow = getPastUTCDateFromNow; | ||
const isCurrentDateSameAsOrBeforeDate = (date, granularity = 'day') => { | ||
return moment_timezone_1.default(moment_timezone_1.default.now()).isSameOrBefore(date, granularity); | ||
return (0, moment_timezone_1.default)(moment_timezone_1.default.now()).isSameOrBefore(date, granularity); | ||
}; | ||
exports.isCurrentDateSameAsOrBeforeDate = isCurrentDateSameAsOrBeforeDate; | ||
const isFutureDate = (date, granularity = 'day') => { | ||
return moment_timezone_1.default(date).isAfter(moment_timezone_1.default(), granularity); | ||
return (0, moment_timezone_1.default)(date).isAfter((0, moment_timezone_1.default)(), granularity); | ||
}; | ||
@@ -56,3 +56,3 @@ exports.isFutureDate = isFutureDate; | ||
const { days, date = new Date() } = params; | ||
return moment_timezone_1.default(date).add(days, 'days'); | ||
return (0, moment_timezone_1.default)(date).add(days, 'days'); | ||
}; | ||
@@ -59,0 +59,0 @@ exports.addDaysToDate = addDaysToDate; |
import { IKeyValue, IOption, KeyOfExtractedType } from '@rh-support/types/shared'; | ||
declare type labelKeyFunction<O> = (item: O) => string; | ||
type labelKeyFunction<O> = (item: O) => string; | ||
export interface IToOptionsConfig<O> { | ||
@@ -4,0 +4,0 @@ labelKey?: labelKeyFunction<O> | KeyOfExtractedType<O, IOption<O>['label']>; |
@@ -13,3 +13,3 @@ "use strict"; | ||
label: ((config === null || config === void 0 ? void 0 : config.labelKey) | ||
? isFunction_1.default(config === null || config === void 0 ? void 0 : config.labelKey) | ||
? (0, isFunction_1.default)(config === null || config === void 0 ? void 0 : config.labelKey) | ||
? config === null || config === void 0 ? void 0 : config.labelKey(value) | ||
@@ -42,3 +42,3 @@ : value[config === null || config === void 0 ? void 0 : config.labelKey] || '' | ||
function toOptions(values, config = {}) { | ||
return map_1.default(values, (v) => toOption(v, config)); | ||
return (0, map_1.default)(values, (v) => toOption(v, config)); | ||
} | ||
@@ -45,0 +45,0 @@ exports.toOptions = toOptions; |
@@ -22,3 +22,3 @@ "use strict"; | ||
// log the event for prod and local envirnoment | ||
if (!isEmpty_1.default(pendo) && (hydrajs_1.Env.getEnvName() === hydrajs_1.Env.EnvNames.PROD || hydrajs_1.Env.isLocalEnv())) { | ||
if (!(0, isEmpty_1.default)(pendo) && (hydrajs_1.Env.getEnvName() === hydrajs_1.Env.EnvNames.PROD || hydrajs_1.Env.isLocalEnv())) { | ||
pendo.track(name, properties); | ||
@@ -25,0 +25,0 @@ } |
@@ -8,4 +8,3 @@ "use strict"; | ||
APP_HOST_NAMES["supportHubHostName"] = "supportHubHostName"; | ||
})(APP_HOST_NAMES || (APP_HOST_NAMES = {})); | ||
exports.APP_HOST_NAMES = APP_HOST_NAMES; | ||
})(APP_HOST_NAMES || (exports.APP_HOST_NAMES = APP_HOST_NAMES = {})); | ||
const getSFDCEnv = () => { | ||
@@ -12,0 +11,0 @@ const env = hydrajs_1.Env.getEnvName(); |
@@ -6,3 +6,3 @@ import { IMaintenance } from '@cee-eng/hydrajs/@types/models/maintenance'; | ||
JSON_HASHMAP = "JSON-HASHMAP", | ||
FEATURE_FLAG = "FEATURE-FLAG", | ||
FEATURE_FLAG = "FEATURE-FLAG",// to handle values like 0 and 1 | ||
STRING_COMMA_SEPERATED = "STRING-COMMA-SEPERATED", | ||
@@ -9,0 +9,0 @@ STRING = "STRING", |
@@ -21,5 +21,5 @@ "use strict"; | ||
PCM_CONFIG_FIELD_TYPE["NUMBER"] = "NUMBER"; | ||
})(PCM_CONFIG_FIELD_TYPE = exports.PCM_CONFIG_FIELD_TYPE || (exports.PCM_CONFIG_FIELD_TYPE = {})); | ||
})(PCM_CONFIG_FIELD_TYPE || (exports.PCM_CONFIG_FIELD_TYPE = PCM_CONFIG_FIELD_TYPE = {})); | ||
function getConfigField(config, fieldName, fieldType = null) { | ||
let values = reduce_1.default(config, (result, v) => { | ||
let values = (0, reduce_1.default)(config, (result, v) => { | ||
return v.fieldName.startsWith(fieldName) ? [...result, v.fieldValue] : result; | ||
@@ -45,5 +45,5 @@ }, []); | ||
if (fieldType === PCM_CONFIG_FIELD_TYPE.JSON_ARRAY) | ||
return reduce_1.default(parsed, concat_1.default); | ||
return (0, reduce_1.default)(parsed, concat_1.default); | ||
if (fieldType === PCM_CONFIG_FIELD_TYPE.JSON_HASHMAP) | ||
return reduce_1.default(parsed, merge_1.default); | ||
return (0, reduce_1.default)(parsed, merge_1.default); | ||
} | ||
@@ -56,4 +56,4 @@ catch (error) { | ||
const getFieldInParts = (config, fieldName, fieldType = null) => { | ||
const values = reduce_1.default(config, (result, v) => { | ||
return startsWith_1.default(v.fieldName, fieldName) ? [...result, v.fieldValue] : result; | ||
const values = (0, reduce_1.default)(config, (result, v) => { | ||
return (0, startsWith_1.default)(v.fieldName, fieldName) ? [...result, v.fieldValue] : result; | ||
}, []); | ||
@@ -68,7 +68,7 @@ if (values.length === 0) { | ||
if (fieldType === 'STRING-COMMA-SEPERATED') { | ||
return reduce_1.default(values, (acc, value) => { | ||
return (0, reduce_1.default)(values, (acc, value) => { | ||
return acc.concat(value.split(',')); | ||
}, []); | ||
} | ||
const parsed = map_1.default(values, JSON.parse); | ||
const parsed = (0, map_1.default)(values, JSON.parse); | ||
if (fieldType === 'JSON') { | ||
@@ -79,3 +79,3 @@ return parsed; | ||
if (fieldType === 'JSON-HASHMAP') { | ||
return reduce_1.default(parsed, merge_1.default); | ||
return (0, reduce_1.default)(parsed, merge_1.default); | ||
} | ||
@@ -82,0 +82,0 @@ } |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -10,3 +10,3 @@ "use strict"; | ||
const assign_1 = __importDefault(require("lodash/assign")); | ||
doT_1.default.templateSettings = assign_1.default({}, doT_1.default.templateSettings, { | ||
doT_1.default.templateSettings = (0, assign_1.default)({}, doT_1.default.templateSettings, { | ||
varname: 'pydata', | ||
@@ -17,3 +17,3 @@ strip: false, | ||
const resultText = parseDotTemplate(ruleReason, reportDetails); | ||
const html = ui_toolkit_1.markdownToHTML(resultText); | ||
const html = (0, ui_toolkit_1.markdownToHTML)(resultText); | ||
return html; | ||
@@ -20,0 +20,0 @@ } |
@@ -17,3 +17,3 @@ "use strict"; | ||
const productsResultEntitledMap = {}; | ||
forEach_1.default(productsResultEntitled, (p) => { | ||
(0, forEach_1.default)(productsResultEntitled, (p) => { | ||
// If (p.supportedForCustomer) | ||
@@ -23,7 +23,7 @@ // Needs confirmation froom CCM team before adding | ||
}); | ||
const productsResult = map_1.default(productsResultAll, (product) => { | ||
const productsResult = (0, map_1.default)(productsResultAll, (product) => { | ||
var _c, _d; | ||
const entitledProduct = productsResultEntitledMap[product.product]; | ||
const uniqueVersions = getUniqueSortedVersions(product.versions); | ||
return Object.assign(Object.assign(Object.assign({}, product), entitledProduct), { versions: uniqueVersions, isEntitledProduct: !isEmpty_1.default(entitledProduct), featuredVersion: ((_c = product.versions) === null || _c === void 0 ? void 0 : _c.includes(product.featuredVersion)) | ||
return Object.assign(Object.assign(Object.assign({}, product), entitledProduct), { versions: uniqueVersions, isEntitledProduct: !(0, isEmpty_1.default)(entitledProduct), featuredVersion: ((_c = product.versions) === null || _c === void 0 ? void 0 : _c.includes(product.featuredVersion)) | ||
? product.featuredVersion | ||
@@ -34,7 +34,7 @@ : (_d = product === null || product === void 0 ? void 0 : product.versions[0]) !== null && _d !== void 0 ? _d : '' }); | ||
const topProducts = getTopProducts(productsResult, topCount); | ||
const productsResultSorted = orderBy_1.default(productsResult, ['product'], ['asc']); | ||
const productsResultSorted = (0, orderBy_1.default)(productsResult, ['product'], ['asc']); | ||
return { | ||
productsResult: productsResultSorted, | ||
topProducts, | ||
otherProducts: difference_1.default(productsResultSorted, topProducts), | ||
otherProducts: (0, difference_1.default)(productsResultSorted, topProducts), | ||
}; | ||
@@ -54,7 +54,7 @@ }; | ||
const topProducts = getTopProducts(productsResult); | ||
const productsResultSorted = orderBy_1.default(productsResult, ['product'], ['asc']); | ||
const productsResultSorted = (0, orderBy_1.default)(productsResult, ['product'], ['asc']); | ||
return { | ||
productsResult: productsResultSorted, | ||
topProducts, | ||
otherProducts: difference_1.default(productsResultSorted, topProducts), | ||
otherProducts: (0, difference_1.default)(productsResultSorted, topProducts), | ||
}; | ||
@@ -69,5 +69,5 @@ }; | ||
function getTopProducts(products, topCount = 5) { | ||
const toReturn = remove_1.default([...products], (o) => o.recentlyFiledAgainst); | ||
const toReturn = (0, remove_1.default)([...products], (o) => o.recentlyFiledAgainst); | ||
if (toReturn.length < topCount) { | ||
const generalTopProducts = remove_1.default([...products], (o) => !o.recentlyFiledAgainst && o.isTopProduct); | ||
const generalTopProducts = (0, remove_1.default)([...products], (o) => !o.recentlyFiledAgainst && o.isTopProduct); | ||
toReturn.push(...generalTopProducts); | ||
@@ -87,3 +87,3 @@ } | ||
function getUniqueSortedVersions(versions) { | ||
return exports.versionSort(uniq_1.default(versions)); | ||
return (0, exports.versionSort)((0, uniq_1.default)(versions)); | ||
} | ||
@@ -131,5 +131,5 @@ exports.getUniqueSortedVersions = getUniqueSortedVersions; | ||
// e.g. 1.x or 1.2.x | ||
if (!validatorUtils_1.isNumber(splitArray[0])) | ||
if (!(0, validatorUtils_1.isNumber)(splitArray[0])) | ||
return { major: version }; | ||
else if (!validatorUtils_1.isNumber(splitArray[1])) | ||
else if (!(0, validatorUtils_1.isNumber)(splitArray[1])) | ||
return { major: version.split('.')[0] }; | ||
@@ -136,0 +136,0 @@ else |
@@ -10,7 +10,7 @@ "use strict"; | ||
function getRecommendationTitle(doc) { | ||
return !isEmpty_1.default(doc.publishedTitle) ? doc.publishedTitle : doc.allTitle; | ||
return !(0, isEmpty_1.default)(doc.publishedTitle) ? doc.publishedTitle : doc.allTitle; | ||
} | ||
exports.getRecommendationTitle = getRecommendationTitle; | ||
function getRecommendationAbstract(doc) { | ||
return !isEmpty_1.default(doc.publishedAbstract) ? doc.publishedAbstract : doc.abstract; | ||
return !(0, isEmpty_1.default)(doc.publishedAbstract) ? doc.publishedAbstract : doc.abstract; | ||
} | ||
@@ -17,0 +17,0 @@ exports.getRecommendationAbstract = getRecommendationAbstract; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var _a, _b, _c; | ||
if (isEmpty_1.default(sectionRef === null || sectionRef === void 0 ? void 0 : sectionRef.current)) | ||
if ((0, isEmpty_1.default)(sectionRef === null || sectionRef === void 0 ? void 0 : sectionRef.current)) | ||
return; | ||
@@ -65,3 +65,3 @@ if (!!(options === null || options === void 0 ? void 0 : options.onlyIfNotInViewport) && isElementInViewport(sectionRef, options === null || options === void 0 ? void 0 : options.navBarRef)) | ||
var _a, _b; | ||
if (isEmpty_1.default(el === null || el === void 0 ? void 0 : el.current)) { | ||
if ((0, isEmpty_1.default)(el === null || el === void 0 ? void 0 : el.current)) { | ||
return false; | ||
@@ -68,0 +68,0 @@ } |
@@ -5,3 +5,3 @@ import { ISearchSolrQuery } from '@cee-eng/hydrajs/@types/api/search'; | ||
export declare const issuesDefaultParamsObj: ISearchSolrQuery; | ||
export declare type IRecommendationAdditionalFilters = { | ||
export type IRecommendationAdditionalFilters = { | ||
[key in keyof ISolrRecommendation]?: string[] | { | ||
@@ -8,0 +8,0 @@ values: string[]; |
@@ -43,3 +43,3 @@ "use strict"; | ||
function getSolrParams(rows, highlighted_fragment_size, additionalFilters, QueryFields) { | ||
const cloneIssueParams = cloneDeep_1.default(exports.issuesDefaultParamsObj); | ||
const cloneIssueParams = (0, cloneDeep_1.default)(exports.issuesDefaultParamsObj); | ||
const issueParamsObj = Object.assign(Object.assign({}, cloneIssueParams), { rows, 'hl.fragsize': highlighted_fragment_size, seQueryFields: QueryFields || false }); | ||
@@ -46,0 +46,0 @@ additionalFilters && addFiltersToFieldQueries(issueParamsObj.fq, additionalFilters); |
@@ -35,3 +35,3 @@ import { IFacetResponse } from '@rh-support/types/shared'; | ||
}; | ||
export declare type ISolrResponseToFacetFields<T> = { | ||
export type ISolrResponseToFacetFields<T> = { | ||
[key in keyof T]?: IFacetResponse[]; | ||
@@ -45,4 +45,4 @@ }; | ||
*/ | ||
export declare function solrResponseToFacetFields<T, U>(solrResponse: T): ISolrResponseToFacetFields<U>; | ||
export declare type ISolrResponseToPivotFields<T, U> = { | ||
export declare function solrResponseToFacetFields<T, U extends object>(solrResponse: T): ISolrResponseToFacetFields<U>; | ||
export type ISolrResponseToPivotFields<T, U> = { | ||
[key in keyof T]?: U[]; | ||
@@ -57,3 +57,3 @@ }; | ||
*/ | ||
export declare function solrResponseToPivotFields<T, U, V>(solrResponse: T): ISolrResponseToPivotFields<U, V>; | ||
export declare function solrResponseToPivotFields<T, U extends object, V>(solrResponse: T): ISolrResponseToPivotFields<U, V>; | ||
/** | ||
@@ -60,0 +60,0 @@ * |
@@ -12,3 +12,3 @@ "use strict"; | ||
function If(cond, v) { | ||
return !isEmpty_1.default(cond) ? v || cond : ''; | ||
return !(0, isEmpty_1.default)(cond) ? v || cond : ''; | ||
} | ||
@@ -39,3 +39,3 @@ function processFQValue(val, { join }) { | ||
fq: (k, v, tag, options = { processValue: { join: 'OR' } }) => { | ||
if (isEmpty_1.default(v)) | ||
if ((0, isEmpty_1.default)(v)) | ||
return solr; | ||
@@ -59,3 +59,3 @@ const _fq = query.fq || []; | ||
preBuiltfq: (k, v, tag) => { | ||
if (isEmpty_1.default(v)) | ||
if ((0, isEmpty_1.default)(v)) | ||
return solr; | ||
@@ -111,3 +111,3 @@ const _fq = query.fq || []; | ||
function solrResponseToFacetFields(solrResponse) { | ||
const solrFacets = get_1.default(solrResponse, 'facet_counts.facet_fields', {}); | ||
const solrFacets = (0, get_1.default)(solrResponse, 'facet_counts.facet_fields', {}); | ||
const facets = {}; | ||
@@ -137,6 +137,5 @@ Object.keys(solrFacets).forEach((_facetKey) => { | ||
function solrResponseToPivotFields(solrResponse) { | ||
const solrPivots = get_1.default(solrResponse, 'facet_counts.facet_pivot', {}); | ||
const solrPivots = (0, get_1.default)(solrResponse, 'facet_counts.facet_pivot', {}); | ||
const pivots = {}; | ||
Object.keys(solrPivots).forEach((_pivotKey) => { | ||
const pivotKey = _pivotKey; | ||
Object.keys(solrPivots).forEach((pivotKey) => { | ||
pivots[pivotKey] = []; | ||
@@ -243,3 +242,3 @@ for (let i = 0; i < solrPivots[pivotKey].length; i++) { | ||
const parsedQuery = lucene_1.default.parse(query); | ||
if (isEmpty_1.default(parsedQuery)) { | ||
if ((0, isEmpty_1.default)(parsedQuery)) { | ||
return {}; | ||
@@ -246,0 +245,0 @@ } |
@@ -11,3 +11,3 @@ "use strict"; | ||
StyleVariants[StyleVariants["DANGER"] = 4] = "DANGER"; | ||
})(StyleVariants = exports.StyleVariants || (exports.StyleVariants = {})); | ||
})(StyleVariants || (exports.StyleVariants = StyleVariants = {})); | ||
function getBGColorStyle(styleVariant) { | ||
@@ -14,0 +14,0 @@ return { |
import { IParseOptions, IStringifyOptions } from 'qs'; | ||
export declare function getUrlParsedParams(urlParams: string, options?: IParseOptions): any; | ||
export declare function getUrlParsedParams(urlParams: string, options?: IParseOptions): { | ||
[key: string]: unknown; | ||
}; | ||
export declare function getStringifiedParams<T>(object: T, options?: IStringifyOptions): string; | ||
@@ -4,0 +6,0 @@ export declare const REDHAT_DOT_COM_HOSTNAMES: { |
@@ -68,3 +68,3 @@ "use strict"; | ||
const updatedQuery = removeEmptyParams | ||
? pickBy_1.default(mergedQueryObject, (item) => !isFieldValueEmpty(item)) | ||
? (0, pickBy_1.default)(mergedQueryObject, (item) => !isFieldValueEmpty(item)) | ||
: mergedQueryObject; | ||
@@ -71,0 +71,0 @@ return !resetSearchParams ? getStringifiedParams(updatedQuery) : getStringifiedParams(newQuery); |
@@ -9,4 +9,4 @@ "use strict"; | ||
const sortHydraContacts = (hydraContacts) => { | ||
return sortBy_1.default(hydraContacts, 'firstName', 'lastName'); | ||
return (0, sortBy_1.default)(hydraContacts, 'firstName', 'lastName'); | ||
}; | ||
exports.sortHydraContacts = sortHydraContacts; |
@@ -9,3 +9,3 @@ import moment from 'moment-timezone'; | ||
export declare const isFutureDate: (date: string, granularity?: moment.unitOfTime.StartOf) => boolean; | ||
declare type AddToDate = { | ||
type AddToDate = { | ||
days: number; | ||
@@ -12,0 +12,0 @@ date?: string; |
import { IKeyValue, IOption, KeyOfExtractedType } from '@rh-support/types/shared'; | ||
declare type labelKeyFunction<O> = (item: O) => string; | ||
type labelKeyFunction<O> = (item: O) => string; | ||
export interface IToOptionsConfig<O> { | ||
@@ -4,0 +4,0 @@ labelKey?: labelKeyFunction<O> | KeyOfExtractedType<O, IOption<O>['label']>; |
@@ -6,3 +6,3 @@ import { IMaintenance } from '@cee-eng/hydrajs/@types/models/maintenance'; | ||
JSON_HASHMAP = "JSON-HASHMAP", | ||
FEATURE_FLAG = "FEATURE-FLAG", | ||
FEATURE_FLAG = "FEATURE-FLAG",// to handle values like 0 and 1 | ||
STRING_COMMA_SEPERATED = "STRING-COMMA-SEPERATED", | ||
@@ -9,0 +9,0 @@ STRING = "STRING", |
@@ -5,3 +5,3 @@ import { ISearchSolrQuery } from '@cee-eng/hydrajs/@types/api/search'; | ||
export declare const issuesDefaultParamsObj: ISearchSolrQuery; | ||
export declare type IRecommendationAdditionalFilters = { | ||
export type IRecommendationAdditionalFilters = { | ||
[key in keyof ISolrRecommendation]?: string[] | { | ||
@@ -8,0 +8,0 @@ values: string[]; |
@@ -35,3 +35,3 @@ import { IFacetResponse } from '@rh-support/types/shared'; | ||
}; | ||
export declare type ISolrResponseToFacetFields<T> = { | ||
export type ISolrResponseToFacetFields<T> = { | ||
[key in keyof T]?: IFacetResponse[]; | ||
@@ -45,4 +45,4 @@ }; | ||
*/ | ||
export declare function solrResponseToFacetFields<T, U>(solrResponse: T): ISolrResponseToFacetFields<U>; | ||
export declare type ISolrResponseToPivotFields<T, U> = { | ||
export declare function solrResponseToFacetFields<T, U extends object>(solrResponse: T): ISolrResponseToFacetFields<U>; | ||
export type ISolrResponseToPivotFields<T, U> = { | ||
[key in keyof T]?: U[]; | ||
@@ -57,3 +57,3 @@ }; | ||
*/ | ||
export declare function solrResponseToPivotFields<T, U, V>(solrResponse: T): ISolrResponseToPivotFields<U, V>; | ||
export declare function solrResponseToPivotFields<T, U extends object, V>(solrResponse: T): ISolrResponseToPivotFields<U, V>; | ||
/** | ||
@@ -60,0 +60,0 @@ * |
@@ -127,4 +127,3 @@ import get from 'lodash/get'; | ||
const pivots = {}; | ||
Object.keys(solrPivots).forEach((_pivotKey) => { | ||
const pivotKey = _pivotKey; | ||
Object.keys(solrPivots).forEach((pivotKey) => { | ||
pivots[pivotKey] = []; | ||
@@ -131,0 +130,0 @@ for (let i = 0; i < solrPivots[pivotKey].length; i++) { |
import { IParseOptions, IStringifyOptions } from 'qs'; | ||
export declare function getUrlParsedParams(urlParams: string, options?: IParseOptions): any; | ||
export declare function getUrlParsedParams(urlParams: string, options?: IParseOptions): { | ||
[key: string]: unknown; | ||
}; | ||
export declare function getStringifiedParams<T>(object: T, options?: IStringifyOptions): string; | ||
@@ -4,0 +6,0 @@ export declare const REDHAT_DOT_COM_HOSTNAMES: { |
{ | ||
"name": "@rh-support/utils", | ||
"version": "2.1.18", | ||
"version": "2.1.19", | ||
"description": "> TODO: description", | ||
@@ -64,3 +64,3 @@ "author": "Vikas Rathee <vrathee@redhat.com>", | ||
"@cee-eng/ui-toolkit": "1.1.6", | ||
"@rh-support/types": "2.0.2", | ||
"@rh-support/types": "2.0.3", | ||
"dompurify": "^2.2.6", | ||
@@ -75,3 +75,4 @@ "dot": "^1.1.3", | ||
"marked": "^1.2.4", | ||
"qs": "^6.11.0", | ||
"qs": "^6.7.0", | ||
"react": "18.2.0", | ||
"solr-query-builder": "1.0.1" | ||
@@ -81,10 +82,18 @@ }, | ||
"@types/dompurify": "^2.2.1", | ||
"@types/jest": "^29.5.11", | ||
"@types/lodash": "^4.14.140", | ||
"@types/lucene": "^2.1.0", | ||
"@types/marked": "^1.1.0", | ||
"@types/node": "^20.11.3", | ||
"@types/qs": "^6.9.1", | ||
"@types/react": "^17.0.14", | ||
"@types/react-dom": "^17.0.9", | ||
"@types/react": "^18.2.20", | ||
"@types/react-dom": "^18.2.18", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"moment-timezone": "^0.5.40" | ||
}, | ||
"overrides": { | ||
"@types/react": "^18.2.20", | ||
"@types/react-dom": "^18.2.18" | ||
}, | ||
"browserslist": [ | ||
@@ -94,3 +103,3 @@ "defaults and supports es6-module", | ||
], | ||
"gitHead": "c62b5ae2bab7b1b81e6911888038c34201327635" | ||
"gitHead": "f95bf012016d8a689c69d518b98266a3ac0292d9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
254572
4876
27
12
+ Addedreact@18.2.0
+ Added@rh-support/types@2.0.3(transitive)
+ Added@types/react@18.3.18(transitive)
+ Added@types/react-dom@18.3.5(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedreact@18.2.0(transitive)
- Removed@rh-support/types@2.0.2(transitive)
- Removed@types/react@17.0.83(transitive)
- Removed@types/react-dom@17.0.26(transitive)
- Removed@types/scheduler@0.16.8(transitive)
Updated@rh-support/types@2.0.3
Updatedqs@^6.7.0