@rh-support/manage 2.6.1 → 2.6.10

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.
Files changed (157) hide show
  1. package/lib/esm/ManageTabs.d.ts.map +1 -1
  2. package/lib/esm/ManageTabs.js +48 -20
  3. package/lib/esm/Routes.d.ts +1 -0
  4. package/lib/esm/Routes.d.ts.map +1 -1
  5. package/lib/esm/Routes.js +6 -0
  6. package/lib/esm/components/Configs/ConfigsTable.d.ts.map +1 -1
  7. package/lib/esm/components/Configs/ConfigsTable.js +33 -9
  8. package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts +12 -0
  9. package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts.map +1 -0
  10. package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.js +80 -0
  11. package/lib/esm/components/Groups/AddMembersModal/index.d.ts +2 -0
  12. package/lib/esm/components/Groups/AddMembersModal/index.d.ts.map +1 -0
  13. package/lib/esm/components/Groups/AddMembersModal/index.js +1 -0
  14. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts +5 -3
  15. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts.map +1 -1
  16. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.js +21 -14
  17. package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts +1 -0
  18. package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts.map +1 -1
  19. package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +240 -105
  20. package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.d.ts.map +1 -1
  21. package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.js +19 -14
  22. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
  23. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +187 -77
  24. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.d.ts.map +1 -1
  25. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.js +15 -12
  26. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.d.ts.map +1 -1
  27. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.js +106 -67
  28. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkGroupSelector.d.ts.map +1 -1
  29. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.d.ts.map +1 -1
  30. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js +15 -22
  31. package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts +19 -0
  32. package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts.map +1 -0
  33. package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.js +97 -0
  34. package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts +3 -0
  35. package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts.map +1 -0
  36. package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.js +220 -0
  37. package/lib/esm/components/ManageCaseLabels/index.d.ts +2 -0
  38. package/lib/esm/components/ManageCaseLabels/index.d.ts.map +1 -0
  39. package/lib/esm/components/ManageCaseLabels/index.js +1 -0
  40. package/lib/esm/components/ManageCaseLabels/types.d.ts +6 -0
  41. package/lib/esm/components/ManageCaseLabels/types.d.ts.map +1 -0
  42. package/lib/esm/components/ManageCaseLabels/types.js +1 -0
  43. package/lib/esm/components/ManageExpiredContents/ExpiredContentCategory.js +4 -4
  44. package/lib/esm/components/ManageExpiredContents/ExpiredContentHeader.js +1 -1
  45. package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.d.ts.map +1 -1
  46. package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.js +12 -12
  47. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItem.js +3 -3
  48. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.d.ts.map +1 -1
  49. package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.js +43 -35
  50. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.d.ts.map +1 -1
  51. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.js +8 -5
  52. package/lib/esm/components/ManagePartnerships/PartnershipsList.d.ts.map +1 -1
  53. package/lib/esm/components/ManagePartnerships/PartnershipsList.js +19 -12
  54. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.d.ts.map +1 -1
  55. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.js +17 -20
  56. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.d.ts.map +1 -1
  57. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.js +39 -27
  58. package/lib/esm/components/ManagePartnerships/Requests.d.ts +1 -0
  59. package/lib/esm/components/ManagePartnerships/Requests.d.ts.map +1 -1
  60. package/lib/esm/components/ManagePartnerships/Requests.js +22 -9
  61. package/lib/esm/components/ManagePartnerships/index.js +1 -1
  62. package/lib/esm/components/ManagePreferences/PreferencesBody.d.ts.map +1 -1
  63. package/lib/esm/components/ManagePreferences/PreferencesBody.js +1 -5
  64. package/lib/esm/components/ManagePreferences/PreferencesHeader.js +1 -1
  65. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts +1 -1
  66. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts.map +1 -1
  67. package/lib/esm/components/ManagePreferences/components/PreferenceSelect.js +26 -27
  68. package/lib/esm/components/ManagePreferences/components/PreferenceSwitch.d.ts.map +1 -1
  69. package/lib/esm/components/ManagePreferences/components/PreferenceSwitch.js +6 -6
  70. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.d.ts.map +1 -1
  71. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +8 -9
  72. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
  73. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +77 -63
  74. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.d.ts.map +1 -1
  75. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.js +3 -4
  76. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.d.ts.map +1 -1
  77. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +47 -103
  78. package/lib/esm/components/ManageTable/ManageTable.d.ts +3 -4
  79. package/lib/esm/components/ManageTable/ManageTable.d.ts.map +1 -1
  80. package/lib/esm/components/ManageTable/ManageTable.js +12 -18
  81. package/lib/esm/components/ManageTags/TagsManager.d.ts.map +1 -1
  82. package/lib/esm/components/ManageTags/TagsManager.js +58 -50
  83. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.d.ts.map +1 -1
  84. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.js +35 -26
  85. package/lib/esm/components/NotificationEmails/index.d.ts.map +1 -1
  86. package/lib/esm/components/NotificationEmails/index.js +10 -7
  87. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.d.ts.map +1 -1
  88. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.js +2 -3
  89. package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimitGuidelines.js +6 -6
  90. package/lib/esm/components/TopContentManagement/CategoryLimit/QuestionAnswer.js +1 -1
  91. package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.d.ts.map +1 -1
  92. package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.js +7 -9
  93. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts +1 -0
  94. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts.map +1 -1
  95. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.js +2 -2
  96. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.d.ts.map +1 -1
  97. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.js +12 -10
  98. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts +2 -3
  99. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts.map +1 -1
  100. package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.js +16 -9
  101. package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.d.ts.map +1 -1
  102. package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.js +15 -16
  103. package/lib/esm/components/TopContentManagement/NoTopContentFound.d.ts.map +1 -1
  104. package/lib/esm/components/TopContentManagement/NoTopContentFound.js +14 -15
  105. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.d.ts.map +1 -1
  106. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.js +47 -39
  107. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.d.ts.map +1 -1
  108. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.js +12 -6
  109. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategoryNew.js +3 -3
  110. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.d.ts.map +1 -1
  111. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.js +11 -7
  112. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.d.ts.map +1 -1
  113. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +62 -53
  114. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.d.ts.map +1 -1
  115. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.js +2 -3
  116. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.d.ts.map +1 -1
  117. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +8 -9
  118. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.js +2 -2
  119. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHint.js +4 -5
  120. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.d.ts.map +1 -1
  121. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.js +51 -25
  122. package/lib/esm/components/TopContentManagement/TopContentHeader.js +1 -1
  123. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.d.ts.map +1 -1
  124. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.js +64 -32
  125. package/lib/esm/constants/GroupSelectActions.d.ts +2 -1
  126. package/lib/esm/constants/GroupSelectActions.d.ts.map +1 -1
  127. package/lib/esm/constants/GroupSelectActions.js +1 -0
  128. package/lib/esm/constants/PartnershipLink.d.ts +3 -0
  129. package/lib/esm/constants/PartnershipLink.d.ts.map +1 -0
  130. package/lib/esm/constants/PartnershipLink.js +2 -0
  131. package/lib/esm/context/ExpiredContentContextProvider.d.ts.map +1 -1
  132. package/lib/esm/hooks/useCaseGroupGraphQL.d.ts +42 -0
  133. package/lib/esm/hooks/useCaseGroupGraphQL.d.ts.map +1 -0
  134. package/lib/esm/hooks/useCaseGroupGraphQL.js +117 -0
  135. package/lib/esm/hooks/useCaseLabelGraphQL.d.ts +26 -0
  136. package/lib/esm/hooks/useCaseLabelGraphQL.d.ts.map +1 -0
  137. package/lib/esm/hooks/useCaseLabelGraphQL.js +104 -0
  138. package/lib/esm/hooks/useCurrentUserContact.d.ts +8 -0
  139. package/lib/esm/hooks/useCurrentUserContact.d.ts.map +1 -0
  140. package/lib/esm/hooks/useCurrentUserContact.js +74 -0
  141. package/lib/esm/hooks/useVersionsDiffer.d.ts.map +1 -1
  142. package/lib/esm/index.d.ts.map +1 -1
  143. package/lib/esm/index.js +2 -0
  144. package/lib/esm/reducers/ExpiredContentReducer.d.ts.map +1 -1
  145. package/lib/esm/reducers/ManagePartnershipsReducer.d.ts.map +1 -1
  146. package/lib/esm/reducers/TagManagmentReducer.d.ts +1 -1
  147. package/lib/esm/reducers/TagManagmentReducer.d.ts.map +1 -1
  148. package/lib/esm/reducers/TopContentHelpers.d.ts.map +1 -1
  149. package/lib/esm/reducers/TopContentReducer.d.ts.map +1 -1
  150. package/lib/esm/reducers/TopContentReducer.js +5 -2
  151. package/lib/esm/scss/_main.scss +266 -24
  152. package/lib/esm/scss/_pf-overrides.scss +66 -53
  153. package/lib/esm/scss/index.scss +5 -4
  154. package/lib/esm/utils/caseGroupMapper.d.ts +18 -0
  155. package/lib/esm/utils/caseGroupMapper.d.ts.map +1 -0
  156. package/lib/esm/utils/caseGroupMapper.js +50 -0
  157. package/package.json +21 -22
