@rh-support/manage 0.2.66 → 0.2.67

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 ",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/manage",
3
- "version": "0.2.66",
3
+ "version": "0.2.67",
4
4
  "description": "Customer Support Manage App",
5
5
  "author": "Jordan Eudy <jeudy100@gmail.com>",
6
6
  "homepage": "",
@@ -97,9 +97,9 @@
97
97
  "@patternfly/react-core": "4.194.0",
98
98
  "@patternfly/react-table": "4.63.0",
99
99
  "@rh-support/api": "0.3.13",
100
- "@rh-support/components": "1.1.54",
100
+ "@rh-support/components": "1.1.55",
101
101
  "@rh-support/configs": "0.2.5",
102
- "@rh-support/react-context": "0.2.54",
102
+ "@rh-support/react-context": "0.2.55",
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": "3e5e6c715aa2ef2fd0e53ea1d521c610f7ad9781"
116
+ "gitHead": "a3df00d1fcf2e999400a0b17f5ac00f2a32d878d"
117
117
  }