@rh-support/manage 0.2.65 → 0.2.68

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":"TopContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,OAAO,EAIH,oBAAoB,EAOvB,MAAM,wCAAwC,CAAC;AAIhD,UAAU,MAAM;IACZ,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,CAAC,EAAE,MAAM,CAAC;CACb;AAaD,eAAO,MAAM,oBAAoB,kDAAmD,MAAM,gBA6XzF,CAAC"}
1
+ {"version":3,"file":"TopContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,OAAO,EAIH,oBAAoB,EAOvB,MAAM,wCAAwC,CAAC;AAIhD,UAAU,MAAM;IACZ,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,CAAC,EAAE,MAAM,CAAC;CACb;AAaD,eAAO,MAAM,oBAAoB,kDAAmD,MAAM,gBAoYzF,CAAC"}
@@ -8,12 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { search } from '@cee-eng/hydrajs';
11
- import { Button, TextInput, ValidatedOptions } from '@patternfly/react-core';
11
+ import { Button, ValidatedOptions } from '@patternfly/react-core';
12
12
  import EditAltIcon from '@patternfly/react-icons/dist/js/icons/edit-alt-icon';
13
13
  import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
14
14
  import GripVerticalIcon from '@patternfly/react-icons/dist/js/icons/grip-vertical-icon';
15
- import { ToastNotification } from '@rh-support/components';
15
+ import { CustomTextInput, ToastNotification } from '@rh-support/components';
16
16
  import { formatDate, getDrupalResIdIfTypeFromUrl, getText } from '@rh-support/utils';
17
+ import { isEmpty } from 'lodash';
17
18
  import cloneDeep from 'lodash/cloneDeep';
18
19
  import React, { useEffect, useState } from 'react';
19
20
  import { Trans, useTranslation } from 'react-i18next';
@@ -238,7 +239,11 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
238
239
  if (isArrangingContent)
239
240
  setIsPreview(true);
240
241
  }, [isArrangingContent]);
241
- const isSaveButtonDisabled = !(contentTitleIsValid && contentUrlIsValid && localContentTitle && localContentUrl) ||
242
+ // To check if input has spaces
243
+ const doesInputHasSpaces = isEmpty(localContentTitle.trim());
244
+ // To disable save button if empty depending on spaces
245
+ const isSaveButtonDisabled = doesInputHasSpaces ||
246
+ !(contentTitleIsValid && contentUrlIsValid && localContentTitle && localContentUrl) ||
242
247
  (!newCategory && content.mode === ContentMode.NEW_SECTION_CONTENT) ||
243
248
  (localContentUrl === content.contentUrl && localContentTitle === content.contentTitle);