@@ -7,39 +7,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { accounts } from '@cee-eng/hydrajs';
11
- import { Card, CardBody, CardHeader, Popover, PopoverPosition, Spinner, TextArea, Tooltip, } from '@patternfly/react-core';
12
- import { SelectOption } from '@patternfly/react-core/deprecated';
10
+ // import { accounts } from '@cee-eng/hydrajs';
11
+ import { Card, CardBody, CardHeader, Popover, PopoverPosition, SelectOption, Spinner, TextArea,
12
+ // Tooltip,
13
+ } from '@patternfly/react-core';
13
14
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
14
- import { EditorMode, ToastNotification, useFetch } from '@rh-support/components';
15
- import { fetchLoggedInUsersAccount, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
16
- import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
15
+ import { ToastNotification /* , useFetch */ } from '@rh-support/components';
16
+ import { GlobalMetadataStateContext } from '@rh-support/react-context';
17
+ import { ability /* , CaseListFields */, resourceActions, resources } from '@rh-support/user-permissions';
17
18
  import debounce from 'lodash/debounce';
18
19
  import isEmpty from 'lodash/isEmpty';
19
20
  import React, { useContext, useEffect, useState } from 'react';
20
21
  import { Trans, useTranslation } from 'react-i18next';
21
22
  import { useUserPreferences } from '../../../hooks/useUserPreferences';
22
23
  import { PreferenceSelect } from '../components/PreferenceSelect';
23
- import { PreferenceSwitch } from '../components/PreferenceSwitch';
24
24
  export function PreferencesCaseView(props) {
25
25
  const { t } = useTranslation();
26
- const { updateCommentType, getCommentTypeFromPreference, getCommentSignature, updateCommentSignature, getOriginalCaseView, updateOriginalCaseView, } = useUserPreferences();
27
- const { globalMetadataState: { loggedInUsersAccount, loggedInUserJwtToken, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
28
- const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
29
- const [isSharingHostNames, setIsSharingHostNames] = useState(false);
26
+ const { getCommentSignature, updateCommentSignature, getOriginalCaseView, updateOriginalCaseView } = useUserPreferences();
27
+ const {
28
+ // globalMetadataState: { loggedInUsersAccount, loggedInUserRights },
29
+ globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
30
+ // const [isSharingHostNames, setIsSharingHostNames] = useState(false);
30
31
  const [localCommentSignature, setLocalCommentSignature] = useState('');
31
- const [originalCommentType, setOriginalCommentType] = useState('');
32
32
  const [originalCommentSignature, setOriginalCommentSignature] = useState('');
33
33
  const [commentValidated, setCommentValidated] = useState('default');
34
- const [isHostnamesLoading, setIsHostnamesLoading] = useState(true);
34
+ // const [isHostnamesLoading, setIsHostnamesLoading] = useState(true);
35
35
  const [isCommentSignatureLoading, setIsCommentSignatureLoading] = useState(false);
36
- const commentTypes = [EditorMode.PLAIN, EditorMode.MARKDOWN];
37
- const defaultCommentTitleID = 'default-comment-preference-select';
38
36
  const defaultCaseViewID = 'default-case-view-select';
39
- const canUseHostName = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.HOSTNAME);
37
+ // const canUseHostName = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.HOSTNAME);
40
38
  const isInternalUserPermission = ability.can(resourceActions.READ, resources.ACCOUNTS_FILTER);
41
- const accountNumber = loggedInUsersAccount.data.accountNumber;
42
- const { request: updateShareHostnames } = useFetch(accounts.updateIsSharingHostname);
39
+ // const accountNumber = loggedInUsersAccount.data.accountNumber;
40
+ // const { request: updateShareHostnames } = useFetch(accounts.updateIsSharingHostname);
43
41
  const originalAccountPermission = loggedInUserRights.data.isInternal();
44
42
  const [originalCaseView, setOriginalCaseView] = useState(+originalAccountPermission);
45
43
  const caseViewTypes = [
@@ -51,7 +49,6 @@ export function PreferencesCaseView(props) {
51
49
  ];
52
50
  useEffect(() => {
53
51
  userOriginalCommentSignature();
54
- userOriginalCommentType();
55
52
  userOriginalCaseView();
56
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
57
54
  }, []);
@@ -60,23 +57,19 @@ export function PreferencesCaseView(props) {
60
57
  setCommentValidated('default');
61
58
  }
62
59
  }, [localCommentSignature, commentValidated]);
63
- useEffect(() => {
64
- function userOriginalHostnameValue() {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- var _a, _b;
67
- try {
68
- ((_a = loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.shareHostnameWithRHT) &&
69
- setIsSharingHostNames((_b = loggedInUsersAccount.data) === null || _b === void 0 ? void 0 : _b.shareHostnameWithRHT);
70
- }
71
- catch (error) {
72
- console.log(error);
73
- }
74
- setIsHostnamesLoading(false);
75
- });
76
- }
77
- canUseHostName && userOriginalHostnameValue();
78
- // eslint-disable-next-line react-hooks/exhaustive-deps
79
- }, []);
60
+ // useEffect(() => {
61
+ // async function userOriginalHostnameValue() {
62
+ // try {
63
+ // loggedInUsersAccount.data?.shareHostnameWithRHT &&
64
+ // setIsSharingHostNames(loggedInUsersAccount.data?.shareHostnameWithRHT);
65
+ // } catch (error) {
66
+ // console.log(error);
67
+ // }
68
+ // setIsHostnamesLoading(false);
69
+ // }
70
+ // canUseHostName && userOriginalHostnameValue();
71
+ // // eslint-disable-next-line react-hooks/exhaustive-deps
72
+ // }, []);
80
73
  const userOriginalCaseView = () => __awaiter(this, void 0, void 0, function* () {
81
74
  try {
82
75
  const retrievedCaseView = yield getOriginalCaseView();
@@ -88,15 +81,6 @@ export function PreferencesCaseView(props) {
88
81
  ToastNotification.addWarningMessage(t('Failed to fetch original preference'));
89
82
  }
90
83
  });
91
- const userOriginalCommentType = () => __awaiter(this, void 0, void 0, function* () {
92
- try {
93
- const retrievedComment = yield getCommentTypeFromPreference();
94
- setOriginalCommentType(retrievedComment);
95
- }
96
- catch (_a) {
97
- ToastNotification.addWarningMessage(t('Failed to fetch original preference'));
98
- }
99
- });
100
84
  const userOriginalCommentSignature = () => __awaiter(this, void 0, void 0, function* () {
101
85
  try {
102
86
  const retrievedSignature = yield getCommentSignature();
@@ -130,7 +114,7 @@ export function PreferencesCaseView(props) {
130
114
  });
131
115
  const onPrefCaseViewSelect = (event, selection) => __awaiter(this, void 0, void 0, function* () {
132
116
  try {
133
- let selectedView = event.currentTarget.getAttribute('data-index');
117
+ let selectedView = caseViewTypes.findIndex((option) => option.value === selection);
134
118
  updateOriginalCaseView(selectedView);
135
119
  setOriginalCaseView(+selectedView);
136
120
  }
@@ -138,48 +122,19 @@ export function PreferencesCaseView(props) {
138
122
  console.log(error);
139
123
  }
140
124
  });
141
- // To set the case of text in dropdown
142
- const setOptionCase = (option, reverse) => {
143
- if (reverse) {
144
- if (option === 'Plain text') {
145
- return EditorMode.PLAIN;
146
- }
147
- else if (option === 'Markdown') {
148
- return EditorMode.MARKDOWN;
149
- }
150
- }
151
- else {
152
- if (option === EditorMode.PLAIN) {
153
- return 'Plain text';
154
- }
155
- else if (option === EditorMode.MARKDOWN) {
156
- return 'Markdown';
157
- }
158
- }
159
- };
160
- const onCommentSelect = (event, selection) => __awaiter(this, void 0, void 0, function* () {
161
- try {
162
- const selectedComment = setOptionCase(selection, true);
163
- yield updateCommentType(selectedComment);
164
- setOriginalCommentType(selectedComment);
165
- }
166
- catch (error) {
167
- console.log(error);
168
- }
169
- });
170
- const onShareHostNamesSwitch = () => __awaiter(this, void 0, void 0, function* () {
171
- try {
172
- setIsHostnamesLoading(true);
173
- yield updateShareHostnames(!isSharingHostNames, accountNumber);
174
- fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true);
175
- setIsSharingHostNames(!isSharingHostNames);
176
- }
177
- catch (error) {
178
- console.log(error);
179
- }
180
- setIsHostnamesLoading(false);
181
- });
182
- const prefHostnameCopy = 'Red Hat Support cannot currently access hostnames that have been entered on a case. You can share this information at any time to improve your support experience.';
125
+ // const onShareHostNamesSwitch = async () => {
126
+ // try {
127
+ // setIsHostnamesLoading(true);
128
+ // await updateShareHostnames!(!isSharingHostNames, accountNumber!);
129
+ // // TODO: migrate to GraphQL - fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true, apolloClient);
130
+ // setIsSharingHostNames(!isSharingHostNames);
131
+ // } catch (error) {
132
+ // console.log(error);
133
+ // }
134
+ // setIsHostnamesLoading(false);
135
+ // };
136
+ // const prefHostnameCopy =
137
+ // 'Red Hat Support cannot currently access hostnames that have been entered on a case. You can share this information at any time to improve your support experience.';
183
138
  const caseViewPrefSelection = () => {
184
139
  if (!!originalCaseView) {
185
140
  return caseViewTypes[+originalAccountPermission].value;
@@ -192,31 +147,20 @@ export function PreferencesCaseView(props) {
192
147
  React.createElement(Trans, null, "Default case view"),
193
148
  React.createElement(Popover, { "aria-label": "Preferred-default-case-view-popover", position: PopoverPosition.top, bodyContent: React.createElement("p", { className: 'pref-case-popover-text' },
194
149
  React.createElement(Trans, null, "Choose the default view you want to see when looking at a case")), showClose: false },
195
- React.createElement(InfoCircleIcon, { "aria-label": "Preferred-default-case-view-info-icon", className: "pf-v5-u-ml-sm" }))));
196
- return (React.createElement(Card, { className: "preference-card" },
150
+ React.createElement(InfoCircleIcon, { "aria-label": "Preferred-default-case-view-info-icon", className: "pf-v6-u-ml-sm" }))));
151
+ return (React.createElement(Card, { variant: "secondary", className: "preference-card" },
197
152
  React.createElement(CardHeader, null,
198
153
  React.createElement("h3", null,
199
154
  React.createElement(Trans, null, "Case view"))),
200
155
  React.createElement(CardBody, null,
201
156
  React.createElement("form", null,
202
157
  isInternalUserPermission && (React.createElement("div", { className: "form-group" },
203
- React.createElement(PreferenceSelect, { onSelect: onPrefCaseViewSelect, selections: caseViewPrefSelection(), id: defaultCaseViewID, label: prefCasePopover }, caseViewTypes.map((option, index) => (React.createElement(SelectOption, Object.assign({ "data-index": index, key: index, value: option.value }, (option.description && { description: option.description })))))))),
204
- React.createElement("div", { className: "form-group" },
205
- React.createElement(PreferenceSelect, { onSelect: onCommentSelect, selections: setOptionCase(originalCommentType, false), id: defaultCommentTitleID, label: "Default comment type" }, commentTypes.map((option, index) => (React.createElement(SelectOption, { key: index, value: setOptionCase(option, false) }))))),
158
+ React.createElement(PreferenceSelect, { onSelect: (event, selection) => onPrefCaseViewSelect(event, selection), selections: caseViewPrefSelection(), id: defaultCaseViewID, label: prefCasePopover }, caseViewTypes.map((option, index) => (React.createElement(SelectOption, Object.assign({ "data-index": index, key: index, value: option.value }, (option.description && { description: option.description })))))))),
206
159
  React.createElement("div", { className: "form-group" },
207
160
  React.createElement("label", { htmlFor: "comment-signature-textarea" },
208
161
  React.createElement(Trans, null, "Comment signature")),
209
162
  React.createElement(TextArea, { value: localCommentSignature, onChange: (_event, value) => handleCommentSignatureChange(value), "aria-label": "comment-signature-textarea", placeholder: originalCommentSignature || 'Add a comment signature', id: "comment-signature-textarea",
210
163
  // @ts-ignore
211
164
  validated: commentValidated, resizeOrientation: "vertical" }),
212
- isCommentSignatureLoading && React.createElement(Spinner, { size: "md" })),
213
- canUseHostName && (React.createElement("div", { className: "form-group" },
214
- React.createElement("label", null,
215
- React.createElement(Trans, null, "Case information")),
216
- React.createElement("div", { className: "preference-page-switch-container" },
217
- React.createElement(PreferenceSwitch, { id: "share-hostnames-switch", label: 'Share hostnames', isChecked: isSharingHostNames, onSwitchChange: onShareHostNamesSwitch }),
218
- React.createElement("div", { className: "prefhostnameTooltip" },
219
- React.createElement(Tooltip, { content: prefHostnameCopy, position: "right" },
220
- React.createElement(InfoCircleIcon, { className: "pf-v5-u-ml-sm" })),
221
- isHostnamesLoading && (React.createElement(Spinner, { size: "lg", className: "pf-v5-u-ml-sm hostnameSpinner", "aria-label": "Hostname loading" }))))))))));
165
+ isCommentSignatureLoading && React.createElement(Spinner, { size: "md" }))))));
222
166
  }
