@rh-support/utils 2.5.43 → 2.5.44
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.
package/lib/esm/caseUtils.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IPortalJwtToken } from '@rh-support/types/shared';
|
|
2
1
|
export declare enum PreviousCaseTypes {
|
|
3
2
|
DEFECT_BUG = "Defect / Bug",
|
|
4
3
|
CERTIFICATION = "Certification",
|
|
@@ -20,7 +19,6 @@ export declare enum NewCaseTypes {
|
|
|
20
19
|
OTHER = "Other"
|
|
21
20
|
}
|
|
22
21
|
export declare const PreviousToNewCaseTypeMap: Record<PreviousCaseTypes, NewCaseTypes>;
|
|
23
|
-
export declare function canManageCase(loggedInUserJwtToken: Partial<IPortalJwtToken>): boolean;
|
|
24
22
|
export declare function humanizeSize(fileSize: number): string;
|
|
25
23
|
export declare function showFtsOnCreateCasePage(slaProcessId: string, severity: string): boolean;
|
|
26
24
|
export declare function showFtsOnCaseViewEditPage(slaProcessId: string, severity: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caseUtils.d.ts","sourceRoot":"","sources":["../../src/caseUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"caseUtils.d.ts","sourceRoot":"","sources":["../../src/caseUtils.ts"],"names":[],"mappings":"AAIA,oBAAY,iBAAiB;IACzB,UAAU,iBAAiB;IAC3B,aAAa,kBAAkB;IAC/B,mBAAmB,wBAAwB;IAC3C,+BAA+B,uCAAuC;IACtE,wBAAwB,+BAA+B;IACvD,mBAAmB,kCAAkC;IACrD,QAAQ,aAAa;IACrB,KAAK,UAAU;CAClB;AAGD,oBAAY,YAAY;IACpB,UAAU,kBAAkB;IAC5B,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,gBAAgB,qBAAqB;IACrC,eAAe,sBAAsB;IACrC,IAAI,SAAS;IACb,mBAAmB,wBAAwB;IAC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,QAAQ,EAAE,GAAG,OAqBlD"}
|
package/lib/esm/caseUtils.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import find from 'lodash/find';
|
|
2
|
-
import includes from 'lodash/includes';
|
|
3
2
|
import isEmpty from 'lodash/isEmpty';
|
|
4
3
|
// Old Case Types
|
|
5
4
|
export var PreviousCaseTypes;
|
|
@@ -35,12 +34,6 @@ export const PreviousToNewCaseTypeMap = {
|
|
|
35
34
|
[PreviousCaseTypes.RCA_ONLY]: NewCaseTypes.ROOT_CAUSE_ANALYSIS,
|
|
36
35
|
[PreviousCaseTypes.OTHER]: NewCaseTypes.OTHER,
|
|
37
36
|
};
|
|
38
|
-
export function canManageCase(loggedInUserJwtToken) {
|
|
39
|
-
if (!loggedInUserJwtToken || !loggedInUserJwtToken.realm_access) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
return includes(loggedInUserJwtToken.realm_access.roles, 'portal_manage_cases');
|
|
43
|
-
}
|
|
44
37
|
export function humanizeSize(fileSize) {
|
|
45
38
|
let i = -1;
|
|
46
39
|
let size = fileSize;
|
package/lib/esm/scrollUtils.js
CHANGED
|
@@ -22,7 +22,7 @@ export function scrollIntoView(sectionRef, options) {
|
|
|
22
22
|
const hasOffset = !!(options === null || options === void 0 ? void 0 : options.offset);
|
|
23
23
|
if (hasNavbar || hasOffset) {
|
|
24
24
|
const sectionRect = sectionRef.current.getBoundingClientRect();
|
|
25
|
-
let elementTopPosition = sectionRect.top;
|
|
25
|
+
let elementTopPosition = sectionRect.top + window.pageYOffset;
|
|
26
26
|
let top = elementTopPosition - ((_b = options === null || options === void 0 ? void 0 : options.offset) !== null && _b !== void 0 ? _b : 0);
|
|
27
27
|
if (hasNavbar) {
|
|
28
28
|
const navRect = options.navBarRef.current.getBoundingClientRect();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/utils",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.44",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"defaults and supports es6-module",
|
|
75
75
|
"maintained node versions"
|
|
76
76
|
],
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "29bfcc59d48ef890c622d6178951ea526ce0be96"
|
|
78
78
|
}
|