244
249
  const lastModifiedBy = t(`Last modified {{created}} by {{by}}`, {
@@ -261,13 +266,13 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
261
266
  ' ',
262
267
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
263
268
  React.createElement("div", { className: "input-wrapper" },
264
- React.createElement(TextInput, { isRequired: true, className: `form-control${!contentTitleIsValid ? ' form-invalid' : ''}`, type: "text", maxLength: 254, required: true, value: localContentTitle, isDisabled: isFetchingSolrSearch, "aria-label": t('Copy and paste the heading for consistency'), placeholder: t('Copy and paste the heading for consistency'), onChange: onContentTitleChange, validated: contentTitleIsValid ? ValidatedOptions.default : ValidatedOptions.error }))),
269
+ React.createElement(CustomTextInput, { isRequired: true, isSpaceAllowed: false, className: `form-control${!contentTitleIsValid ? ' form-invalid' : ''}`, type: "text", maxLength: 254, required: true, value: localContentTitle, isDisabled: isFetchingSolrSearch, "aria-label": t('Copy and paste the heading for consistency'), placeholder: t('Copy and paste the heading for consistency'), onChange: onContentTitleChange, validated: contentTitleIsValid ? ValidatedOptions.default : ValidatedOptions.error }))),
265
270
  React.createElement("div", { className: "form-group" },
266
271
  React.createElement("label", { htmlFor: localContentUrl },
267
272
  "Link to content",
268
273
  ' ',
269
274
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
270
- React.createElement(TextInput, { type: "url", maxLength: 254, isRequired: true, className: `form-control${!contentUrlIsValid ? ' form-invalid' : ''}`, value: getTopContentUrl(localContentUrl), "aria-label": t('Entering a solution or article link first will automatically generate the heading for you'), placeholder: t('Entering a solution or article link first will automatically generate the heading for you'), onChange: onContentUrlChange, validated: contentUrlIsValid ? ValidatedOptions.default : ValidatedOptions.error }),
275
+ React.createElement(CustomTextInput, { type: "url", maxLength: 254, isRequired: true, isSpaceAllowed: false, className: `form-control${!contentUrlIsValid ? ' form-invalid' : ''}`, value: getTopContentUrl(localContentUrl), "aria-label": t('Entering a solution or article link first will automatically generate the heading for you'), placeholder: t('Entering a solution or article link first will automatically generate the heading for you'), onChange: onContentUrlChange, validated: contentUrlIsValid ? ValidatedOptions.default : ValidatedOptions.error }),
271
276
  showDuplicateError && (React.createElement("p", { className: "form-instructions" },
272
277
  React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-u-mr-sm" }),
273
278
  " Duplicate url. This url is already added in ",
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/TopContentEditor/TopContentEditor.tsx"],"names":[],"mappings":"AA2CA,wBAAgB,gBAAgB,gBAoT/B"}
1
+ {"version":3,"file":"TopContentEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/TopContentEditor/TopContentEditor.tsx"],"names":[],"mappings":"AA2CA,wBAAgB,gBAAgB,gBAsT/B"}
@@ -149,5 +149,5 @@ export function TopContentEditor() {
149
149
  ' ',
150
150
  React.createElement(Button, { variant: "link", onClick: onCancelArrangement },
151
151
  React.createElement(Trans, null, "Cancel")))))))))),
152
- React.createElement(MajorVersionPerformanceMetrics, { isModalOpen: isModalOpen, onHideModal: onHideModal, filteredTC: filteredTC, selectedMajorVersion: selectedVersion, selectedProduct: selectedProduct.name }))));
152
+ isMajorVersion(selectedVersion) && (React.createElement(MajorVersionPerformanceMetrics, { isModalOpen: isModalOpen, onHideModal: onHideModal, filteredTC: filteredTC, selectedMajorVersion: selectedVersion, selectedProduct: selectedProduct.name })))));
153
153
  }
