@rh-support/manage 2.0.3 → 2.0.5

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.
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { Card, CardBody, CardHeader, SelectOption } from '@patternfly/react-core';
11
11
  import { ToastNotification } from '@rh-support/components';
12
12
  import { UserPreferencesKeys } from '@rh-support/react-context';
13
- import { isEmpty } from 'lodash';
14
13
  import find from 'lodash/find';
14
+ import isEmpty from 'lodash/isEmpty';
15
15
  import React, { useEffect, useState } from 'react';
16
16
  import { Trans, useTranslation } from 'react-i18next';
17
17
  import { useUserPreferences } from '../../../hooks/useUserPreferences';
@@ -13,8 +13,8 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-ic
13
13
  import { EditorMode, ToastNotification, useFetch } from '@rh-support/components';
14
14
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
15
15
  import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
16
- import { isEmpty } from 'lodash';
17
16
  import debounce from 'lodash/debounce';
17
+ import isEmpty from 'lodash/isEmpty';
18
18
  import React, { useContext, useEffect, useState } from 'react';
19
19
  import { Trans, useTranslation } from 'react-i18next';
20
20
  import { useUserPreferences } from '../../../hooks/useUserPreferences';
@@ -7,6 +7,7 @@ interface IProps {
7
7
  options: Array<any>;
8
8
  optionValue: (option: any) => string;
9
9
  isLoading?: boolean;
10
+ isDisabled?: boolean;
10
11
  }
11
12
  export declare const PerformanceMetricsSelect: FC<IProps>;
12
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"PerformanceMetricsSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,kBAAkB,EAAiB,MAAM,wBAAwB,CAAC;AACjG,OAAO,KAAK,EAAE,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAG5C,UAAU,MAAM;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,CACd,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,WAAW,EAC3C,KAAK,EAAE,MAAM,GAAG,kBAAkB,EAClC,aAAa,CAAC,EAAE,OAAO,KACtB,IAAI,CAAC;IACV,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACpB,WAAW,EAAE,CAAC,MAAM,KAAA,KAAK,MAAM,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,MAAM,CAsC/C,CAAC"}
1
+ {"version":3,"file":"PerformanceMetricsSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,kBAAkB,EAAiB,MAAM,wBAAwB,CAAC;AACjG,OAAO,KAAK,EAAE,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAG5C,UAAU,MAAM;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,CACd,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,WAAW,EAC3C,KAAK,EAAE,MAAM,GAAG,kBAAkB,EAClC,aAAa,CAAC,EAAE,OAAO,KACtB,IAAI,CAAC;IACV,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACpB,WAAW,EAAE,CAAC,MAAM,KAAA,KAAK,MAAM,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,MAAM,CAuC/C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
2
2
  import React, { useState } from 'react';
3
3
  import { Trans } from 'react-i18next';
4
- export const PerformanceMetricsSelect = ({ placeholderText, title, onSelectCallback, options, optionValue, isLoading = false, }) => {
4
+ export const PerformanceMetricsSelect = ({ placeholderText, title, onSelectCallback, options, optionValue, isLoading = false, isDisabled, }) => {
5
5
  const [isOpen, setOpen] = useState(false);
6
6
  const [selected, setSelected] = useState(null);
7
7
  const onToggle = (isOpen) => setOpen(isOpen);
@@ -16,5 +16,5 @@ export const PerformanceMetricsSelect = ({ placeholderText, title, onSelectCallb
16
16
  " ",
17
17
  title,
18
18
  " ")),
19
- React.createElement(Select, { variant: SelectVariant.single, placeholderText: placeholderText, "aria-label": "Select Input with descriptions", onToggle: onToggle, onSelect: onSelect, selections: selected, isOpen: isOpen, isDisabled: isLoading }, options.map((option, index) => (React.createElement(SelectOption, { key: index, value: optionValue(option) }))))));
19
+ React.createElement(Select, { variant: SelectVariant.single, placeholderText: placeholderText, "aria-label": "Select Input with descriptions", onToggle: onToggle, onSelect: onSelect, selections: selected, isOpen: isOpen, isDisabled: isDisabled || isLoading }, options.map((option, index) => (React.createElement(SelectOption, { key: index, value: optionValue(option) }))))));
20
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"VersionPerformanceMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.tsx"],"names":[],"mappings":"AAaA,OAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAUhE,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;CAC3B;AACD,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,MAAM,CAmGhD,CAAC"}
1
+ {"version":3,"file":"VersionPerformanceMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.tsx"],"names":[],"mappings":"AAcA,OAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAUhE,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;CAC3B;AACD,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,MAAM,CAsGhD,CAAC"}
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { pcm } from '@cee-eng/hydrajs';
11
11
  import { Button, ButtonVariant, Flex, FlexItem, Modal, ModalVariant, Title, TitleSizes, } from '@patternfly/react-core';
