@rh-support/manage 2.6.1 → 2.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/ManageTabs.d.ts.map +1 -1
- package/lib/esm/ManageTabs.js +48 -20
- package/lib/esm/Routes.d.ts +1 -0
- package/lib/esm/Routes.d.ts.map +1 -1
- package/lib/esm/Routes.js +6 -0
- package/lib/esm/components/Configs/ConfigsTable.d.ts.map +1 -1
- package/lib/esm/components/Configs/ConfigsTable.js +33 -9
- package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts +12 -0
- package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts.map +1 -0
- package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.js +80 -0
- package/lib/esm/components/Groups/AddMembersModal/index.d.ts +2 -0
- package/lib/esm/components/Groups/AddMembersModal/index.d.ts.map +1 -0
- package/lib/esm/components/Groups/AddMembersModal/index.js +1 -0
- package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts +5 -3
- package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts.map +1 -1
- package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.js +21 -14
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts +1 -0
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts.map +1 -1
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +240 -105
- package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.d.ts.map +1 -1
- package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.js +19 -14
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +187 -77
- package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.d.ts.map +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.js +15 -12
- package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.d.ts.map +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.js +106 -67
- package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkGroupSelector.d.ts.map +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.d.ts.map +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js +15 -22
- package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts +19 -0
- package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts.map +1 -0
- package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.js +97 -0
- package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts +3 -0
- package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts.map +1 -0
- package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.js +220 -0
- package/lib/esm/components/ManageCaseLabels/index.d.ts +2 -0
- package/lib/esm/components/ManageCaseLabels/index.d.ts.map +1 -0
- package/lib/esm/components/ManageCaseLabels/index.js +1 -0
- package/lib/esm/components/ManageCaseLabels/types.d.ts +6 -0
- package/lib/esm/components/ManageCaseLabels/types.d.ts.map +1 -0
- package/lib/esm/components/ManageCaseLabels/types.js +1 -0
- package/lib/esm/components/ManageExpiredContents/ExpiredContentCategory.js +4 -4
- package/lib/esm/components/ManageExpiredContents/ExpiredContentHeader.js +1 -1
- package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.d.ts.map +1 -1
- package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.js +12 -12
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItem.js +3 -3
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.d.ts.map +1 -1
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.js +43 -35
- package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.js +8 -5
- package/lib/esm/components/ManagePartnerships/PartnershipsList.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/PartnershipsList.js +19 -12
- package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.js +17 -20
- package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.js +39 -27
- package/lib/esm/components/ManagePartnerships/Requests.d.ts +1 -0
- package/lib/esm/components/ManagePartnerships/Requests.d.ts.map +1 -1
- package/lib/esm/components/ManagePartnerships/Requests.js +22 -9
- package/lib/esm/components/ManagePartnerships/index.js +1 -1
- package/lib/esm/components/ManagePreferences/PreferencesBody.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/PreferencesBody.js +1 -5
- package/lib/esm/components/ManagePreferences/PreferencesHeader.js +1 -1
- package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts +1 -1
- package/lib/esm/components/ManagePreferences/components/PreferenceSelect.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/components/PreferenceSelect.js +26 -27
- package/lib/esm/components/ManagePreferences/components/PreferenceSwitch.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/components/PreferenceSwitch.js +6 -6
- package/lib/esm/components/ManagePreferences/sections/PreferencesACL.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +8 -9
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +77 -63
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseSearch.js +3 -4
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +47 -103
- package/lib/esm/components/ManageTable/ManageTable.d.ts +3 -4
- package/lib/esm/components/ManageTable/ManageTable.d.ts.map +1 -1
- package/lib/esm/components/ManageTable/ManageTable.js +12 -18
- package/lib/esm/components/ManageTags/TagsManager.d.ts.map +1 -1
- package/lib/esm/components/ManageTags/TagsManager.js +58 -50
- package/lib/esm/components/NotificationEmails/NotificationEmailsModal.d.ts.map +1 -1
- package/lib/esm/components/NotificationEmails/NotificationEmailsModal.js +35 -26
- package/lib/esm/components/NotificationEmails/index.d.ts.map +1 -1
- package/lib/esm/components/NotificationEmails/index.js +10 -7
- package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimit.js +2 -3
- package/lib/esm/components/TopContentManagement/CategoryLimit/CategoryLimitGuidelines.js +6 -6
- package/lib/esm/components/TopContentManagement/CategoryLimit/QuestionAnswer.js +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/ContentAccordion.js +7 -9
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts +1 -0
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricClickCount.js +2 -2
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetrics.js +12 -10
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts +2 -3
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/PerformanceMetricsSelect.js +16 -9
- package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/ContentUsage/VersionPerformanceMetrics.js +15 -16
- package/lib/esm/components/TopContentManagement/NoTopContentFound.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/NoTopContentFound.js +14 -15
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.js +47 -39
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategory.js +12 -6
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentCategoryNew.js +3 -3
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.js +11 -7
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +62 -53
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItemLink.js +2 -3
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +8 -9
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.js +2 -2
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHint.js +4 -5
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.js +51 -25
- package/lib/esm/components/TopContentManagement/TopContentHeader.js +1 -1
- package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.js +64 -32
- package/lib/esm/constants/GroupSelectActions.d.ts +2 -1
- package/lib/esm/constants/GroupSelectActions.d.ts.map +1 -1
- package/lib/esm/constants/GroupSelectActions.js +1 -0
- package/lib/esm/constants/PartnershipLink.d.ts +3 -0
- package/lib/esm/constants/PartnershipLink.d.ts.map +1 -0
- package/lib/esm/constants/PartnershipLink.js +2 -0
- package/lib/esm/context/ExpiredContentContextProvider.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseGroupGraphQL.d.ts +42 -0
- package/lib/esm/hooks/useCaseGroupGraphQL.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseGroupGraphQL.js +117 -0
- package/lib/esm/hooks/useCaseLabelGraphQL.d.ts +26 -0
- package/lib/esm/hooks/useCaseLabelGraphQL.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseLabelGraphQL.js +104 -0
- package/lib/esm/hooks/useCurrentUserContact.d.ts +8 -0
- package/lib/esm/hooks/useCurrentUserContact.d.ts.map +1 -0
- package/lib/esm/hooks/useCurrentUserContact.js +74 -0
- package/lib/esm/hooks/useVersionsDiffer.d.ts.map +1 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +2 -0
- package/lib/esm/reducers/ExpiredContentReducer.d.ts.map +1 -1
- package/lib/esm/reducers/ManagePartnershipsReducer.d.ts.map +1 -1
- package/lib/esm/reducers/TagManagmentReducer.d.ts +1 -1
- package/lib/esm/reducers/TagManagmentReducer.d.ts.map +1 -1
- package/lib/esm/reducers/TopContentHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/TopContentReducer.d.ts.map +1 -1
- package/lib/esm/reducers/TopContentReducer.js +5 -2
- package/lib/esm/scss/_main.scss +266 -24
- package/lib/esm/scss/_pf-overrides.scss +66 -53
- package/lib/esm/scss/index.scss +5 -4
- package/lib/esm/utils/caseGroupMapper.d.ts +18 -0
- package/lib/esm/utils/caseGroupMapper.d.ts.map +1 -0
- package/lib/esm/utils/caseGroupMapper.js +50 -0
- package/package.json +21 -22
package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js
CHANGED
|
@@ -152,11 +152,9 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
|
|
|
152
152
|
catchOnCancel: true,
|
|
153
153
|
confirmText: t('Yes, I am sure'),
|
|
154
154
|
confirmButtonVariant: ButtonVariant.danger,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
React.createElement("p", null,
|
|
159
|
-
React.createElement(Trans, null, "You are choosing to remove this account from the selected bookmark.")))),
|
|
155
|
+
title: t('Are you sure?'),
|
|
156
|
+
description: (React.createElement("p", null,
|
|
157
|
+
React.createElement(Trans, null, "You are choosing to remove this account from the selected bookmark."))),
|
|
160
158
|
});
|
|
161
159
|
yield apiCalls.removeAccountApiCalls(account);
|
|
162
160
|
removeGroupedBookmarks(dispatchGlobalContext, bookmarkedGroupAccounts.data, [account.bookmarkId]);
|
|
@@ -178,13 +176,11 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
|
|
|
178
176
|
try {
|
|
179
177
|
yield confirmation({
|
|
180
178
|
catchOnCancel: true,
|
|
181
|
-
confirmButtonVariant: ButtonVariant.danger,
|
|
182
179
|
confirmText: t('Yes, I am sure'),
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
React.createElement(
|
|
187
|
-
React.createElement(Trans, null, "Removing this bookmark will permanently delete it from your records.")))),
|
|
180
|
+
confirmButtonVariant: ButtonVariant.danger,
|
|
181
|
+
title: t('Are you sure?'),
|
|
182
|
+
description: (React.createElement("p", null,
|
|
183
|
+
React.createElement(Trans, null, "Removing this bookmark will permanently delete it from your records."))),
|
|
188
184
|
});
|
|
189
185
|
const rootBookmarIds = uniq(allGroups[group].map((account) => account.rootBookmarkId));
|
|
190
186
|
const promiseArry = rootBookmarIds.map((id) => __awaiter(this, void 0, void 0, function* () { return yield apiCalls.removeGroupAccount(id); }));
|
|
@@ -221,7 +217,7 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
|
|
|
221
217
|
title: t('Accounts'),
|
|
222
218
|
sortable: false,
|
|
223
219
|
cellWidth: 70,
|
|
224
|
-
cell: (group) => (React.createElement(LabelGroup, null, allGroups[group].map((account) => (React.createElement(Label, { color: "
|
|
220
|
+
cell: (group) => (React.createElement(LabelGroup, null, allGroups[group].map((account) => (React.createElement(Label, { color: "teal", onClose: removeBookmarkedAccount(account), key: account.bookmarkId + account.bookmarkGroupName },
|
|
225
221
|
account.name,
|
|
226
222
|
"(",
|
|
227
223
|
account.accountNumber,
|
|
@@ -234,11 +230,9 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
|
|
|
234
230
|
cellWidth: 10,
|
|
235
231
|
cell: (group) => (React.createElement(ActionList, { isIconList: true },
|
|
236
232
|
React.createElement(ActionListItem, null,
|
|
237
|
-
React.createElement(Button, { "aria-label": "edit", variant: "plain", onClick: () => onOpenEditGroupOpenModal(group) },
|
|
238
|
-
React.createElement(PencilAltIcon, null))),
|
|
233
|
+
React.createElement(Button, { icon: React.createElement(PencilAltIcon, null), "aria-label": "edit", variant: "plain", onClick: () => onOpenEditGroupOpenModal(group) })),
|
|
239
234
|
React.createElement(ActionListItem, null,
|
|
240
|
-
React.createElement(Button, { "aria-label": "delete", variant: "plain", onClick: () => removeGroup(group) },
|
|
241
|
-
React.createElement(TrashIcon, null))))),
|
|
235
|
+
React.createElement(Button, { icon: React.createElement(TrashIcon, null), "aria-label": "delete", variant: "plain", onClick: () => removeGroup(group) })))),
|
|
242
236
|
},
|
|
243
237
|
];
|
|
244
238
|
const isValid = () => {
|
|
@@ -258,22 +252,21 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
|
|
|
258
252
|
React.createElement("a", { href: "https://source.redhat.com/communitiesatredhat/applications/integration-community-of-practice/misplaced/lostnfound/bookmarking", target: "_blank", rel: "noopener noreferrer" },
|
|
259
253
|
' ',
|
|
260
254
|
"bookmarks in the customer support tool"))), closeBtnAriaLabel: "Close" },
|
|
261
|
-
React.createElement(Button, {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
React.createElement("div", { className: "toolbar" },
|
|
255
|
+
React.createElement(Button, { icon: React.createElement(Icon, { size: "md" },
|
|
256
|
+
React.createElement(InfoCircleIcon, { color: "#5e40be" })), variant: "plain", className: "manage-bookmark-info-icon-button", "aria-label": "Cluster Id Info" }))))),
|
|
257
|
+
React.createElement("div", { className: "toolbar pf-v6-u-justify-content-space-between" },
|
|
265
258
|
React.createElement("form", { onSubmit: (event) => event.preventDefault(), className: "toolbar-left" },
|
|
266
259
|
React.createElement("label", { htmlFor: "bookmark-account-selector" },
|
|
267
260
|
React.createElement(Trans, null, "Search accounts")),
|
|
268
261
|
React.createElement("span", { className: "bookmark-account" },
|
|
269
262
|
React.createElement(BookmarkAccountSelector, { clearRef: clearRef, labelId: "bookmark-account-selector", isDisabled: !loggedInUserRights.data.isInternal() || !canBookmarkAccounts, bookmarkedGroupAccounts: bookmarkedGroupAccounts.data, onBookMarkAccountSelected: onBookMarkAccountSelected, addMode: true, isInValid: false })),
|
|
270
|
-
React.createElement("span", { className: "pf-
|
|
263
|
+
React.createElement("span", { className: "pf-v6-u-ml-sm" },
|
|
271
264
|
React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: onOpenAddBookmarkModal, "data-tracking-id": "bookmark-add-button", isDisabled: isValid() || apiCalls.isAddingBookmark },
|
|
272
265
|
React.createElement(Trans, null, "Add bookmark")))),
|
|
273
266
|
React.createElement("div", { className: "toolbar-right" },
|
|
274
267
|
React.createElement("label", { htmlFor: "search-bookmark-account-selector" },
|
|
275
268
|
React.createElement(Trans, null, "Filter by")),
|
|
276
|
-
React.createElement(SearchInput, { className: "pf-
|
|
269
|
+
React.createElement(SearchInput, { className: "pf-v6-u-flex-grow-1 pf-v6-c-search-input pf-v6-u-background-color-100", value: searchString, id: "search-bookmark-account-selector", placeholder: t('Search for a bookmark'), "aria-label": t('Filter by searching for a bookmark'), onChange: (_, val) => setSearchString(val), onClear: () => setSearchString('') }))),
|
|
277
270
|
React.createElement(AddEditBookmarkModal, { selectedAccounts: isInAddMode ? localSelectedAccounts : editGroupSelectedAccounts, groups: groups, isOpen: isUpdateBookmarkModalOpen, onSave: onAddEditBookmarksSave, onClose: closeAddEditBookmarkModal, onRemove: removeGroup, bookmarkedGroupAccounts: bookmarkedGroupAccounts.data, addMode: isInAddMode, title: isInAddMode ? t('Add a bookmark') : t('Edit bookmark') }),
|
|
278
271
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading bookmarked accounts list') } },
|
|
279
272
|
React.createElement(ManageTable, { ariaLabel: t('Table to manage bookmarks'), columns: columns, data: groupNames, sortInfo: { column: 'bookmark-group-name', direction: 'asc' }, errorVariant: AlertVariant.warning, isFetching: bookmarkedGroupAccounts.isFetching ||
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICaseLabel } from './types';
|
|
3
|
+
export type SaveCaseLabelResult = {
|
|
4
|
+
success: boolean;
|
|
5
|
+
fieldError?: string;
|
|
6
|
+
};
|
|
7
|
+
interface IProps {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
addMode: boolean;
|
|
10
|
+
label?: ICaseLabel | null;
|
|
11
|
+
isSaving?: boolean;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onSave: (name: string, options?: {
|
|
14
|
+
keepOpen?: boolean;
|
|
15
|
+
}) => Promise<SaveCaseLabelResult> | SaveCaseLabelResult;
|
|
16
|
+
}
|
|
17
|
+
export declare function AddEditCaseLabelModal({ isOpen, addMode, label, isSaving, onClose, onSave }: IProps): React.JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=AddEditCaseLabelModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddEditCaseLabelModal.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageCaseLabels/AddEditCaseLabelModal.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,UAAU,MAAM;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;CAClH;AAED,wBAAgB,qBAAqB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,qBAkJ1G"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Button, ButtonVariant, Flex, FlexItem, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, TextInput, } from '@patternfly/react-core';
|
|
11
|
+
import { CASE_LABEL_NAME_MAX_LENGTH } from '@rh-support/utils';
|
|
12
|
+
import isEmpty from 'lodash/isEmpty';
|
|
13
|
+
import React, { useEffect, useState } from 'react';
|
|
14
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
15
|
+
export function AddEditCaseLabelModal({ isOpen, addMode, label, isSaving = false, onClose, onSave }) {
|
|
16
|
+
const { t } = useTranslation();
|
|
17
|
+
const [name, setName] = useState('');
|
|
18
|
+
const [error, setError] = useState('');
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (isOpen) {
|
|
21
|
+
setName(addMode ? '' : (label === null || label === void 0 ? void 0 : label.name) || '');
|
|
22
|
+
setError('');
|
|
23
|
+
}
|
|
24
|
+
}, [isOpen, addMode, label]);
|
|
25
|
+
const isOverMaxLength = name.length > CASE_LABEL_NAME_MAX_LENGTH;
|
|
26
|
+
const isNameEmpty = isEmpty(name.trim());
|
|
27
|
+
const canSave = !isNameEmpty && !isOverMaxLength && !isSaving;
|
|
28
|
+
const resetForm = () => {
|
|
29
|
+
setName('');
|
|
30
|
+
setError('');
|
|
31
|
+
};
|
|
32
|
+
const handleSave = () => __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
if (isNameEmpty) {
|
|
34
|
+
setError(t('Case label name cannot be empty.'));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (isOverMaxLength) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const result = yield onSave(name.trim(), { keepOpen: false });
|
|
41
|
+
if (!result.success && result.fieldError) {
|
|
42
|
+
setError(result.fieldError);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const handleSaveAndNew = () => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
if (isNameEmpty) {
|
|
47
|
+
setError(t('Case label name cannot be empty.'));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (isOverMaxLength) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const result = yield onSave(name.trim(), { keepOpen: true });
|
|
54
|
+
if (result.success) {
|
|
55
|
+
resetForm();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (result.fieldError) {
|
|
59
|
+
setError(result.fieldError);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const handleClose = () => {
|
|
63
|
+
resetForm();
|
|
64
|
+
onClose();
|
|
65
|
+
};
|
|
66
|
+
return (React.createElement(Modal, { id: "add-edit-case-label-modal", "aria-describedby": "add-edit-case-label-modal", isOpen: isOpen, onClose: handleClose, variant: ModalVariant.small },
|
|
67
|
+
React.createElement(ModalHeader, null,
|
|
68
|
+
React.createElement("h2", null, addMode ? t('Create new case label') : t('Rename case label'))),
|
|
69
|
+
React.createElement(ModalBody, null,
|
|
70
|
+
React.createElement(FormGroup, { label: t('Case label name'), isRequired: true },
|
|
71
|
+
React.createElement(TextInput, { isRequired: true, type: "text", id: "case-label-name-input", value: name, onChange: (_, value) => {
|
|
72
|
+
setName(value);
|
|
73
|
+
if (!isEmpty(error)) {
|
|
74
|
+
setError('');
|
|
75
|
+
}
|
|
76
|
+
}, placeholder: t('Enter a unique case label name'), validated: isOverMaxLength || !isEmpty(error) ? 'error' : 'default', isDisabled: isSaving }),
|
|
77
|
+
React.createElement(FormHelperText, null,
|
|
78
|
+
React.createElement(Flex, { justifyContent: { default: 'justifyContentFlexEnd' } },
|
|
79
|
+
React.createElement(FlexItem, null,
|
|
80
|
+
React.createElement(HelperText, null,
|
|
81
|
+
React.createElement(HelperTextItem, { variant: "default", className: `pf-v6-u-font-size-sm ${isOverMaxLength
|
|
82
|
+
? 'pf-v6-u-text-color-status-danger'
|
|
83
|
+
: 'pf-v6-u-text-color-subtle'}` }, t('{{count}}/{{max}} characters', {
|
|
84
|
+
count: name.length,
|
|
85
|
+
max: CASE_LABEL_NAME_MAX_LENGTH,
|
|
86
|
+
})))))),
|
|
87
|
+
!isEmpty(error) && (React.createElement(FormHelperText, null,
|
|
88
|
+
React.createElement(HelperText, null,
|
|
89
|
+
React.createElement(HelperTextItem, { variant: "error" }, error)))))),
|
|
90
|
+
React.createElement(ModalFooter, null,
|
|
91
|
+
React.createElement(Button, { key: "save", variant: ButtonVariant.primary, onClick: handleSave, isDisabled: !canSave, isLoading: isSaving },
|
|
92
|
+
React.createElement(Trans, null, "Save")),
|
|
93
|
+
addMode && (React.createElement(Button, { key: "save-and-new", variant: ButtonVariant.secondary, onClick: handleSaveAndNew, isDisabled: !canSave, isLoading: isSaving },
|
|
94
|
+
React.createElement(Trans, null, "Save & New"))),
|
|
95
|
+
React.createElement(Button, { key: "cancel", variant: ButtonVariant.link, onClick: handleClose, isDisabled: isSaving },
|
|
96
|
+
React.createElement(Trans, null, "Cancel")))));
|
|
97
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManageCaseLabelsTab.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageCaseLabels/ManageCaseLabelsTab.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAoC5D,wBAAgB,mBAAmB,sBAwUlC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { ActionList, ActionListItem, AlertVariant, Button, ButtonVariant, EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateVariant, ModalVariant, SearchInput, } from '@patternfly/react-core';
|
|
11
|
+
import CubesIcon from '@patternfly/react-icons/dist/js/icons/cubes-icon';
|
|
12
|
+
import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
|
|
13
|
+
import TrashIcon from '@patternfly/react-icons/dist/js/icons/trash-icon';
|
|
14
|
+
import { ErrorBoundary, ToastNotification, useConfirmation } from '@rh-support/components';
|
|
15
|
+
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
16
|
+
import { getStringifiedParams } from '@rh-support/utils';
|
|
17
|
+
import isEmpty from 'lodash/isEmpty';
|
|
18
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
19
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
20
|
+
import { useHistory } from 'react-router-dom';
|
|
21
|
+
import { useCaseLabels, useCreateCaseLabel, useDeleteCaseLabel, useUpdateCaseLabel, } from '../../hooks/useCaseLabelGraphQL';
|
|
22
|
+
import { ManageTable } from '../ManageTable';
|
|
23
|
+
import { AddEditCaseLabelModal } from './AddEditCaseLabelModal';
|
|
24
|
+
const isDuplicateCaseLabelGraphQLError = (error) => {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
26
|
+
if (!error || typeof error !== 'object') {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const apolloError = error;
|
|
30
|
+
const messages = [
|
|
31
|
+
...((_b = (_a = apolloError.graphQLErrors) === null || _a === void 0 ? void 0 : _a.map((graphQLError) => graphQLError.message || '')) !== null && _b !== void 0 ? _b : []),
|
|
32
|
+
...((_d = (_c = apolloError.errors) === null || _c === void 0 ? void 0 : _c.map((graphQLError) => graphQLError.message || '')) !== null && _d !== void 0 ? _d : []),
|
|
33
|
+
apolloError.message || '',
|
|
34
|
+
]
|
|
35
|
+
.join(' ')
|
|
36
|
+
.toLowerCase();
|
|
37
|
+
return messages.includes('duplicate value found');
|
|
38
|
+
};
|
|
39
|
+
export function ManageCaseLabelsTab() {
|
|
40
|
+
var _a;
|
|
41
|
+
const { t } = useTranslation();
|
|
42
|
+
const history = useHistory();
|
|
43
|
+
const confirmation = useConfirmation();
|
|
44
|
+
const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights }, } = useGlobalStateContext();
|
|
45
|
+
const accountId = (_a = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.salesforceAccountId;
|
|
46
|
+
const canManageCaseLabels = loggedInUserRights.data.isOrgAdmin();
|
|
47
|
+
const { labels: fetchedLabels, loading: isFetchingLabels, error: labelsError, refetch } = useCaseLabels(accountId);
|
|
48
|
+
const { createCaseLabel, loading: isCreatingLabel } = useCreateCaseLabel();
|
|
49
|
+
const { updateCaseLabel, loading: isUpdatingLabel } = useUpdateCaseLabel();
|
|
50
|
+
const { deleteCaseLabel } = useDeleteCaseLabel();
|
|
51
|
+
const [labels, setLabels] = useState([]);
|
|
52
|
+
const [searchString, setSearchString] = useState('');
|
|
53
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
54
|
+
const [isInAddMode, setIsInAddMode] = useState(true);
|
|
55
|
+
const [selectedLabel, setSelectedLabel] = useState(null);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
setLabels(fetchedLabels);
|
|
58
|
+
}, [fetchedLabels]);
|
|
59
|
+
const filteredLabels = useMemo(() => {
|
|
60
|
+
if (isEmpty(searchString)) {
|
|
61
|
+
return labels;
|
|
62
|
+
}
|
|
63
|
+
return labels.filter((label) => label.name.toLowerCase().includes(searchString.toLowerCase()));
|
|
64
|
+
}, [labels, searchString]);
|
|
65
|
+
const hasNoLabels = !isFetchingLabels && !labelsError && labels.length === 0;
|
|
66
|
+
const onOpenAddModal = () => {
|
|
67
|
+
setIsInAddMode(true);
|
|
68
|
+
setSelectedLabel(null);
|
|
69
|
+
setIsModalOpen(true);
|
|
70
|
+
};
|
|
71
|
+
const onOpenEditModal = (label) => {
|
|
72
|
+
setIsInAddMode(false);
|
|
73
|
+
setSelectedLabel(label);
|
|
74
|
+
setIsModalOpen(true);
|
|
75
|
+
};
|
|
76
|
+
const closeModal = () => {
|
|
77
|
+
setIsModalOpen(false);
|
|
78
|
+
setSelectedLabel(null);
|
|
79
|
+
setIsInAddMode(true);
|
|
80
|
+
};
|
|
81
|
+
const onSaveLabel = (name, options) => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
if (isInAddMode) {
|
|
83
|
+
if (!accountId) {
|
|
84
|
+
ToastNotification.addDangerMessage(t('Unable to create case label. Account information is missing.'));
|
|
85
|
+
return { success: false };
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
yield createCaseLabel(name, accountId);
|
|
89
|
+
yield refetch();
|
|
90
|
+
ToastNotification.addSuccessMessage(t('Case label has been successfully created.'));
|
|
91
|
+
if (!(options === null || options === void 0 ? void 0 : options.keepOpen)) {
|
|
92
|
+
closeModal();
|
|
93
|
+
}
|
|
94
|
+
return { success: true };
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
if (isDuplicateCaseLabelGraphQLError(error)) {
|
|
98
|
+
return {
|
|
99
|
+
success: false,
|
|
100
|
+
fieldError: t('Label name already in use. Try a different name.'),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
ToastNotification.addDangerMessage(t('Case label failed to create.'));
|
|
104
|
+
return { success: false };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (selectedLabel) {
|
|
108
|
+
try {
|
|
109
|
+
yield updateCaseLabel(selectedLabel.id, name);
|
|
110
|
+
yield refetch();
|
|
111
|
+
ToastNotification.addSuccessMessage(t('Case label has been successfully updated.'));
|
|
112
|
+
closeModal();
|
|
113
|
+
return { success: true };
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
if (isDuplicateCaseLabelGraphQLError(error)) {
|
|
117
|
+
return {
|
|
118
|
+
success: false,
|
|
119
|
+
fieldError: t('Label name already in use. Try a different name.'),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
ToastNotification.addDangerMessage(t('Case label failed to update.'));
|
|
123
|
+
return { success: false };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return { success: false };
|
|
127
|
+
});
|
|
128
|
+
const onDeleteLabel = (label) => __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
try {
|
|
130
|
+
yield confirmation({
|
|
131
|
+
catchOnCancel: true,
|
|
132
|
+
confirmText: t('Delete label'),
|
|
133
|
+
confirmButtonVariant: ButtonVariant.danger,
|
|
134
|
+
cancelText: t('Cancel'),
|
|
135
|
+
modalVariant: ModalVariant.large,
|
|
136
|
+
title: t('Delete case label'),
|
|
137
|
+
description: (React.createElement("div", { className: "case-label-delete-description", style: { display: 'flex', flexDirection: 'column', gap: '1.5rem' } },
|
|
138
|
+
React.createElement("div", null, t('Are you sure you want to delete "{{name}}" case label?', { name: label.name })),
|
|
139
|
+
React.createElement("div", { style: { whiteSpace: 'nowrap' } },
|
|
140
|
+
t('This label is currently assigned to'),
|
|
141
|
+
' ',
|
|
142
|
+
React.createElement("strong", null, t('{{count}} cases', { count: label.assignedCaseCount })),
|
|
143
|
+
'. ',
|
|
144
|
+
t('Deleting it will remove the label from all associated cases.')))),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
catch (_a) {
|
|
148
|
+
// user cancelled
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
yield deleteCaseLabel(label.id);
|
|
153
|
+
yield refetch();
|
|
154
|
+
ToastNotification.addSuccessMessage(t('Case label has been successfully removed.'));
|
|
155
|
+
}
|
|
156
|
+
catch (_b) {
|
|
157
|
+
ToastNotification.addDangerMessage(t('Case label failed to remove.'));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const onViewAssignedCases = (label) => {
|
|
161
|
+
// Match Case List URL format (SolrQueryBuilder): caseLabel: ("<id>") orderBy lastModifiedDate desc
|
|
162
|
+
const query = `caseLabel: ("${label.id}") orderBy lastModifiedDate desc`;
|
|
163
|
+
history.push({
|
|
164
|
+
pathname: '/case/list',
|
|
165
|
+
search: getStringifiedParams({
|
|
166
|
+
query: encodeURIComponent(query),
|
|
167
|
+
searchType: 'basic',
|
|
168
|
+
}),
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
const columns = [
|
|
172
|
+
{
|
|
173
|
+
accessor: (label) => label.name,
|
|
174
|
+
sortable: false,
|
|
175
|
+
id: 'case-label-row',
|
|
176
|
+
title: '',
|
|
177
|
+
cellWidth: 100,
|
|
178
|
+
cell: (label) => (React.createElement("div", { className: "case-label-row" },
|
|
179
|
+
React.createElement("div", { className: "case-label-row__info" },
|
|
180
|
+
React.createElement("div", { className: "pf-v6-u-font-weight-bold" }, label.name),
|
|
181
|
+
React.createElement("div", { className: "pf-v6-u-color-200 pf-v6-u-font-size-sm" }, t('{{count}} cases assigned', { count: label.assignedCaseCount }))),
|
|
182
|
+
React.createElement("div", { className: "case-label-row__actions" },
|
|
183
|
+
label.assignedCaseCount > 0 && (React.createElement(Button, { variant: ButtonVariant.link, isInline: true, onClick: () => onViewAssignedCases(label), "data-tracking-id": "case-label-view-assigned-cases" },
|
|
184
|
+
React.createElement(Trans, null, "View assigned cases"))),
|
|
185
|
+
canManageCaseLabels && (React.createElement(ActionList, { isIconList: true },
|
|
186
|
+
React.createElement(ActionListItem, null,
|
|
187
|
+
React.createElement(Button, { icon: React.createElement(PencilAltIcon, null), "aria-label": t('Edit case label {{name}}', { name: label.name }), variant: "plain", onClick: () => onOpenEditModal(label), "data-tracking-id": "case-label-edit" })),
|
|
188
|
+
React.createElement(ActionListItem, null,
|
|
189
|
+
React.createElement(Button, { icon: React.createElement(TrashIcon, null), "aria-label": t('Delete case label {{name}}', { name: label.name }), variant: "plain", onClick: () => onDeleteLabel(label), "data-tracking-id": "case-label-delete" }))))))),
|
|
190
|
+
},
|
|
191
|
+
];
|
|
192
|
+
return (React.createElement(React.Fragment, null,
|
|
193
|
+
React.createElement("header", null,
|
|
194
|
+
React.createElement("h2", null, t('Case labels')),
|
|
195
|
+
React.createElement("p", null,
|
|
196
|
+
React.createElement(Trans, null, "Case labels help you organize and categorize cases with custom tags, making them easier to find, filter, and manage."))),
|
|
197
|
+
React.createElement("div", { className: "toolbar case-labels-toolbar" },
|
|
198
|
+
React.createElement("div", { className: "toolbar-left" },
|
|
199
|
+
hasNoLabels ? (React.createElement("span", null,
|
|
200
|
+
React.createElement(Trans, null, "Case labels"))) : (React.createElement("label", { htmlFor: "search-case-label-input" },
|
|
201
|
+
React.createElement(Trans, null, "Case labels"))),
|
|
202
|
+
!hasNoLabels && (React.createElement(React.Fragment, null,
|
|
203
|
+
React.createElement(SearchInput, { className: "pf-v6-u-flex-grow-1 pf-v6-c-search-input pf-v6-u-background-color-100", value: searchString, id: "search-case-label-input", placeholder: t('Search case label by name.'), "aria-label": t('Search case label by name'), onChange: (_, val) => setSearchString(val), onClear: () => setSearchString('') }),
|
|
204
|
+
canManageCaseLabels && (React.createElement("span", { className: "pf-v6-u-ml-sm" },
|
|
205
|
+
React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: onOpenAddModal, "data-tracking-id": "case-label-add-button" },
|
|
206
|
+
React.createElement(Trans, null, "Add"))))))),
|
|
207
|
+
!hasNoLabels && (React.createElement("div", { className: "toolbar-right case-labels-toolbar__loaded pf-v6-u-color-200" }, t('{{loaded}} of {{total}} loaded.', {
|
|
208
|
+
loaded: filteredLabels.length,
|
|
209
|
+
total: filteredLabels.length,
|
|
210
|
+
})))),
|
|
211
|
+
React.createElement(AddEditCaseLabelModal, { isOpen: isModalOpen, addMode: isInAddMode, label: selectedLabel, isSaving: isCreatingLabel || isUpdatingLabel, onClose: closeModal, onSave: onSaveLabel }),
|
|
212
|
+
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading case labels list') } }, hasNoLabels ? (React.createElement("div", { className: "table-wrapper case-labels-empty-state" },
|
|
213
|
+
React.createElement(EmptyState, { headingLevel: "h2", icon: CubesIcon, titleText: canManageCaseLabels ? t('Create your first case label') : t('No case labels available'), variant: EmptyStateVariant.lg },
|
|
214
|
+
React.createElement(EmptyStateBody, null, canManageCaseLabels ? (React.createElement(Trans, null, "Case labels help you organize and categorize cases with custom tags, making them easier to find, filter, and manage.")) : (React.createElement(Trans, null, "Your organization admin hasn't created any labels yet. Contact them to add labels for organizing and categorizing cases."))),
|
|
215
|
+
canManageCaseLabels && (React.createElement(EmptyStateFooter, null,
|
|
216
|
+
React.createElement(Button, { variant: ButtonVariant.link, onClick: onOpenAddModal, "data-tracking-id": "case-label-empty-create-button" },
|
|
217
|
+
React.createElement(Trans, null, "Create label"))))))) : (React.createElement(ManageTable, { ariaLabel: t('Table to manage case labels'), columns: columns, data: filteredLabels, errorVariant: AlertVariant.warning, isFetching: isFetchingLabels, isError: !!labelsError, errorTitle: t('Case labels error'), errorComponent: React.createElement(Trans, null, "Could not get case labels"), noResultText: canManageCaseLabels
|
|
218
|
+
? t('There are no results to display. Try adding a case label or refining your search')
|
|
219
|
+
: t('There are no results to display. Try refining your search') })))));
|
|
220
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageCaseLabels/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ManageCaseLabelsTab';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageCaseLabels/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -23,9 +23,9 @@ export default function ExpiredContentCategory({ category, isCategoryExpanded =
|
|
|
23
23
|
? category.content.filter((item) => !hasDateExpired(item.expiryDate))
|
|
24
24
|
: category.content;
|
|
25
25
|
const sortedExpiredContents = orderBy(expiredContents, ['expiryDate'], ['desc']);
|
|
26
|
-
return !isEmpty(sortedExpiredContents) ? (React.createElement(AccordionItem,
|
|
27
|
-
React.createElement(AccordionToggle, { id: category.categoryName, onClick: toggleExpanded
|
|
26
|
+
return !isEmpty(sortedExpiredContents) ? (React.createElement(AccordionItem, { isExpanded: isExpanded },
|
|
27
|
+
React.createElement(AccordionToggle, { id: category.categoryName, onClick: toggleExpanded },
|
|
28
28
|
React.createElement("h3", null, category.categoryName)),
|
|
29
|
-
React.createElement(AccordionContent,
|
|
30
|
-
React.createElement("ul", { className: "list-flat
|
|
29
|
+
React.createElement(AccordionContent, null,
|
|
30
|
+
React.createElement("ul", { className: "list-flat" }, sortedExpiredContents.map((content, i) => (React.createElement(ExpiredContentSingleItem, { key: content.topContentId, content: content, category: category }))))))) : (React.createElement(React.Fragment, null));
|
|
31
31
|
}
|
|
@@ -4,6 +4,6 @@ export default function ExpiredContentHeader() {
|
|
|
4
4
|
return (React.createElement("header", null,
|
|
5
5
|
React.createElement("h2", null,
|
|
6
6
|
React.createElement(Trans, null, "Expired Content")),
|
|
7
|
-
React.createElement("p", { className: "pf-
|
|
7
|
+
React.createElement("p", { className: "pf-v6-u-mt-md pf-v6-u-mb-sm" },
|
|
8
8
|
React.createElement(Trans, null))));
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpiredContentManager.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentManager.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpiredContentManager.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentManager.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAUhF,MAAM,CAAC,OAAO,UAAU,qBAAqB,sBAsH5C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accordion, Bullseye, EmptyState, EmptyStateBody,
|
|
1
|
+
import { Accordion, Bullseye, EmptyState, EmptyStateBody, EmptyStateVariant, Spinner, Switch, } from '@patternfly/react-core';
|
|
2
2
|
import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
|
|
3
3
|
import { TagsSelector, TopContentSearch } from '@rh-support/components';
|
|
4
4
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -52,17 +52,17 @@ export default function ExipredContentManager() {
|
|
|
52
52
|
return (React.createElement(React.Fragment, null,
|
|
53
53
|
React.createElement(ExpiredContentHeader, null),
|
|
54
54
|
React.createElement("div", { className: "toolbar" },
|
|
55
|
-
React.createElement(
|
|
56
|
-
|
|
57
|
-
React.createElement("
|
|
58
|
-
|
|
59
|
-
React.createElement(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
React.createElement("div", { className: "toolbar-content" },
|
|
56
|
+
React.createElement(TopContentSearch, { className: "pf-v6-u-display-flex pf-v6-u-flex-direction-row pf-v6-u-flex-fill pf-v6-u-align-items-center", dataTrackingId: "expired-content-filter-manage", topContentData: expiredContentEditState, onSearch: onSearch, topContentResultsWrapperRef: expiredContentResultsRef, isDisabled: expiredContentResponse.isFetching, searchQuery: searchQuery, setSearchQuery: setSearchQuery }),
|
|
57
|
+
React.createElement(Switch, { id: "content-approaching-expiry", className: "pf-v6-u-mt-sm", label: t('Show approaching expiry'), isChecked: showApprochingExpiry, onChange: handleChange })),
|
|
58
|
+
React.createElement("div", { className: "toolbar-content" },
|
|
59
|
+
React.createElement("div", { className: "pf-v6-u-display-flex pf-v6-u-flex-direction-row pf-v6-u-align-items-center pf-v6-u-justify-content-flex-end" },
|
|
60
|
+
React.createElement("label", { htmlFor: 'tag-selector' },
|
|
61
|
+
React.createElement(Trans, null, "All tags")),
|
|
62
|
+
React.createElement(TagsSelector, { typeahead: true, tagOptions: availableTags, onChange: onTagFilterChange, selectedTags: filteredTags, disabled: expiredContentResponse.isFetching })))),
|
|
63
|
+
React.createElement("div", { className: "expired-content-manage-wrapper pf-v6-u-p-md", ref: expiredContentResultsRef }, expiredContentResponse.isFetching ? (React.createElement(Bullseye, null,
|
|
63
64
|
React.createElement(EmptyState, { variant: EmptyStateVariant.full },
|
|
64
|
-
React.createElement(Spinner, { size: "lg" })))) : isEmpty(filteredEC) ? (React.createElement(EmptyState, { variant: EmptyStateVariant.
|
|
65
|
-
React.createElement(EmptyStateHeader, { titleText: React.createElement(Trans, null, "No contents found"), icon: React.createElement(EmptyStateIcon, { icon: SearchIcon }) }),
|
|
65
|
+
React.createElement(Spinner, { size: "lg" })))) : isEmpty(filteredEC) ? (React.createElement(EmptyState, { icon: SearchIcon, titleText: React.createElement(Trans, null, "No contents found"), variant: EmptyStateVariant.full },
|
|
66
66
|
React.createElement(EmptyStateBody, null,
|
|
67
|
-
React.createElement(Trans, null, "There are no contents to display")))) : (React.createElement(Accordion,
|
|
67
|
+
React.createElement(Trans, null, "There are no contents to display")))) : (React.createElement(Accordion, { togglePosition: "start" }, filteredEC.map((category, i) => (React.createElement(ExpiredContentCategory, { key: category.id, category: category, isCategoryExpanded: !isEmpty(searchQuery) || !isEmpty(filteredTags) }))))))));
|
|
68
68
|
}
|
|
@@ -63,16 +63,16 @@ export default function ExpiredContentSingleItem({ content, category }) {
|
|
|
63
63
|
expired: formatDate(content.expiryDate),
|
|
64
64
|
});
|
|
65
65
|
return (React.createElement(React.Fragment, null, isPreview ? (React.createElement("li", { className: `push-bottom-narrow` },
|
|
66
|
-
React.createElement("a", { className:
|
|
66
|
+
React.createElement("a", { className: "pcm-manage-top-content pf-v6-u-mr-sm", "data-tracking-id": "pcm-manage-top-content", href: content.contentUrl, target: "_blank", rel: "noopener noreferrer" }, content.contentTitle),
|
|
67
67
|
React.createElement(Button, { variant: "link", isInline: true, icon: React.createElement(EditAltIcon, null), onClick: editToggle, title: 'Edit', "data-tracking-id": "edit-expired-top-content" }),
|
|
68
68
|
React.createElement("div", null,
|
|
69
69
|
lastModifiedBy,
|
|
70
70
|
" | ",
|
|
71
|
-
React.createElement("span", { className: "pf-
|
|
71
|
+
React.createElement("span", { className: "pf-v6-u-text-color-status-danger" }, expiredText),
|
|
72
72
|
" |",
|
|
73
73
|
' ',
|
|
74
74
|
content.product,
|
|
75
75
|
" ", (_a = content.majorVersion) !== null && _a !== void 0 ? _a : '',
|
|
76
76
|
content.minorVersion ? `.${content.minorVersion}` : ''),
|
|
77
|
-
React.createElement("div", null, (_b = content.tags) === null || _b === void 0 ? void 0 : _b.map((tag) => (React.createElement(Label, { isCompact: true, className: "pf-
|
|
77
|
+
React.createElement("div", null, (_b = content.tags) === null || _b === void 0 ? void 0 : _b.map((tag) => (React.createElement(Label, { isCompact: true, className: "pf-v6-u-mr-xs pf-v6-u-mt-sm", key: tag.id, color: filteredTags.some((t) => t.id === tag.id) ? 'yellow' : 'grey' }, tag.tagName)))))) : (React.createElement(ExpiredContentSingleItemView, { category: category, content: content, onCancel: editToggle, onSave: onSave, onDelete: onDelete, isDeleting: isDeleting, isSaving: isSaving }))));
|
|
78
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpiredContentSingleItemView.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentSingleItemView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpiredContentSingleItemView.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentSingleItemView.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAIrE,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAIjG,UAAU,MAAM;IACZ,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,wBAAwB,CAAC;IACnC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACjD,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,UAAU,GACb,EAAE,MAAM,qBAwOR"}
|