@rh-support/utils 0.2.33 → 0.2.34-alpha-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"insightRuleInfoUtils.d.ts","sourceRoot":"","sources":["../../src/insightRuleInfoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AASlE,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UAM3E;AAOD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,OAIzE"}
1
+ {"version":3,"file":"insightRuleInfoUtils.d.ts","sourceRoot":"","sources":["../../src/insightRuleInfoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AASlE,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UAI3E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,OAIzE"}
@@ -14,15 +14,9 @@ doT_1.default.templateSettings = assign_1.default({}, doT_1.default.templateSett
14
14
  function getRuleReasonHtml(ruleReason, reportDetails) {
15
15
  var resultText = parseDotTemplate(ruleReason, reportDetails);
16
16
  var html = ui_toolkit_1.markdownToHTML(resultText);
17
- var anchorTagRegex = new RegExp("<a", 'g');
18
- var modifiedHtml = html.toString().replace(anchorTagRegex, '<a class="pf-c-button pf-m-link anchor-tag-button"');
19
- return modifiedHtml;
17
+ return html;
20
18
  }
21
19
  exports.getRuleReasonHtml = getRuleReasonHtml;
22
- // TODO: Remove modifiedHtml once Accordion Bug is fixed and Replace with below code
23
- // const resultText = parseDotTemplate(ruleReason, reportDetails);
24
- // const html = markdownToHTML(resultText);
25
- // return html as string;
26
20
  function parseDotTemplate(dotString, reportDetails) {
27
21
  var tempFn = doT_1.default.template(dotString);
28
22
  var parsedDotString = tempFn(reportDetails);
@@ -5,13 +5,6 @@ export interface ITroubleshootProductResponse {
5
5
  productsResult: Partial<ISEProduct>[];
6
6
  }
7
7
  export declare const handleProductSearchResponse: (productsResultAll: ISEProduct[], productsResultEntitled?: IProductV2[], topCount?: number) => ITroubleshootProductResponse;
8
- /**
9
- * This method is used for parsing `hydra/rest/products/contact/{userName}` response form API
10
- * and need to create partial response like method `handleProductSearchResponse`
11
- * @param productsResultEntitled IProductV2[]
12
- * @returns ITroubleshootProductResponse
13
- */
14
- export declare const handleEntitledProductResponse: (productsResultEntitled?: IProductV2[]) => ITroubleshootProductResponse;
15
8
  /**
16
9
  * Tries to get top products with priority given to recentlyFiledAgainst
17
10
  * before checking general top products from un-authed SE API
@@ -1 +1 @@
1
- {"version":3,"file":"productsUtils.d.ts","sourceRoot":"","sources":["../../src/productsUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAWhF,MAAM,WAAW,4BAA4B;IACzC,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IACnC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IACrC,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;CACzC;AAED,eAAO,MAAM,2BAA2B,sBACjB,UAAU,EAAE,2BACP,UAAU,EAAE,aAC1B,MAAM,KACjB,4BA4BF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,4BACd,UAAU,EAAE,KACrC,4BAcF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,QAAQ,SAAI,GAAG,OAAO,CAAC,UAAU,CAAC,EAAE,CAOnG;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,WAE/C;AAED,wBAAgB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S,MAAM,EAAE,aAExC,CAAC;AAEF,UAAU,sBAAsB;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAkBlE"}
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
36
  };
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.getVersion = exports.versionSort = exports.versionSorter = exports.getUniqueSortedVersions = exports.getVersionIfOnlyVersion = exports.isOnlyVersion = exports.getTopProducts = exports.handleEntitledProductResponse = exports.handleProductSearchResponse = void 0;
38
+ exports.getVersion = exports.versionSort = exports.versionSorter = exports.getUniqueSortedVersions = exports.getVersionIfOnlyVersion = exports.isOnlyVersion = exports.getTopProducts = exports.handleProductSearchResponse = void 0;
39
39
  var difference_1 = __importDefault(require("lodash/difference"));
40
40
  var forEach_1 = __importDefault(require("lodash/forEach"));
41
41
  var isEmpty_1 = __importDefault(require("lodash/isEmpty"));
@@ -71,26 +71,6 @@ var handleProductSearchResponse = function (productsResultAll, productsResultEnt
71
71
  };
72
72
  };
73
73
  exports.handleProductSearchResponse = handleProductSearchResponse;
74
- /**
75
- * This method is used for parsing `hydra/rest/products/contact/{userName}` response form API
76
- * and need to create partial response like method `handleProductSearchResponse`
77
- * @param productsResultEntitled IProductV2[]
78
- * @returns ITroubleshootProductResponse
79
- */
80
- var handleEntitledProductResponse = function (productsResultEntitled) {
81
- if (productsResultEntitled === void 0) { productsResultEntitled = []; }
82
- var productsResult = productsResultEntitled.map(function (product) {
83
- return __assign(__assign({}, product), { product: product.name });
84
- });
85
- var topProducts = getTopProducts(productsResult);
86
- var productsResultSorted = orderBy_1.default(productsResult, ['product'], ['asc']);
87
- return {
88
- productsResult: productsResultSorted,
89
- topProducts: topProducts,
90
- otherProducts: difference_1.default(productsResultSorted, topProducts),
91
- };
92
- };
93
- exports.handleEntitledProductResponse = handleEntitledProductResponse;
94
74
  /**
95
75
  * Tries to get top products with priority given to recentlyFiledAgainst
96
76
  * before checking general top products from un-authed SE API
@@ -1 +1 @@
1
- {"version":3,"file":"insightRuleInfoUtils.d.ts","sourceRoot":"","sources":["../../src/insightRuleInfoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AASlE,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UAM3E;AAOD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,OAIzE"}
1
+ {"version":3,"file":"insightRuleInfoUtils.d.ts","sourceRoot":"","sources":["../../src/insightRuleInfoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AASlE,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,UAI3E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,OAIzE"}
@@ -8,14 +8,8 @@ doT.templateSettings = assign({}, doT.templateSettings, {
8
8
  export function getRuleReasonHtml(ruleReason, reportDetails) {
9
9
  const resultText = parseDotTemplate(ruleReason, reportDetails);
10
10
  const html = markdownToHTML(resultText);
11
- const anchorTagRegex = new RegExp(`<a`, 'g');
12
- const modifiedHtml = html.toString().replace(anchorTagRegex, '<a class="pf-c-button pf-m-link anchor-tag-button"');
13
- return modifiedHtml;
11
+ return html;
14
12
  }
15
- // TODO: Remove modifiedHtml once Accordion Bug is fixed and Replace with below code
16
- // const resultText = parseDotTemplate(ruleReason, reportDetails);
17
- // const html = markdownToHTML(resultText);
18
- // return html as string;
19
13
  export function parseDotTemplate(dotString, reportDetails) {
20
14
  const tempFn = doT.template(dotString);
21
15
  const parsedDotString = tempFn(reportDetails);
@@ -5,13 +5,6 @@ export interface ITroubleshootProductResponse {
5
5
  productsResult: Partial<ISEProduct>[];
6
6
  }
7
7
  export declare const handleProductSearchResponse: (productsResultAll: ISEProduct[], productsResultEntitled?: IProductV2[], topCount?: number) => ITroubleshootProductResponse;
8
- /**
9
- * This method is used for parsing `hydra/rest/products/contact/{userName}` response form API
10
- * and need to create partial response like method `handleProductSearchResponse`
11
- * @param productsResultEntitled IProductV2[]
12
- * @returns ITroubleshootProductResponse
13
- */
14
- export declare const handleEntitledProductResponse: (productsResultEntitled?: IProductV2[]) => ITroubleshootProductResponse;
15
8
  /**
16
9
  * Tries to get top products with priority given to recentlyFiledAgainst
17
10
  * before checking general top products from un-authed SE API
@@ -1 +1 @@
1
- {"version":3,"file":"productsUtils.d.ts","sourceRoot":"","sources":["../../src/productsUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAWhF,MAAM,WAAW,4BAA4B;IACzC,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IACnC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IACrC,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;CACzC;AAED,eAAO,MAAM,2BAA2B,sBACjB,UAAU,EAAE,2BACP,UAAU,EAAE,aAC1B,MAAM,KACjB,4BA4BF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,4BACd,UAAU,EAAE,KACrC,4BAcF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,QAAQ,SAAI,GAAG,OAAO,CAAC,UAAU,CAAC,EAAE,CAOnG;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,WAE/C;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAEzD;AAED,wBAA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K,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAkBlE"}
@@ -30,24 +30,6 @@ export const handleProductSearchResponse = (productsResultAll, productsResultEnt
30
30
  otherProducts: difference(productsResultSorted, topProducts),
31
31
  };
32
32
  };
33
- /**
34
- * This method is used for parsing `hydra/rest/products/contact/{userName}` response form API
35
- * and need to create partial response like method `handleProductSearchResponse`
36
- * @param productsResultEntitled IProductV2[]
37
- * @returns ITroubleshootProductResponse
38
- */
39
- export const handleEntitledProductResponse = (productsResultEntitled = []) => {
40
- const productsResult = productsResultEntitled.map((product) => {
41
- return Object.assign(Object.assign({}, product), { product: product.name });
42
- });
43
- const topProducts = getTopProducts(productsResult);
44
- const productsResultSorted = orderBy(productsResult, ['product'], ['asc']);
45
- return {
46
- productsResult: productsResultSorted,
47
- topProducts,
48
- otherProducts: difference(productsResultSorted, topProducts),
49
- };
50
- };
51
33
  /**
52
34
  * Tries to get top products with priority given to recentlyFiledAgainst
53
35
  * before checking general top products from un-authed SE API
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/utils",
3
- "version": "0.2.33",
3
+ "version": "0.2.34-alpha-0",
4
4
  "description": "> TODO: description",
5
5
  "author": "Vikas Rathee <vrathee@redhat.com>",
6
6
  "license": "ISC",
@@ -87,5 +87,5 @@
87
87
  "@types/react-dom": "^17.0.9",
88
88
  "moment-timezone": "^0.5.32"
89
89
  },
90
- "gitHead": "5797cf1fd9b2d2406fa93933f91fcc0b0729e7a8"
90
+ "gitHead": "c493eace4748f428da4c41f386381e609dd39651"
91
91
  }