@@ -23,7 +23,7 @@ function getProcessedVersions(arr) {
23
23
  let i = 0;
24
24
  while (i < arr.length) {
25
25
  const major = getVersion(arr[i]).major;
26
- if (Number(major) && !majorsArray.includes(major)) {
26
+ if (Number(major) && !majorsArray.includes(major) && !arr.includes(major + '.x')) {
27
27
  majorsArray.push(major);
28
28
  arr.splice(i, 0, major + '.x');
29
29
  i = i + 2;
@@ -1 +1 @@
1
- {"version":3,"file":"useVersionsDiffer.d.ts","sourceRoot":"","sources":["../../../src/hooks/useVersionsDiffer.tsx"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,wBAAyB,MAAM,wBAAwB,MAAM,KAAG,CAAC,OAAO,EAAE,MAAM,EAAE,CA6C/G,CAAC"}
1
+ {"version":3,"file":"useVersionsDiffer.d.ts","sourceRoot":"","sources":["../../../src/hooks/useVersionsDiffer.tsx"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,wBAAyB,MAAM,wBAAwB,MAAM,KAAG,CAAC,OAAO,EAAE,MAAM,EAAE,CAsD/G,CAAC"}
@@ -32,11 +32,19 @@ export const useVersionsDiffer = (selectedProductName, selectedMajorVersion) =>
32
32
  }, [selectedProductName, selectedMajorVersion]);
33
33
  // In this effect we are calculating and finding difference between original version list and version with top content
34
34
  useEffect(() => {
35
- var _a, _b;
35
+ var _a, _b, _c;
36
+ // If versions list is empty, then set `majorVersion.x`
36
37
  if (((_a = versions === null || versions === void 0 ? void 0 : versions.items) === null || _a === void 0 ? void 0 : _a.length) && (topContentVersion === null || topContentVersion === void 0 ? void 0 : topContentVersion.length)) {
37
38
  const subVersions = (_b = versions === null || versions === void 0 ? void 0 : versions.items) === null || _b === void 0 ? void 0 : _b.filter((item) => item.startsWith(selectedMajorVersion)).map((item) => { var _a; return (_a = item.split('.')) === null || _a === void 0 ? void 0 : _a.splice(1).join('.'); }).sort();
38
39
  setMajorVersion(difference(subVersions, topContentVersion));
39
40
  }
41
+ else if ((_c = versions === null || versions === void 0 ? void 0 : versions.items) === null || _c === void 0 ? void 0 : _c.length) {
42
+ const subVersions = versions === null || versions === void 0 ? void 0 : versions.items.filter((item) => item.startsWith(selectedMajorVersion)).map((item) => { var _a; return (_a = item.split('.')) === null || _a === void 0 ? void 0 : _a.splice(1).join('.'); }).sort();
43
+ setMajorVersion(subVersions);
44
+ }
45
+ else {
46
+ setMajorVersion(['x']);
47
+ }
40
48
  }, [versions, topContentVersion, selectedMajorVersion]);
41
49
  return [isLoadingVersions || isTopContentVersion, majorVersion.map((item) => `${selectedMajorVersion}.${item}`)];
42
50
  };
@@ -53,7 +53,7 @@ div#top-content-major-version-performance-metric.pf-c-modal-box {
53
53
  position: sticky;
54
54
  top: 0;
55
55
  background: var(--pf-c-modal-box--BackgroundColor);
56
- z-index: 1;
56
+ z-index: 101; // As .pf-c-toggle-group__button is having z-index: var(--pf-c-toggle-group__button--ZIndex) (100) need to set z-index 101;
57
57
  padding-bottom: var(--pf-global--spacer--sm);
58
58
  }
59
59
  .content {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/manage",
3
- "version": "0.2.65",
3
+ "version": "0.2.68",
4
4
  "description": "Customer Support Manage App",
5
5
  "author": "Jordan Eudy <jeudy100@gmail.com>",
6
6
  "homepage": "",
@@ -52,12 +52,12 @@
52
52
  ],
53
53
  "peerDependencies": {
54
54
  "@cee-eng/hydrajs": "4.7.22",
55
- "@patternfly/patternfly": "4.176.2",
55
+ "@patternfly/patternfly": "4.185.1",
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
- "@patternfly/react-core": "4.194.0",
60
- "@patternfly/react-table": "4.63.0",
59
+ "@patternfly/react-core": "4.202.16",
60
+ "@patternfly/react-table": "4.71.16",
61
61
  "@rh-support/api": "0.3.9",
62
62
  "@rh-support/components": "^0.1.3",
63
63
  "@rh-support/react-context": "^0.1.3",
@@ -90,16 +90,16 @@
90
90
  },
91
91
  "dependencies": {
92
92
  "@cee-eng/hydrajs": "4.7.22",
93
- "@patternfly/patternfly": "4.176.2",
93
+ "@patternfly/patternfly": "4.185.1",
94
94
  "@patternfly/pfe-accordion": "1.12.3",
95
95
  "@patternfly/pfe-collapse": "1.12.3",
96
96
  "@patternfly/pfe-tabs": "1.12.3",
97
- "@patternfly/react-core": "4.194.0",
98
- "@patternfly/react-table": "4.63.0",
97
+ "@patternfly/react-core": "4.202.16",
98
+ "@patternfly/react-table": "4.71.16",
99
99
  "@rh-support/api": "0.3.13",
100
- "@rh-support/components": "1.1.54",
100
+ "@rh-support/components": "1.1.56",
101
101
  "@rh-support/configs": "0.2.5",
102
- "@rh-support/react-context": "0.2.54",
102
+ "@rh-support/react-context": "0.2.56",
103
103
  "@rh-support/types": "0.2.0",
104
104
  "@rh-support/user-permissions": "0.2.44",
105
105
  "@rh-support/utils": "0.2.33",
@@ -113,5 +113,5 @@
113
113
  "react-i18next": ">=10.11.0",
114
114
  "react-router-dom": ">=5.1.2"
115
115
  },
116
- "gitHead": "5797cf1fd9b2d2406fa93933f91fcc0b0729e7a8"
116
+ "gitHead": "981468e419f36c15d6039eaa49b52e6a180752a3"
117
117
  }