@@ -1,5 +1,4 @@
1
1
  import { AlertVariant } from '@patternfly/react-core';
2
- import { IActions, IActionsResolver, IAreActionsDisabled } from '@patternfly/react-table';
3
2
  import { IColumn, ISortInfo } from '@rh-support/components';
4
3
  import React from 'react';
5
4
  interface IProps {
@@ -14,9 +13,9 @@ interface IProps {
14
13
  isError: boolean;
15
14
  pagination?: boolean;
16
15
  keepPageNumberOnDataChange?: boolean;
17
- actions?: IActions;
18
- areActionsDisabled?: IAreActionsDisabled;
19
- actionResolver?: IActionsResolver;
16
+ actions?: any;
17
+ areActionsDisabled?: any;
18
+ actionResolver?: any;
20
19
  noResultText?: string;
21
20
  perPage?: number;
22
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ManageTable.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageTable/ManageTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGH,YAAY,EAQf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,SAAS,EAA4C,MAAM,wBAAwB,CAAC;AACtG,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,MAAM;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAGrB,cAAc,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IAEjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,kBAAkB,CAAC,EAAE,mBAAmB,CAAC;IACzC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAElC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AA+BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,qBAoDxC"}
1
+ {"version":3,"file":"ManageTable.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageTable/ManageTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGH,YAAY,EAMf,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,OAAO,EAAE,SAAS,EAA4C,MAAM,wBAAwB,CAAC;AACtG,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,MAAM;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAGrB,cAAc,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IAEjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,cAAc,CAAC,EAAE,GAAG,CAAC;IAErB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAyBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,qBAqDxC"}
@@ -9,34 +9,28 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { Alert, AlertActionCloseButton, Bullseye, EmptyState, EmptyStateBody, EmptyStateHeader, EmptyStateIcon, EmptyStateVariant, PaginationVariant, } from '@patternfly/react-core';
12
+ import { Alert, AlertActionCloseButton, Bullseye, EmptyState, EmptyStateBody, EmptyStateVariant, PaginationVariant, } from '@patternfly/react-core';
13
13
  import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
14
+ // Removed direct imports from @patternfly/react-table to avoid version conflicts
14
15
  import { PFTable, TableComponent, TablePagination } from '@rh-support/components';
15
16
  import React from 'react';
16
17
  import { Trans } from 'react-i18next';
17
- const noResultFoundRow = (noResultString = '') => [
18
- {
19
- heightAuto: true,
20
- cells: [
21
- {
22
- props: { colSpan: 10 },
23
- title: (React.createElement(Bullseye, null,
24
- React.createElement(EmptyState, { variant: EmptyStateVariant.xs },
25
- React.createElement(EmptyStateHeader, { titleText: React.createElement(React.Fragment, null,
26
- React.createElement(Trans, null, "No results found")), icon: React.createElement(EmptyStateIcon, { icon: SearchIcon }), headingLevel: "h3" }),
27
- React.createElement(EmptyStateBody, null, noResultString ? noResultString : React.createElement(Trans, null, "There are no results to display."))))),
28
- },
29
- ],
30
- },
31
- ];
18
+ const noResultFoundRow = (noResultString = '') => ({
19
+ heightAuto: true,
20
+ colSpan: 10,
21
+ content: (React.createElement(Bullseye, null,
22
+ React.createElement(EmptyState, { headingLevel: "h3", icon: SearchIcon, titleText: React.createElement(React.Fragment, null,
23
+ React.createElement(Trans, null, "No results found")), variant: EmptyStateVariant.xs },
24
+ React.createElement(EmptyStateBody, null, noResultString ? noResultString : React.createElement(Trans, null, "There are no results to display."))))),
25
+ });
32
26
  export function ManageTable(props) {
33
27
  const { ariaLabel, errorComponent, errorTitle, errorVariant, isError, isFetching, sortInfo, actions, keepPageNumberOnDataChange, areActionsDisabled, actionResolver } = props, tableProps = __rest(props, ["ariaLabel", "errorComponent", "errorTitle", "errorVariant", "isError", "isFetching", "sortInfo", "actions", "keepPageNumberOnDataChange", "areActionsDisabled", "actionResolver"]);
34
28
  const pagination = () => (props.pagination !== undefined ? props.pagination : true);
35
29
  return (React.createElement("div", { className: "table-wrapper" },
36
30
  isError && (React.createElement(React.Fragment, null,
37
- React.createElement(Alert, { variant: errorVariant, isInline: true, title: errorTitle, actionClose: React.createElement(AlertActionCloseButton, null), className: "pf-v5-u-my-sm" }, errorComponent))),
31
+ React.createElement(Alert, { variant: errorVariant, isInline: true, title: errorTitle, actionClose: React.createElement(AlertActionCloseButton, null), className: "pf-v6-u-my-sm bookmark-alert" }, errorComponent))),
38
32
  React.createElement(TableComponent, Object.assign({}, tableProps),
39
- React.createElement(PFTable, { sortInfo: sortInfo, "aria-label": ariaLabel, pagination: pagination(), emptyStateRow: noResultFoundRow(props.noResultText), actions: actions, areActionsDisabled: areActionsDisabled, actionResolver: actionResolver, isLoading: isFetching, keepPageNumberOnDataChange: keepPageNumberOnDataChange }),
33
+ React.createElement(PFTable, Object.assign({ sortInfo: sortInfo, "aria-label": ariaLabel, pagination: pagination(), emptyStateRow: noResultFoundRow(props.noResultText) }, (actions && { actions }), (areActionsDisabled && { areActionsDisabled }), (actionResolver && { actionResolver }), { isLoading: isFetching, keepPageNumberOnDataChange: keepPageNumberOnDataChange })),
40
34
  tableProps.data.length > 0 && pagination() && (React.createElement("footer", null,
41
35
  React.createElement(TablePagination, { variant: PaginationVariant.bottom, perPage: props.perPage || 10 }))))));
42
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TagsManager.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageTags/TagsManager.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,MAAM,CAAC,OAAO,UAAU,WAAW,sBAyYlC"}
1
+ {"version":3,"file":"TagsManager.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageTags/TagsManager.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAaxE,MAAM,CAAC,OAAO,UAAU,WAAW,sBAqZlC"}
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { ActionList, ActionListItem, Bullseye, Button, ButtonVariant, EmptyState, EmptyStateVariant, Flex, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, Spinner, TextInput, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
10
+ import { ActionList, ActionListItem, Bullseye, Button, ButtonVariant, EmptyState, EmptyStateVariant, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, Spinner, TextInput, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
11
11
  import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
12
12
  import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
13
13
  import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
@@ -18,7 +18,7 @@ import { isEmpty, isNull, isUndefined } from 'lodash';
18
18
  import React, { useContext, useEffect, useMemo, useState } from 'react';
19
19
  import { Trans, useTranslation } from 'react-i18next';
20
20
  import { TagManagementDispatchContext, TagManagementStateContext } from '../../context/TagManagementContextProvider';
21
- import { createNewTags, deleteTag, fetchTopContentTags, updateTag } from '../../reducers/TagManagmentReducer';
21
+ import { createNewTags, deleteTag, fetchTopContentTags, updateTag, } from '../../reducers/TagManagmentReducer';
22
22
  import { ManageTable } from '../ManageTable';
23
23
  export default function TagsManager() {
24
24
  const { t } = useTranslation();
@@ -49,16 +49,17 @@ export default function TagsManager() {
49
49
  };
50
50
  //filtering tags for user search
51
51
  const filteredTagIds = useMemo(() => {
52
+ const tagStates = Object.values(tagsByIds);
52
53
  if (isEmpty(tagSearchTerm))
53
- return tags.map((t) => t.id);
54
+ return tagStates.map((t) => t.id);
54
55
  const filteredIds = [];
55
- tags.forEach((t) => {
56
+ tagStates.forEach((t) => {
56
57
  if (t.tagName.toLowerCase().includes(tagSearchTerm.toLowerCase())) {
57
58
  filteredIds.push(t.id);
58
59
  }
59
60
  });
60
61
  return filteredIds;
61
- }, [tagSearchTerm, tags]);
62
+ }, [tagSearchTerm, tagsByIds]);
62
63
  const getTopContentTags = () => __awaiter(this, void 0, void 0, function* () {
63
64
  try {
64
65
  yield fetchTopContentTags(dispatch);
@@ -155,7 +156,7 @@ export default function TagsManager() {
155
156
  const onSearchClear = () => {
156
157
  setTagSearchTerm('');
157
158
  };
158
- const columns = [
159
+ const columns = useMemo(() => [
159
160
  {
160
161
  accessor: (id) => tagsByIds[id].tagName,
161
162
  sortable: false,
@@ -191,69 +192,76 @@ export default function TagsManager() {
191
192
  cellWidth: 10,
192
193
  cell: (id) => (React.createElement(ActionList, { isIconList: true },
193
194
  React.createElement(ActionListItem, null,
194
- React.createElement(Button, { variant: "plain", "data-tracking-id": "edit-tag", "aria-label": `edit tag ${tagsByIds[id].tagName}`, onClick: () => onEditTagClick(tagsByIds[id]) },
195
- React.createElement(PencilAltIcon, null))),
195
+ React.createElement(Button, { icon: React.createElement(PencilAltIcon, null), variant: "plain", "data-tracking-id": "edit-tag", "aria-label": `edit tag ${tagsByIds[id].tagName}`, onClick: () => onEditTagClick(tagsByIds[id]) })),
196
196
  React.createElement(ActionListItem, null,
197
- React.createElement(Button, { "aria-label": `delete tag ${tagsByIds[id].tagName}`, variant: "plain", "data-tracking-id": "delete-tag", onClick: () => onDeleteTagClick(tagsByIds[id]) },
198
- React.createElement(TrashIcon, null))))),
197
+ React.createElement(Button, { icon: React.createElement(TrashIcon, null), "aria-label": `delete tag ${tagsByIds[id].tagName}`, variant: "plain", "data-tracking-id": "delete-tag", onClick: () => onDeleteTagClick(tagsByIds[id]) })))),
199
198
  },
200
- ];
201
- const CreateTagModel = (React.createElement(Modal, { title: t('Create a tag'), onClose: onCancelCreateNewTag, isOpen: createTagModalOpen, actions: [
202
- React.createElement(Button, { key: "create-tag", variant: ButtonVariant.primary, onClick: onCreateNewTag, isLoading: isCreatingNewTag, isDisabled: !isEmpty(createTagError) || isCreatingNewTag },
199
+ ],
200
+ // eslint-disable-next-line react-hooks/exhaustive-deps
201
+ [tagsByIds]);
202
+ const CreateTagModel = (React.createElement(Modal, { onClose: onCancelCreateNewTag, isOpen: createTagModalOpen },
203
+ React.createElement(ModalHeader, null,
204
+ React.createElement("h2", null, t('Create a tag'))),
205
+ React.createElement(ModalBody, null,
206
+ React.createElement(FormGroup, { label: "Tag name", isRequired: true },
207
+ React.createElement(TextInput, { isRequired: true, type: "text", id: "create-new-tag-text-input", value: newTagName, onChange: (e, v) => {
208
+ setNewTagName(v);
209
+ setCreateTagError('');
210
+ }, placeholder: t('Enter a unique name to create a tag'), validated: isEmpty(createTagError) ? 'default' : 'error' }),
211
+ !isEmpty(createTagError) && (React.createElement(FormHelperText, null,
212
+ React.createElement(HelperText, null,
213
+ React.createElement(HelperTextItem, { variant: "error" }, createTagError)))))),
214
+ React.createElement(ModalFooter, null,
215
+ React.createElement(Button, { key: "create-tag", variant: ButtonVariant.primary, onClick: onCreateNewTag, isLoading: isCreatingNewTag, isDisabled: isEmpty(newTagName) || !isEmpty(createTagError) || isCreatingNewTag },
203
216
  React.createElement(Trans, null, "Create")),
204
- React.createElement(Button, { key: "cancel-create-tag", variant: ButtonVariant.link, onClick: onCancelCreateNewTag }, "Cancel"),
205
- ] },
206
- React.createElement(FormGroup, { label: "Tag name", isRequired: true },
207
- React.createElement(TextInput, { isRequired: true, type: "text", id: "create-new-tag-text-input", value: newTagName, onChange: (e, v) => {
208
- setNewTagName(v);
209
- setCreateTagError('');
210
- }, placeholder: t('Enter a unique name to create a tag'), validated: isEmpty(createTagError) ? 'default' : 'error' }),
211
- !isEmpty(createTagError) && (React.createElement(FormHelperText, null,
212
- React.createElement(HelperText, null,
213
- React.createElement(HelperTextItem, { variant: "error" }, createTagError)))))));
214
- const EditTagModal = (React.createElement(Modal, { title: t('Edit Tag'), isOpen: editTagModalOpen, onClose: onEditCancel, actions: [
217
+ React.createElement(Button, { key: "cancel-create-tag", variant: ButtonVariant.link, onClick: onCancelCreateNewTag }, "Cancel"))));
218
+ const EditTagModal = (React.createElement(Modal, { isOpen: editTagModalOpen, onClose: onEditCancel },
219
+ React.createElement(ModalHeader, null,
220
+ React.createElement("h2", null, t('Edit Tag'))),
221
+ React.createElement(ModalBody, null,
222
+ React.createElement(FormGroup, { label: "Tag name", isRequired: true },
223
+ React.createElement(TextInput, { isRequired: true, type: "text", id: "edit-tag-text-input", value: editTagName, onChange: (e, v) => {
224
+ setEditTagName(v);
225
+ setEditTagError('');
226
+ }, placeholder: t('Enter a unique name for this tag') }),
227
+ !isEmpty(editTagError) && (React.createElement(FormHelperText, null,
228
+ React.createElement(HelperText, null,
229
+ React.createElement(HelperTextItem, { variant: "error" }, editTagError)))))),
230
+ React.createElement(ModalFooter, null,
215
231
  React.createElement(Button, { key: "edit-tag", variant: ButtonVariant.primary, onClick: onEditTagConfirm, isLoading: isEditingTagName, isDisabled: !isEmpty(editTagError) || isEditingTagName },
216
232
  React.createElement(Trans, null, "Save")),
217
- React.createElement(Button, { key: "cancel-edit-tag", variant: ButtonVariant.link, onClick: onEditCancel }, "Cancel"),
218
- ] },
219
- React.createElement(FormGroup, { label: "Tag name", isRequired: true },
220
- React.createElement(TextInput, { isRequired: true, type: "text", id: "edit-tag-text-input", value: editTagName, onChange: (e, v) => {
221
- setEditTagName(v);
222
- setEditTagError('');
223
- }, placeholder: t('Enter a unique name for this tag') }),
224
- !isEmpty(editTagError) && (React.createElement(FormHelperText, null,
225
- React.createElement(HelperText, null,
226
- React.createElement(HelperTextItem, { variant: "error" }, editTagError)))))));
227
- const DeleteTagModel = () => (React.createElement(Modal, { title: t('Are you sure?'), isOpen: deleteTagModalOpen, onClose: () => setDeleteTagModalOpen(false), actions: [
233
+ React.createElement(Button, { key: "cancel-edit-tag", variant: ButtonVariant.link, onClick: onEditCancel }, "Cancel"))));
234
+ const DeleteTagModel = () => (React.createElement(Modal, { isOpen: deleteTagModalOpen, onClose: () => setDeleteTagModalOpen(false) },
235
+ React.createElement(ModalHeader, null,
236
+ React.createElement("h2", null, t('Are you sure?'))),
237
+ React.createElement(ModalBody, null,
238
+ React.createElement(Trans, null, "Deleting this tag will permanently untag all content associated with it. Are you sure you want to proceed?")),
239
+ React.createElement(ModalFooter, null,
228
240
  React.createElement(Button, { key: "delete-tag", variant: ButtonVariant.danger, onClick: onDeleteTagConfirm, isLoading: isDeletingTag, isDisabled: isDeletingTag },
229
241
  React.createElement(Trans, null, "Yes, I am sure")),
230
- React.createElement(Button, { key: "cancel-delete-tag", variant: ButtonVariant.link, onClick: () => setDeleteTagModalOpen(false) }, "Cancel"),
231
- ] },
232
- React.createElement(Trans, null, "Deleting this tag will permanently untag all content associated with it. Are you sure you want to proceed?")));
242
+ React.createElement(Button, { key: "cancel-delete-tag", variant: ButtonVariant.link, onClick: () => setDeleteTagModalOpen(false) }, "Cancel"))));
233
243
  return (React.createElement(React.Fragment, null,
234
244
  CreateTagModel,
235
245
  EditTagModal,
236
246
  React.createElement(DeleteTagModel, null),
237
247
  React.createElement("header", null,
238
248
  React.createElement("h2", null, "Tags"),
239
- React.createElement("p", { className: "pf-v5-u-my-sm" },
249
+ React.createElement("p", { className: "pf-v6-u-my-sm" },
240
250
  React.createElement(Trans, null, "Add, edit or remove tags and manage tagged top content."))),
241
- React.createElement("div", { className: "toolbar" },
242
- React.createElement(Flex, { alignItems: { default: 'alignItemsCenter' }, className: "pf-v5-u-w-100" },
251
+ React.createElement("div", { className: "toolbar pf-v6-u-display-flex pf-v6-u-flex-direction-row pf-v6-u-align-items-center" },
252
+ React.createElement("div", { className: "pf-v6-u-display-flex pf-v6-u-flex-direction-row pf-v6-u-align-items-center" },
243
253
  React.createElement("label", { htmlFor: "tag-search-input" },
244
254
  React.createElement(Trans, null, "Search Tag")),
245
- React.createElement("div", { className: "pf-v5-u-flex-grow-1" },
255
+ React.createElement("div", null,
246
256
  React.createElement(TextInputGroup, null,
247
257
  React.createElement(TextInputGroupMain, { type: "text", id: "tag-search-input", placeholder: t('Search for a tag'), icon: React.createElement(SearchIcon, null), value: tagSearchTerm, onChange: (e, v) => setTagSearchTerm(v) }),
248
258
  !isEmpty(tagSearchTerm) && (React.createElement(TextInputGroupUtilities, null,
249
- React.createElement(Button, { variant: "plain", onClick: onSearchClear, "aria-label": "Clear button and input" },
250
- React.createElement(TimesIcon, null)))))),
251
- React.createElement("span", { className: "pf-v5-u-ml-sm" },
252
- React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: () => {
253
- setCreateTagModalOpen(true);
254
- setNewTagName(tagSearchTerm);
255
- }, "data-tracking-id": "tag-create-button" },
256
- React.createElement(Trans, null, "Create tag"))))),
259
+ React.createElement(Button, { icon: React.createElement(TimesIcon, null), variant: "plain", onClick: onSearchClear, "aria-label": "Clear button and input" })))))),
260
+ React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: () => {
261
+ setCreateTagModalOpen(true);
262
+ setNewTagName(tagSearchTerm);
263
+ }, "data-tracking-id": "tag-create-button", className: "pf-v6-u-ml-md" },
264
+ React.createElement(Trans, null, "Create tag"))),
257
265
  React.createElement("div", { className: "tags-manager-wrapper" },
258
266
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading tags list') } }, tagResponse.isFetching ? (React.createElement(Bullseye, null,
259
267
  React.createElement(EmptyState, { variant: EmptyStateVariant.full },
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationEmailsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/NotificationEmails/NotificationEmailsModal.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,UAAU,MAAM;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,yBAAyB,EAAE,GAAG,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,yBAAyB,EAAE,OAAO,CAAC;IACnC,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB,UAAW,MAAM,sBA0NpD,CAAC"}
1
+ {"version":3,"file":"NotificationEmailsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/NotificationEmails/NotificationEmailsModal.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,UAAU,MAAM;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,yBAAyB,EAAE,GAAG,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,yBAAyB,EAAE,OAAO,CAAC;IACnC,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,sBAmOpD,CAAC"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { customEmail } from '@cee-eng/hydrajs';
11
- import { Button, ButtonVariant, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalVariant, TextInput, ValidatedOptions, } from '@patternfly/react-core';
11
+ import { Button, ButtonVariant, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, TextInput, ValidatedOptions, } from '@patternfly/react-core';
12
12
  import { ToastNotification, useFetch } from '@rh-support/components';
13
13
  import { isEmailValid } from '@rh-support/utils';
14
14
  import isEmpty from 'lodash/isEmpty';
@@ -45,7 +45,9 @@ export const NotificationEmailsModal = (props) => {
45
45
  setSaveButtonIsClicked(true);
46
46
  const isAValidEmail = checkEmailIsValid(email);
47
47
  const isAValidFirstName = !isEmpty(firstName.trim());
48
- const isDuplicateEmail = props.isAddingNotificationEmail ? props.emailsList.includes(email) : false;
48
+ const isDuplicateEmail = props.isAddingNotificationEmail
49
+ ? props.emailsList.includes(email.toLowerCase())
50
+ : false;
49
51
  setIsValidEmail(isAValidEmail);
50
52
  setIsValidFirstName(isAValidFirstName);
51
53
  setIsValidLastName(!checkForSpecialCharacters(lastName));
@@ -57,7 +59,7 @@ export const NotificationEmailsModal = (props) => {
57
59
  if (props.isAddingNotificationEmail) {
58
60
  yield addCustomEmailToAccount(props.accountNumber, email, firstName, lastName);
59
61
  ToastNotification.addSuccessMessage(t(`Notification email has been successfully added`));
60
- props.onAdd(email, firstName, lastName);
62
+ props.onAdd(email.toLowerCase(), firstName, lastName);
61
63
  }
62
64
  else {
63
65
  yield updateCustomEmail(props.accountNumber, props.selectedEmailNotification.email, email, firstName, lastName);
@@ -87,7 +89,7 @@ export const NotificationEmailsModal = (props) => {
87
89
  props.selectedEmailNotification.lastName !== lastName;
88
90
  const onEmailChange = (localemail) => {
89
91
  saveButtonIsClicked && setIsValidEmail(checkEmailIsValid(localemail));
90
- props.isAddingNotificationEmail && setIsEmailDuplicate(props.emailsList.includes(localemail));
92
+ props.isAddingNotificationEmail && setIsEmailDuplicate(props.emailsList.includes(localemail.toLowerCase()));
91
93
  setEmail(localemail);
92
94
  };
93
95
  const onFirstNameChange = (firstName) => {
@@ -105,7 +107,34 @@ export const NotificationEmailsModal = (props) => {
105
107
  const specialCharRegex = /[^a-zA-Z0-9\s]/;
106
108
  return specialCharRegex.test(s);
107
109
  };
108
- return (React.createElement(Modal, { id: "Add-edit-notification-email-modal", className: "pf-modal-overflow-visible", title: t('Edit notification email'), "aria-describedby": "Add-edit-notification-email-modal", isOpen: props.isOpen, onClose: props.onClose, showClose: true, onEscapePress: props.onClose, variant: ModalVariant.medium, actions: [
110
+ return (React.createElement(Modal, { id: "Add-edit-notification-email-modal", className: "pf-modal-overflow-visible", "aria-describedby": "Add-edit-notification-email-modal", isOpen: props.isOpen, onClose: props.onClose, onEscapePress: props.onClose, variant: ModalVariant.medium },
111
+ React.createElement(ModalHeader, null,
112
+ React.createElement("h2", null, t('Edit notification email'))),
113
+ React.createElement(ModalBody, null,
114
+ React.createElement(Form, null,
115
+ React.createElement(FormGroup, { label: t('Email address'), isRequired: true, fieldId: "email-notification-first-emailaddress" },
116
+ React.createElement(TextInput, { value: email, isRequired: true, type: "text", onChange: (_event, localemail) => onEmailChange(localemail), "aria-label": t('Email address'), placeholder: t('Email address'), maxLength: 254, validated: isValidEmail && !isEmailDuplicate ? ValidatedOptions.default : ValidatedOptions.error, isDisabled: !props.isAddingNotificationEmail }),
117
+ !(isValidEmail && !isEmailDuplicate) && (React.createElement(FormHelperText, null,
118
+ React.createElement(HelperText, null,
119
+ React.createElement(HelperTextItem, { variant: ValidatedOptions.error }, !isValidEmail
120
+ ? t('Invalid email')
121
+ : isEmailDuplicate
122
+ ? t('Duplicate Email')
123
+ : ''))))),
124
+ React.createElement(FormGroup, { label: t('First name'), isRequired: true, fieldId: "email-notification-first-name" },
125
+ React.createElement(TextInput, { value: firstName, isRequired: true, validated: isValidFirstName ? ValidatedOptions.default : ValidatedOptions.error, type: "text", onChange: (_event, firstName) => onFirstNameChange(firstName), "aria-label": t('First name'), placeholder: t('First name'), maxLength: 254 }),
126
+ !isValidFirstName && (React.createElement(FormHelperText, null,
127
+ React.createElement(HelperText, null,
128
+ React.createElement(HelperTextItem, { variant: ValidatedOptions.error }, isSpecialCharFirstName
129
+ ? t('First name cannot contain special characters')
130
+ : t('First name cannot be empty')))))),
131
+ React.createElement(FormGroup, { label: t('Last name'), fieldId: "email-notification-last-name" },
132
+ React.createElement(TextInput, { value: lastName, type: "text", validated: isValidLastName ? ValidatedOptions.default : ValidatedOptions.error, onChange: (_event, lastName) => onLastNameChange(lastName), "aria-label": t('Last name'), placeholder: t('Last name'), maxLength: 254 }),
133
+ !isValidLastName && (React.createElement(FormHelperText, null,
134
+ React.createElement(HelperText, null,
135
+ React.createElement(HelperTextItem, { variant: ValidatedOptions.error },
136
+ React.createElement(Trans, null, "Last name cannot contain special characters")))))))),
137
+ React.createElement(ModalFooter, null,
109
138
  React.createElement(Button, { key: "save", variant: ButtonVariant.primary, onClick: save, isDisabled: !isFormDirty() ||
110
139
  isUpdating ||
111
140
  isAdding ||
@@ -115,25 +144,5 @@ export const NotificationEmailsModal = (props) => {
115
144
  isEmailDuplicate, spinnerAriaValueText: isUpdating || isAdding ? t('Adding') : undefined, isLoading: isUpdating || isAdding },
116
145
  React.createElement(Trans, null, "Save")),
117
146
  React.createElement(Button, { key: "cancel", isDisabled: isLoading, variant: ButtonVariant.secondary, onClick: close },
118
- React.createElement(Trans, null, "Cancel")),
119
- ] },
120
- React.createElement(Form, null,
121
- React.createElement(FormGroup, { label: t('Email address'), isRequired: true, fieldId: "email-notification-first-emailaddress" },
122
- React.createElement(TextInput, { value: email, isRequired: true, type: "text", onChange: (_event, localemail) => onEmailChange(localemail), "aria-label": t('Email address'), placeholder: t('Email address'), maxLength: 254, validated: isValidEmail && !isEmailDuplicate ? ValidatedOptions.default : ValidatedOptions.error, isDisabled: !props.isAddingNotificationEmail }),
123
- !(isValidEmail && !isEmailDuplicate) && (React.createElement(FormHelperText, null,
124
- React.createElement(HelperText, null,
125
- React.createElement(HelperTextItem, { variant: ValidatedOptions.error }, !isValidEmail ? t('Invalid email') : isEmailDuplicate ? t('Duplicate Email') : ''))))),
126
- React.createElement(FormGroup, { label: t('First name'), isRequired: true, fieldId: "email-notification-first-name" },
127
- React.createElement(TextInput, { value: firstName, isRequired: true, validated: isValidFirstName ? ValidatedOptions.default : ValidatedOptions.error, type: "text", onChange: (_event, firstName) => onFirstNameChange(firstName), "aria-label": t('First name'), placeholder: t('First name'), maxLength: 254 }),
128
- !isValidFirstName && (React.createElement(FormHelperText, null,
129
- React.createElement(HelperText, null,
130
- React.createElement(HelperTextItem, { variant: ValidatedOptions.error }, isSpecialCharFirstName
131
- ? t('First name cannot contain special characters')
132
- : t('First name cannot be empty')))))),
133
- React.createElement(FormGroup, { label: t('Last name'), fieldId: "email-notification-last-name" },
134
- React.createElement(TextInput, { value: lastName, type: "text", validated: isValidLastName ? ValidatedOptions.default : ValidatedOptions.error, onChange: (_event, lastName) => onLastNameChange(lastName), "aria-label": t('Last name'), placeholder: t('Last name'), maxLength: 254 }),
135
- !isValidLastName && (React.createElement(FormHelperText, null,
136
- React.createElement(HelperText, null,
137
- React.createElement(HelperTextItem, { variant: ValidatedOptions.error },
138
- React.createElement(Trans, null, "Last name cannot contain special characters")))))))));
147
+ React.createElement(Trans, null, "Cancel")))));
139
148
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/NotificationEmails/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,wBAAgB,kBAAkB,sBAmOjC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/NotificationEmails/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,wBAAgB,kBAAkB,sBAuOjC"}