12
12
  import { useFetch } from '@rh-support/components';
13
+ import isEmpty from 'lodash/isEmpty';
13
14
  import React, { useEffect, useMemo, useState } from 'react';
14
15
  import { Trans, useTranslation } from 'react-i18next';
15
16
  import { useTopContentContext } from '../../../context/TopContentProvider';
@@ -47,6 +48,7 @@ export const VersionPerformanceMetrics = ({ isModalOpen, onHideModal, selectedVe
47
48
  setSelectedCategory('');
48
49
  onHideModal();
49
50
  };
51
+ const versionOptions = isMajorProjectVersion ? versionDifference : [selectedVersionProp];
50
52
  return (React.createElement(Modal, { variant: ModalVariant.large, id: "top-content-major-version-performance-metric", "aria-label": "top-content-performance-metric", isOpen: isModalOpen, onClose: onModalClose, actions: [
51
53
  React.createElement(Button, { variant: ButtonVariant.secondary, key: "close-button", onClick: onModalClose },
52
54
  React.createElement(Trans, null, "Cancel")),
@@ -59,7 +61,7 @@ export const VersionPerformanceMetrics = ({ isModalOpen, onHideModal, selectedVe
59
61
  React.createElement("br", null),
60
62
  React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
61
63
  React.createElement(FlexItem, { className: "pf-u-w-50 pf-u-pr-md", style: { marginRight: 'unset' } },
62
- React.createElement(PerformanceMetricsSelect, { placeholderText: t('select a version'), title: t(`Version using ${selectedVersionProp}`), onSelectCallback: onVersionSelect, options: isMajorProjectVersion ? versionDifference : [selectedVersionProp], optionValue: (option) => option, isLoading: isLoading })),
64
+ React.createElement(PerformanceMetricsSelect, { placeholderText: t(!isEmpty(versionOptions) ? 'Select a version' : 'No versions available'), title: t(`Version using ${selectedVersionProp}`), onSelectCallback: onVersionSelect, options: versionOptions, optionValue: (option) => option, isLoading: isLoading, isDisabled: isEmpty(versionOptions) })),
63
65
  React.createElement(FlexItem, { className: "pf-u-w-50 pf-u-pl-md" },
64
66
  React.createElement(PerformanceMetricsSelect, { placeholderText: t('select a category'), title: t('Categories'), options: flagContentEditState, optionValue: (option) => option.categoryName, onSelectCallback: (e, selectedOption) => setSelectedCategory(selectedOption), isLoading: !selectedVersion || isTopContentLoading })))),
65
67
  React.createElement("br", null),
@@ -14,8 +14,8 @@ import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclama
14
14
  import GripVerticalIcon from '@patternfly/react-icons/dist/js/icons/grip-vertical-icon';
15
15
  import { CustomTextInput, ToastNotification } from '@rh-support/components';
16
16
  import { formatDate, getDrupalResIdIfTypeFromUrl, getText } from '@rh-support/utils';
17
- import { isEmpty } from 'lodash';
18
17
  import cloneDeep from 'lodash/cloneDeep';
18
+ import isEmpty from 'lodash/isEmpty';
19
19
  import React, { useEffect, useState } from 'react';
20
20
  import { Trans, useTranslation } from 'react-i18next';
21
21
  import { useTopContentContext, useTopContentDispatchContext } from '../../../../context/TopContentProvider';
@@ -1,5 +1,5 @@
1
1
  import { ExpandableSection, Panel, PanelMain, PanelMainBody, Title } from '@patternfly/react-core';
2
- import { isEmpty } from 'lodash';
2
+ import isEmpty from 'lodash/isEmpty';
3
3
  import React, { useEffect, useState } from 'react';
4
4
  import { Trans } from 'react-i18next';
5
5
  import { useTopContentContext, useTopContentDispatchContext } from '../../../../context/TopContentProvider';
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentSuggestionHintAccept.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAkBrH,OAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAgBhE,UAAU,MAAM;IACZ,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,SAAS,EAAE,mBAAmB,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B,EAAE,EAAE,CAAC,MAAM,CAkPrD,CAAC"}
1
+ {"version":3,"file":"TopContentSuggestionHintAccept.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAoBrH,OAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAgBhE,UAAU,MAAM;IACZ,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,SAAS,EAAE,mBAAmB,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B,EAAE,EAAE,CAAC,MAAM,CAoPrD,CAAC"}
@@ -11,7 +11,9 @@ import { Button, Card, CardBody, Form, FormGroup, Select, SelectOption, SelectVa
11
11
  import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
12
12
  import { ToastNotification } from '@rh-support/components';
13
13
  import { getVersion, isRegularVersion, isValidUrl } from '@rh-support/utils';
14
- import { isEmpty, isUndefined, trim } from 'lodash';
14
+ import isEmpty from 'lodash/isEmpty';
15
+ import isUndefined from 'lodash/isUndefined';
16
+ import trim from 'lodash/trim';
15
17
  import React, { useEffect, useMemo, useState } from 'react';
16
18
  import { Trans, useTranslation } from 'react-i18next';
17
19
  import { CATEGORY_LIMIT } from '../../../../constants/TopContent';
@@ -120,11 +122,11 @@ export const TopContentSuggestionHintAccept = ({ onCancel, resources }) => {
120
122
  React.createElement(Form, null,
121
123
  isEditClicked ? (React.createElement(React.Fragment, null,
122
124
  React.createElement(FormGroup, { label: t('Link to content'), isRequired: true, fieldId: "top-content-link" },
123
- React.createElement(TextInput, { isRequired: true, type: "text", id: "top-content-resource-link", name: "top-content-resource-link", "data-tracking-id": "top-content-resource-link", value: linkToContent, onChange: setLinkToContent, validated: isEmpty(linkToContent) || !isValidUrl(linkToContent)
125
+ React.createElement(TextInput, { isRequired: true, type: "text", id: "top-content-resource-link", name: "top-content-resource-link", "data-tracking-id": "top-content-resource-link", value: linkToContent, onChange: setLinkToContent, placeholder: t('Enter link to content'), validated: isEmpty(linkToContent) || !isValidUrl(linkToContent)
124
126
  ? ValidatedOptions.error
125
127
  : ValidatedOptions.default })),
126
128
  React.createElement(FormGroup, { label: t('Headline'), isRequired: true, fieldId: "simple-form-email-01" },
127
- React.createElement(TextInput, { isRequired: true, type: "text", id: "top-content-headline-category", name: "top-content-headline-category", "data-tracking-id": "top-content-headline-category", value: resourceTitle, onChange: setResourceTitle, validated: isEmpty(trim(resourceTitle)) ? ValidatedOptions.error : ValidatedOptions.default })))) : (React.createElement("span", null,
129
+ React.createElement(TextInput, { isRequired: true, type: "text", id: "top-content-headline-category", name: "top-content-headline-category", "data-tracking-id": "top-content-headline-category", value: resourceTitle, onChange: setResourceTitle, placeholder: t('Copy and paste the heading for consistency'), validated: isEmpty(trim(resourceTitle)) ? ValidatedOptions.error : ValidatedOptions.default })))) : (React.createElement("span", null,
128
130
  React.createElement(Button, { variant: "link", isInline: true },
129
131
  React.createElement("u", null,
130
132
  React.createElement("a", { className: "hint-title pf-u-font-size-md", target: "_blank", href: linkToContent, rel: "noreferrer" }, resources.resourceTitle))),
@@ -1,6 +1,6 @@
1
1
  import { pcm, products as productsApi } from '@cee-eng/hydrajs';
2
2
  import { useFetch } from '@rh-support/components';
3
- import { intersection } from 'lodash';
3
+ import intersection from 'lodash/intersection';
4
4
  import { useEffect, useState } from 'react';
5
5
  import { postVersionsProcessor } from '../components/TopContentManagement/TopContentProductVersionSelector';
6
6
  /**
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { pcm } from '@cee-eng/hydrajs';
11
11
  import { getApiResourceObject, getVersion } from '@rh-support/utils';
12
- import { cloneDeep } from 'lodash';
12
+ import cloneDeep from 'lodash/cloneDeep';
13
13
  import { intialTopContentContext } from '../context/TopContentProvider';
14
14
  import { getContentUrls } from './TopContentHelpers';
15
15
  export var ContentMode;
@@ -309,9 +309,9 @@ svg.hostnameSpinner {
309
309
  }
310
310
 
311
311
  #version-dropdown-selector {
312
- z-index: 9999;
312
+ z-index: 299;
313
313
  }
314
314
 
315
315
  #tc-product-dropdown-selector {
316
- z-index: 9999;
316
+ z-index: 299;
317
317
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/manage",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "Customer Support Manage App",
5
5
  "author": "Jordan Eudy <jeudy100@gmail.com>",
6
6
  "homepage": "",
@@ -38,7 +38,7 @@
38
38
  "test:watch": "./../../node_modules/.bin/jest --watchAll -c ./../../configs/tests/jest.config.unit.js",
39
39
  "test:unit": "./../../node_modules/.bin/jest -c ./../../configs/tests/jest.config.unit.js",
40
40
  "test:snap": "./../../node_modules/.bin/jest -c ./../../configs/tests/jest.config.snapshot.js",
41
- "test:coverage": "./../../node_modules/.bin/jest -c ./../../configs/tests/jest.config.coverage.js",
41
+ "test:coverage": "./../../node_modules/.bin/jest --all -c ./../../configs/tests/jest.config.coverage.js",
42
42
  "test:changes": "./../../node_modules/.bin/jest --passWithNoTests -c ./../../configs/tests/jest-only-changed-from-upstream.js",
43
43
  "test": "npm run test:changes",
44
44
  "watch:css": "./../../node_modules/.bin/chokidar 'src/**/*.(css|scss)' -c '../../node_modules/.bin/copyfiles -V -u 1 -a {path} lib/esm'",
@@ -51,18 +51,13 @@
51
51
  "not op_mini all"
52
52
  ],
53
53
  "peerDependencies": {
54
- "@cee-eng/hydrajs": "4.15.71",
54
+ "@cee-eng/hydrajs": "4.15.78",
55
55
  "@patternfly/patternfly": "4.196.7",
56
56
  "@patternfly/pfe-accordion": "1.12.3",
57
57
  "@patternfly/pfe-collapse": "1.12.3",
58
58
  "@patternfly/pfe-tabs": "1.12.3",
59
59
  "@patternfly/react-core": "4.264.0",
60
60
  "@patternfly/react-table": "4.111.33",
61
- "@rh-support/components": "^0.1.3",
62
- "@rh-support/react-context": "^0.1.3",
63
- "@rh-support/types": "^0.1.3",
64
- "@rh-support/user-permissions": "^0.1.3",
65
- "@rh-support/utils": "^0.1.3",
66
61
  "i18next": ">=17.0.1",
67
62
  "lodash": ">=4.17.15",
68
63
  "react": "17.0.2",
@@ -87,19 +82,19 @@
87
82
  "typescript": "4.3.5"
88
83
  },
89
84
  "dependencies": {
90
- "@cee-eng/hydrajs": "4.15.71",
85
+ "@cee-eng/hydrajs": "4.15.78",
91
86
  "@patternfly/patternfly": "4.196.7",
92
87
  "@patternfly/pfe-accordion": "1.12.3",
93
88
  "@patternfly/pfe-collapse": "1.12.3",
94
89
  "@patternfly/pfe-tabs": "1.12.3",
95
90
  "@patternfly/react-core": "4.264.0",
96
91
  "@patternfly/react-table": "4.111.33",
97
- "@rh-support/components": "2.0.3",
98
- "@rh-support/configs": "2.0.1",
99
- "@rh-support/react-context": "2.0.3",
92
+ "@rh-support/components": "2.0.5",
93
+ "@rh-support/configs": "2.0.2",
94
+ "@rh-support/react-context": "2.0.5",
100
95
  "@rh-support/types": "2.0.1",
101
- "@rh-support/user-permissions": "2.0.3",
102
- "@rh-support/utils": "2.0.3",
96
+ "@rh-support/user-permissions": "2.0.5",
97
+ "@rh-support/utils": "2.0.5",
103
98
  "@types/react-beautiful-dnd": "^13.0.0",
104
99
  "i18next": ">=17.0.1",
105
100
  "lodash": ">=4.17.15",
@@ -109,5 +104,5 @@
109
104
  "react-i18next": ">=10.11.0",
110
105
  "react-router-dom": ">=5.1.2"
111
106
  },
112
- "gitHead": "f8fe7a663c31e0247c25916cdb54c7da7440abb2"
107
+ "gitHead": "f4106bdae110f32d4968b2a9544fc4bbf76ce11e"
113
108
  }