@rh-support/manage 2.1.83 → 2.1.85

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 (35) hide show
  1. package/lib/esm/ManageTabs.d.ts.map +1 -1
  2. package/lib/esm/ManageTabs.js +11 -1
  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/ManageTags/TagsManagement.d.ts +3 -0
  7. package/lib/esm/components/ManageTags/TagsManagement.d.ts.map +1 -0
  8. package/lib/esm/components/ManageTags/TagsManagement.js +11 -0
  9. package/lib/esm/components/ManageTags/TagsManager.d.ts +3 -0
  10. package/lib/esm/components/ManageTags/TagsManager.d.ts.map +1 -0
  11. package/lib/esm/components/ManageTags/TagsManager.js +240 -0
  12. package/lib/esm/components/ManageTags/index.d.ts +2 -0
  13. package/lib/esm/components/ManageTags/index.d.ts.map +1 -0
  14. package/lib/esm/components/ManageTags/index.js +1 -0
  15. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.d.ts.map +1 -1
  16. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.js +1 -1
  17. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.d.ts +2 -1
  18. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.d.ts.map +1 -1
  19. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +43 -11
  20. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.d.ts.map +1 -1
  21. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +37 -8
  22. package/lib/esm/components/TopContentManagement/TopContentManagement.d.ts.map +1 -1
  23. package/lib/esm/components/TopContentManagement/TopContentManagement.js +3 -1
  24. package/lib/esm/context/TagManagementContextProvider.d.ts +8 -0
  25. package/lib/esm/context/TagManagementContextProvider.d.ts.map +1 -0
  26. package/lib/esm/context/TagManagementContextProvider.js +10 -0
  27. package/lib/esm/reducers/TagManagmentReducer.d.ts +27 -0
  28. package/lib/esm/reducers/TagManagmentReducer.d.ts.map +1 -0
  29. package/lib/esm/reducers/TagManagmentReducer.js +127 -0
  30. package/lib/esm/reducers/TopContentReducer.d.ts +4 -3
  31. package/lib/esm/reducers/TopContentReducer.d.ts.map +1 -1
  32. package/lib/esm/reducers/TopContentReducer.js +10 -2
  33. package/lib/esm/scss/_main.scss +28 -0
  34. package/lib/esm/scss/_pf-overrides.scss +24 -0
  35. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAYlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBA8KvC"}
1
+ {"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAalE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBAyLvC"}
@@ -10,6 +10,7 @@ import { ManageGroupUsers } from './components/Groups/ManageGroupUsers';
10
10
  import { ManageGroupedBookmarkedAccountsTab } from './components/ManageBookmarkedAccountsTab';
11
11
  import { ManagePartnerships } from './components/ManagePartnerships/index';
12
12
  import { ManagePreferences } from './components/ManagePreferences';
13
+ import { TagsManagement } from './components/ManageTags';
13
14
  import { NotificationEmails } from './components/NotificationEmails/index';
14
15
  import { TopContentManagement } from './components/TopContentManagement';
15
16
  import { PageTitle } from './constants/pageTitle';
@@ -19,7 +20,7 @@ export function ManageTabs(props) {
19
20
  const [activeTabKey, setActiveTabKey] = useState(0);
20
21
  const { activeTab } = useParams();
21
22
  const { t } = useTranslation();
22
- const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute, configsRoute, partnershipsRoute, } = Routes.getPaths();
23
+ const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute, configsRoute, partnershipsRoute, tagsManagerRoute, } = Routes.getPaths();
23
24
  useDocumentTitle(PageTitle.MANAGE);
24
25
  const canViewManageTab = ability.can(resourceActions.READ, resources.MANAGE);
25
26
  const canViewManageTopContent = ability.can(resourceActions.READ, resources.TOP_CONTENT) && canViewManageTab;
@@ -84,6 +85,15 @@ export function ManageTabs(props) {
84
85
  component: React.createElement(TopContentManagement, null),
85
86
  id: 'manage-top-content',
86
87
  });
88
+ canViewManageTopContent &&
89
+ tabsToRender.push({
90
+ title: 'Tags Manager',
91
+ key: 'tags-manager-tab',
92
+ 'data-tracking-id': 'tags-manager-tab',
93
+ routePath: tagsManagerRoute,
94
+ id: 'tags-manager',
95
+ component: React.createElement(TagsManagement, null),
96
+ });
87
97
  canViewConfigsTab &&
88
98
  tabsToRender.push({
89
99
  title: 'Internal Configs',
@@ -13,6 +13,7 @@ interface ManageRoutes {
13
13
  groups: Route;
14
14
  savedSearches: Route;
15
15
  topContent: Route;
16
+ tagsManager: Route;
16
17
  preferences: Route;
17
18
  notificationEmails: Route;
18
19
  configs: Route;
@@ -1 +1 @@
1
- {"version":3,"file":"Routes.d.ts","sourceRoot":"","sources":["../../src/Routes.ts"],"names":[],"mappings":"AAAA,UAAU,KAAK;IACX,QAAQ,C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;IACf,YAAY,EAAE,KAAK,CAAC;CACvB;AAED,eAAO,MAAM,MAAM,EAAE,YA+EpB,CAAC"}
package/lib/esm/Routes.js CHANGED
@@ -30,6 +30,12 @@ export const Routes = {
30
30
  return getPath(this);
31
31
  },
32
32
  },
33
+ tagsManager: {
34
+ path: 'tags-manager',
35
+ getPath() {
36
+ return getPath(this);
37
+ },
38
+ },
33
39
  preferences: {
34
40
  path: 'preferences',
35
41
  getPath() {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare function TagsManagement(): React.JSX.Element;
3
+ //# sourceMappingURL=TagsManagement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagsManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageTags/TagsManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,wBAAgB,cAAc,sBAS7B"}
@@ -0,0 +1,11 @@
1
+ import { ErrorBoundary } from '@rh-support/components';
2
+ import React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { TagManagementContextProvider } from '../../context/TagManagementContextProvider';
5
+ import TagsManager from './TagsManager';
6
+ export function TagsManagement() {
7
+ const { t } = useTranslation();
8
+ return (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading contents') } },
9
+ React.createElement(TagManagementContextProvider, null,
10
+ React.createElement(TagsManager, null))));
11
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export default function TagsManager(): React.JSX.Element;
3
+ //# sourceMappingURL=TagsManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagsManager.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageTags/TagsManager.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,MAAM,CAAC,OAAO,UAAU,WAAW,sBA+WlC"}
@@ -0,0 +1,240 @@
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, Bullseye, Button, ButtonVariant, EmptyState, EmptyStateVariant, Flex, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, SearchInput, Spinner, TextInput, } from '@patternfly/react-core';
11
+ import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
12
+ import TrashIcon from '@patternfly/react-icons/dist/js/icons/trash-icon';
13
+ import { ErrorBoundary, ToastNotification } from '@rh-support/components';
14
+ import { formatDate } from '@rh-support/utils';
15
+ import { isEmpty, isNull, isUndefined } from 'lodash';
16
+ import React, { useContext, useEffect, useMemo, useState } from 'react';
17
+ import { Trans, useTranslation } from 'react-i18next';
18
+ import { TagManagementDispatchContext, TagManagementStateContext } from '../../context/TagManagementContextProvider';
19
+ import { createNewTags, deleteTag, fetchTopContentTags, updateTag } from '../../reducers/TagManagmentReducer';
20
+ import { ManageTable } from '../ManageTable';
21
+ export default function TagsManager() {
22
+ const { t } = useTranslation();
23
+ const [createTagModalOpen, setCreateTagModalOpen] = useState(false);
24
+ const [newTagName, setNewTagName] = useState('');
25
+ const [isCreatingNewTag, setIsCreatingNewTag] = useState(false);
26
+ const [createTagError, setCreateTagError] = useState('');
27
+ const [editTagModalOpen, setEditTagModalOpen] = useState(false);
28
+ const [editTagName, setEditTagName] = useState('');
29
+ const [isEditingTagName, setisEditingTagName] = useState(false);
30
+ const [selectedEditTag, setSelectedEditTag] = useState(null);
31
+ const [editTagError, setEditTagError] = useState('');
32
+ const [selectedDeleteTag, setSelectedDeleteTag] = useState(null);
33
+ const [isDeletingTag, setIsDeletingTag] = useState(false);
34
+ const [deleteTagModalOpen, setDeleteTagModalOpen] = useState(false);
35
+ const [tagSearchTerm, setTagSearchTerm] = useState('');
36
+ const { tagResponse, tags } = useContext(TagManagementStateContext);
37
+ const dispatch = useContext(TagManagementDispatchContext);
38
+ const tagsByIds = useMemo(() => tags.reduce((acc, t) => (Object.assign(Object.assign({}, acc), { [t.id]: t })), {}), [tags]);
39
+ const getCreateTagError = (tagName) => {
40
+ tagName = tagName.trim();
41
+ if (isEmpty(tagName))
42
+ return t('Tag name cannot be empty.');
43
+ const existingTag = tags.find((t) => t.tagName === tagName);
44
+ if (existingTag)
45
+ return t('Tag with this name is already present.');
46
+ return '';
47
+ };
48
+ //filtering tags for user search
49
+ const filteredTagIds = useMemo(() => {
50
+ if (isEmpty(tagSearchTerm))
51
+ return tags.map((t) => t.id);
52
+ const filteredIds = [];
53
+ tags.forEach((t) => {
54
+ if (t.tagName.toLowerCase().includes(tagSearchTerm)) {
55
+ filteredIds.push(t.id);
56
+ }
57
+ });
58
+ return filteredIds;
59
+ }, [tagSearchTerm, tags]);
60
+ useEffect(() => {
61
+ fetchTopContentTags(dispatch);
62
+ // eslint-disable-next-line react-hooks/exhaustive-deps
63
+ }, []);
64
+ const onCreateNewTag = () => __awaiter(this, void 0, void 0, function* () {
65
+ const errorMsg = getCreateTagError(newTagName);
66
+ if (!isEmpty(errorMsg)) {
67
+ setCreateTagError(errorMsg);
68
+ return;
69
+ }
70
+ try {
71
+ setIsCreatingNewTag(true);
72
+ yield createNewTags(dispatch, [{ tagName: newTagName.trim(), isActive: true }]);
73
+ ToastNotification.addSuccessMessage(t('Successfully created tag'));
74
+ }
75
+ catch (err) {
76
+ console.log({ err });
77
+ ToastNotification.addSuccessMessage(t('Error creating tag'));
78
+ }
79
+ finally {
80
+ setIsCreatingNewTag(false);
81
+ onCanceCreateNewTag();
82
+ }
83
+ });
84
+ const onCanceCreateNewTag = () => {
85
+ setCreateTagError('');
86
+ setCreateTagModalOpen(false);
87
+ setNewTagName('');
88
+ };
89
+ const onEditTagClick = (tag) => __awaiter(this, void 0, void 0, function* () {
90
+ setEditTagName(tag.tagName);
91
+ setSelectedEditTag(tag);
92
+ setEditTagModalOpen(true);
93
+ });
94
+ const onEditTagConfirm = () => __awaiter(this, void 0, void 0, function* () {
95
+ const errorMsg = getCreateTagError(editTagName);
96
+ if (!isEmpty(errorMsg)) {
97
+ setEditTagError(errorMsg);
98
+ return;
99
+ }
100
+ if (isNull(selectedEditTag) || isUndefined(selectedEditTag))
101
+ return;
102
+ try {
103
+ setisEditingTagName(true);
104
+ yield updateTag(dispatch, { id: selectedEditTag.id, tagName: editTagName.trim() }, tags);
105
+ ToastNotification.addSuccessMessage(t('Successfully edited tag'));
106
+ }
107
+ catch (err) {
108
+ console.log(err);
109
+ ToastNotification.addSuccessMessage(t('Error editing tag'));
110
+ }
111
+ finally {
112
+ setisEditingTagName(false);
113
+ onEditCancel();
114
+ }
115
+ });
116
+ const onEditCancel = () => {
117
+ setEditTagModalOpen(false);
118
+ setSelectedEditTag(null);
119
+ setEditTagName('');
120
+ setEditTagError('');
121
+ };
122
+ const onDeleteTagClick = (tag) => __awaiter(this, void 0, void 0, function* () {
123
+ setDeleteTagModalOpen(true);
124
+ setSelectedDeleteTag(tag);
125
+ });
126
+ const onDeleteTagConfirm = () => __awaiter(this, void 0, void 0, function* () {
127
+ if (isNull(selectedDeleteTag) || isUndefined(selectedDeleteTag))
128
+ return;
129
+ try {
130
+ setIsDeletingTag(true);
131
+ yield deleteTag(dispatch, selectedDeleteTag, { tagResponse, tags });
132
+ ToastNotification.addSuccessMessage(t('Tag deleted successfully'));
133
+ }
134
+ catch (err) {
135
+ console.log(err);
136
+ ToastNotification.addSuccessMessage(t('Error deleting tag'));
137
+ }
138
+ finally {
139
+ setDeleteTagModalOpen(false);
140
+ setIsDeletingTag(false);
141
+ setSelectedDeleteTag(null);
142
+ }
143
+ });
144
+ const columns = [
145
+ {
146
+ accessor: (id) => tagsByIds[id].tagName,
147
+ sortable: false,
148
+ id: 'tagname-manage-table',
149
+ title: t('Tag'),
150
+ cellWidth: 20,
151
+ },
152
+ {
153
+ id: 'article-count-for-tags',
154
+ sortable: false,
155
+ title: t('No of top contents'),
156
+ cellWidth: 20,
157
+ cell: (id) => `${tagsByIds[id].numberOfLinkedContents || 0} articles`,
158
+ },
159
+ {
160
+ id: 'tag-created-by',
161
+ sortable: false,
162
+ title: t('Created by'),
163
+ cellWidth: 30,
164
+ cell: (id) => tagsByIds[id].createdBy,
165
+ },
166
+ {
167
+ id: 'tag-modified-date',
168
+ sortable: false,
169
+ title: t('Modified date'),
170
+ cellWidth: 20,
171
+ cell: (id) => formatDate(tagsByIds[id].modifiedDate),
172
+ },
173
+ {
174
+ id: 'tag-manage-actions',
175
+ title: '',
176
+ sortable: false,
177
+ cellWidth: 10,
178
+ cell: (id) => (React.createElement(ActionList, { isIconList: true },
179
+ React.createElement(ActionListItem, null,
180
+ React.createElement(Button, { variant: "plain", "data-tracking-id": "edit-tag", "aria-label": `edit tag ${tagsByIds[id].tagName}`, onClick: () => onEditTagClick(tagsByIds[id]) },
181
+ React.createElement(PencilAltIcon, null))),
182
+ React.createElement(ActionListItem, null,
183
+ React.createElement(Button, { "aria-label": `delete tag ${tagsByIds[id].tagName}`, variant: "plain", "data-tracking-id": "delete-tag", onClick: () => onDeleteTagClick(tagsByIds[id]) },
184
+ React.createElement(TrashIcon, null))))),
185
+ },
186
+ ];
187
+ const CreateTagModel = (React.createElement(Modal, { title: t('Create a tag'), onClose: onCanceCreateNewTag, isOpen: createTagModalOpen, actions: [
188
+ React.createElement(Button, { key: "create-tag", variant: ButtonVariant.primary, onClick: onCreateNewTag, isLoading: isCreatingNewTag, isDisabled: !isEmpty(createTagError) || isCreatingNewTag },
189
+ React.createElement(Trans, null, "Create")),
190
+ React.createElement(Button, { key: "cancel-create-tag", variant: ButtonVariant.link, onClick: onCanceCreateNewTag }, "Cancel"),
191
+ ] },
192
+ React.createElement(FormGroup, { label: "Tag name", isRequired: true },
193
+ React.createElement(TextInput, { isRequired: true, type: "text", id: "create-new-tag-text-input", value: newTagName, onChange: (e, v) => {
194
+ setNewTagName(v);
195
+ setCreateTagError('');
196
+ }, placeholder: t('Enter a unique name to create a tag'), validated: isEmpty(createTagError) ? 'default' : 'error' }),
197
+ !isEmpty(createTagError) && (React.createElement(FormHelperText, null,
198
+ React.createElement(HelperText, null,
199
+ React.createElement(HelperTextItem, { variant: "error" }, createTagError)))))));
200
+ const EditTagModal = (React.createElement(Modal, { title: t('Edit Tag'), isOpen: editTagModalOpen, onClose: onEditCancel, actions: [
201
+ React.createElement(Button, { key: "edit-tag", variant: ButtonVariant.primary, onClick: onEditTagConfirm, isLoading: isEditingTagName, isDisabled: !isEmpty(editTagError) || isEditingTagName },
202
+ React.createElement(Trans, null, "Save")),
203
+ React.createElement(Button, { key: "cancel-edit-tag", variant: ButtonVariant.link, onClick: onEditCancel }, "Cancel"),
204
+ ] },
205
+ React.createElement(FormGroup, { label: "Tag name", isRequired: true },
206
+ React.createElement(TextInput, { isRequired: true, type: "text", id: "edit-tag-text-input", value: editTagName, onChange: (e, v) => {
207
+ setEditTagName(v);
208
+ setEditTagError('');
209
+ }, placeholder: t('Enter a unique name for this tag') }),
210
+ !isEmpty(editTagError) && (React.createElement(FormHelperText, null,
211
+ React.createElement(HelperText, null,
212
+ React.createElement(HelperTextItem, { variant: "error" }, editTagError)))))));
213
+ const DeleteTagModel = () => (React.createElement(Modal, { title: t('Are you sure?'), isOpen: deleteTagModalOpen, onClose: () => setDeleteTagModalOpen(false), actions: [
214
+ React.createElement(Button, { key: "delete-tag", variant: ButtonVariant.danger, onClick: onDeleteTagConfirm, isLoading: isDeletingTag, isDisabled: isDeletingTag },
215
+ React.createElement(Trans, null, "Yes, I am sure")),
216
+ React.createElement(Button, { key: "cancel-delete-tag", variant: ButtonVariant.link, onClick: () => setDeleteTagModalOpen(false) }, "Cancel"),
217
+ ] },
218
+ React.createElement(Trans, null, "Deleting this tag will permanently untag all content associated with it. Are you sure you want to proceed?")));
219
+ return (React.createElement(React.Fragment, null,
220
+ CreateTagModel,
221
+ EditTagModal,
222
+ React.createElement(DeleteTagModel, null),
223
+ React.createElement("header", null,
224
+ React.createElement("h2", null, "Tags"),
225
+ React.createElement("p", { className: "pf-v5-u-my-sm" },
226
+ React.createElement(Trans, null, "Add, edit or remove tags and manage tagged top content."))),
227
+ React.createElement("div", { className: "toolbar" },
228
+ React.createElement(Flex, { alignItems: { default: 'alignItemsCenter' }, className: "pf-v5-u-w-100" },
229
+ React.createElement("label", { htmlFor: "tag-search-input" },
230
+ React.createElement(Trans, null, "Search Tag")),
231
+ React.createElement("div", { className: "pf-v5-u-flex-grow-1" },
232
+ React.createElement(SearchInput, { type: "text", id: "tag-search-input", value: tagSearchTerm, onChange: (e, v) => setTagSearchTerm(v), placeholder: t('Search for a tag') })),
233
+ React.createElement("span", { className: "pf-v5-u-ml-sm" },
234
+ React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: () => setCreateTagModalOpen(true), "data-tracking-id": "tag-create-button" },
235
+ React.createElement(Trans, null, "Create tag"))))),
236
+ React.createElement("div", { className: "tags-manager-wrapper" },
237
+ React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading tags list') } }, tagResponse.isFetching ? (React.createElement(Bullseye, null,
238
+ React.createElement(EmptyState, { variant: EmptyStateVariant.full },
239
+ React.createElement(Spinner, { size: "lg" })))) : (React.createElement(ManageTable, { ariaLabel: t('Table to manage tags'), data: filteredTagIds, columns: columns, isError: false, keepPageNumberOnDataChange: true }))))));
240
+ }
@@ -0,0 +1,2 @@
1
+ export { TagsManagement } from './TagsManagement';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageTags/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ export { TagsManagement } from './TagsManagement';
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,EAGH,oBAAoB,EAGvB,MAAM,wCAAwC,CAAC;AAGhD,MAAM,WAAW,yBAAyB;IACtC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,CAAC,yBAAyB,CAyGlF,CAAC"}
1
+ {"version":3,"file":"TopContentComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,EAGH,oBAAoB,EAGvB,MAAM,wCAAwC,CAAC;AAGhD,MAAM,WAAW,yBAAyB;IACtC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,CAAC,yBAAyB,CA0GlF,CAAC"}
@@ -57,7 +57,7 @@ export const TopContentComponent = (props) => {
57
57
  React.createElement(Droppable, { droppableId: `${props.category.id}`, type: `drop-inner-${props.category.id}`, isDropDisabled: !isArrangingContent, key: `drop-inner-${props.category.id}` }, (provided) => (React.createElement("div", { ref: provided.innerRef },
58
58
  React.createElement("ul", { "aria-label": t('Content list'), className: "list-flat list-flushleft" },
59
59
  props.category.content.map((content, i) => (React.createElement(Draggable, { key: `drag-inner-${i}${props.category.id}`, draggableId: `drag-inner-${i}${props.category.id}`, index: i, isDragDisabled: !isArrangingContent }, (provided, snapshot) => (React.createElement("div", Object.assign({ key: `${i}-c`, "aria-label": t('Content'), ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps),
60
- React.createElement(TopContentSingleItem, { isArrangingContent: isArrangingContent, category: props.category, snapshot: snapshot, i: i })))))),
60
+ React.createElement(TopContentSingleItem, { isArrangingContent: isArrangingContent, category: props.category, snapshot: snapshot, i: i, key: content.topContentId })))))),
61
61
  provided.placeholder),
62
62
  !isSearchModeEnabled && buttons)))));
63
63
  };
@@ -4,9 +4,10 @@ import { ITopContentEditState } from '../../../../reducers/TopContentReducer';
4
4
  interface IProps {
5
5
  isArrangingContent: boolean;
6
6
  category: ITopContentEditState;
7
- snapshot: DraggableStateSnapshot;
7
+ snapshot?: DraggableStateSnapshot;
8
8
  i: number;
9
9
  }
10
+ export declare function formatDuplicateWarning(arr: any): any;
10
11
  export declare const TopContentSingleItem: ({ isArrangingContent, category, snapshot, i }: IProps) => React.JSX.Element;
11
12
  export {};
12
13
  //# sourceMappingURL=TopContentSingleItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,OAAO,EAIH,oBAAoB,EAOvB,MAAM,wCAAwC,CAAC;AAIhD,UAAU,MAAM;IACZ,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,CAAC,EAAE,MAAM,CAAC;CACb;AAaD,eAAO,MAAM,oBAAoB,kDAAmD,MAAM,sBA+YzF,CAAC"}
1
+ {"version":3,"file":"TopContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAU7D,OAAO,EAIH,oBAAoB,EAOvB,MAAM,wCAAwC,CAAC;AAIhD,UAAU,MAAM;IACZ,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,sBAAsB,CAAC,GAAG,KAAA,OASzC;AAED,eAAO,MAAM,oBAAoB,kDAAmD,MAAM,sBA4czF,CAAC"}
@@ -8,23 +8,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { search } from '@cee-eng/hydrajs';
11
- import { Button, Icon, TextInput, ValidatedOptions } from '@patternfly/react-core';
11
+ import { Button, Flex, FlexItem, FormGroup, Icon, Label, TextInput, ValidatedOptions } from '@patternfly/react-core';
12
12
  import EditAltIcon from '@patternfly/react-icons/dist/js/icons/edit-alt-icon';
13
13
  import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
14
14
  import GripVerticalIcon from '@patternfly/react-icons/dist/js/icons/grip-vertical-icon';
15
- import { ToastNotification, useDebounce } from '@rh-support/components';
15
+ import { TagsSelector, ToastNotification, useDebounce } from '@rh-support/components';
16
16
  import { formatDate, getDrupalResIdIfTypeFromUrl, getText, isValidUrl } from '@rh-support/utils';
17
+ import { differenceBy, isEqual } from 'lodash';
17
18
  import cloneDeep from 'lodash/cloneDeep';
18
19
  import findIndex from 'lodash/findIndex';
19
20
  import isEmpty from 'lodash/isEmpty';
20
- import React, { useEffect, useState } from 'react';
21
+ import React, { useContext, useEffect, useMemo, useState } from 'react';
21
22
  import { Trans, useTranslation } from 'react-i18next';
23
+ import { TagManagementDispatchContext, TagManagementStateContext, } from '../../../../context/TagManagementContextProvider';
22
24
  import { useTopContentContext, useTopContentDispatchContext } from '../../../../context/TopContentProvider';
25
+ import { updateTopContentWithTags } from '../../../../reducers/TagManagmentReducer';
23
26
  import { getTopContentUrl } from '../../../../reducers/TopContentHelpers';
24
27
  import { ContentMode, deleteTopContent, fetchTopContent, removeTopContent, saveAddedNewSectionContents, saveAddToTopContent, saveChangeInCategoryContent, setIsAddingCategory, } from '../../../../reducers/TopContentReducer';
25
28
  import { AddNewCategoryDropDown } from './AddNewCategoryDropDown';
26
29
  import { TopContentSingleItemLink } from './TopContentSingleItemLink';
27
- function formatDuplicateWarning(arr) {
30
+ export function formatDuplicateWarning(arr) {
28
31
  if (arr.length === 0 || arr.length === 1)
29
32
  return arr;
30
33
  if (arr.length === 2) {
@@ -44,9 +47,13 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
44
47
  const content = category.content && category.content[i];
45
48
  const { t } = useTranslation();
46
49
  const { topContentEditState, isCatOnlyForMajorVersion, selectedProduct, selectedVersion, contentUrls } = useTopContentContext();
50
+ const tagManagementEditState = useContext(TagManagementStateContext);
51
+ const { tags: tagOptions } = tagManagementEditState;
47
52
  const topContentDispatch = useTopContentDispatchContext();
53
+ const tagManagmentDispatch = useContext(TagManagementDispatchContext);
48
54
  const [localContentUrl, setLocalContentUrl] = useState(content.contentUrl);
49
55
  const [localContentTitle, setLocalContentTitle] = useState(content.contentTitle);
56
+ const [localSelectedTags, setLocalSelectedTags] = useState(content.tags);
50
57
  const [newCategory, setNewCategory] = useState(undefined);
51
58
  const [contentTitleIsValid, setContentTitleIsValid] = useState(true);
52
59
  const [contentUrlIsValid, setContentUrlIsValid] = useState(true);
@@ -55,11 +62,16 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
55
62
  const [isSaving, setIsSaving] = useState(false);
56
63
  const duplicateTitleCategoryIndex = findIndex(category.content, (c) => c.contentTitle === localContentTitle.trim());
57
64
  const isDuplicateTitle = duplicateTitleCategoryIndex !== -1 && duplicateTitleCategoryIndex !== i && !isEmpty(localContentTitle.trim());
65
+ const oldTagsIds = useMemo(() => { var _a; return ((_a = content === null || content === void 0 ? void 0 : content.tags) === null || _a === void 0 ? void 0 : _a.map((t) => t.id)) || []; }, [content === null || content === void 0 ? void 0 : content.tags]);
66
+ const localTagsIds = useMemo(() => localSelectedTags === null || localSelectedTags === void 0 ? void 0 : localSelectedTags.map((t) => t.id), [localSelectedTags]);
58
67
  const onContentTitleChange = (contentTitle, event) => {
59
68
  const contentTitleIsValid = event.target.validity.valid;
60
69
  setContentTitleIsValid(contentTitleIsValid);
61
70
  setLocalContentTitle(contentTitle);
62
71
  };
72
+ const handleLocalTagChange = (tags) => {
73
+ setLocalSelectedTags(tags);
74
+ };
63
75
  const updateContentTitleFromUrl = (contentUrl) => __awaiter(void 0, void 0, void 0, function* () {
64
76
  var _a, _b, _c;
65
77
  // throws toast warning and clears it after 4 seconds
@@ -149,7 +161,11 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
149
161
  try {
150
162
  const newContent = Object.assign(Object.assign({}, content), { contentTitle: localContentTitle, contentUrl: localContentUrl });
151
163
  setIsSaving(true);
152
- yield saveAddToTopContent(topContentDispatch, topContentEditState, category.id, category.categoryId, newContent, i);
164
+ const addedContent = yield saveAddToTopContent(topContentDispatch, topContentEditState, category.id, category.categoryId, newContent, i);
165
+ yield updateTopContentWithTags(tagManagmentDispatch, {
166
+ id: addedContent.topContents[0].id,
167
+ tagList: localSelectedTags.map((t) => parseInt(t.id)),
168
+ }, tagManagementEditState);
153
169
  ToastNotification.addSuccessMessage(t('Content added successfully'));
154
170
  }
155
171
  catch (error) {
@@ -161,10 +177,12 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
161
177
  return;
162
178
  });
163
179
  const onSaveUpdateContent = () => __awaiter(void 0, void 0, void 0, function* () {
180
+ const newTags = differenceBy(localTagsIds, oldTagsIds);
181
+ const deletedTags = differenceBy(oldTagsIds, localTagsIds);
164
182
  try {
165
- const updatedContent = Object.assign(Object.assign({}, content), { contentTitle: localContentTitle, contentUrl: localContentUrl });
183
+ const updatedContent = Object.assign(Object.assign({}, content), { contentTitle: localContentTitle, contentUrl: localContentUrl, tagList: newTags, tags: localSelectedTags.map((t) => ({ id: t.id, tagName: t.tagName })) });
166
184
  setIsSaving(true);
167
- yield saveChangeInCategoryContent(topContentDispatch, topContentEditState, category.categoryId, updatedContent);
185
+ yield saveChangeInCategoryContent(topContentDispatch, topContentEditState, category.categoryId, updatedContent, deletedTags);
168
186
  editToggle();
169
187
  ToastNotification.addSuccessMessage(t('Content updated successfully'));
170
188
  }
@@ -179,7 +197,11 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
179
197
  try {
180
198
  const newContent = Object.assign(Object.assign({}, content), { contentTitle: localContentTitle, contentUrl: localContentUrl });
181
199
  setIsSaving(true);
182
- yield saveAddedNewSectionContents(topContentDispatch, topContentEditState, newCategory, selectedProduct, selectedVersion, isCatOnlyForMajorVersion, newContent);
200
+ const newCategoryContent = yield saveAddedNewSectionContents(topContentDispatch, topContentEditState, newCategory, selectedProduct, selectedVersion, isCatOnlyForMajorVersion, newContent);
201
+ yield updateTopContentWithTags(tagManagmentDispatch, {
202
+ id: newCategoryContent.topContents[0].id,
203
+ tagList: localSelectedTags.map((t) => parseInt(t.id)),
204
+ }, tagManagementEditState);
183
205
  ToastNotification.addSuccessMessage(t('Category created successfully'));
184
206
  setIsAddingCategory(topContentDispatch, false);
185
207
  }
@@ -224,6 +246,7 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
224
246
  setShowDuplicateError(false);
225
247
  setContentUrlIsValid(true);
226
248
  setIsAddingCategory(topContentDispatch, false);
249
+ setLocalSelectedTags(content.tags);
227
250
  };
228
251
  useDebounce(() => {
229
252
  onLocalContentUrlChange();
@@ -235,6 +258,7 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
235
258
  useEffect(() => {
236
259
  setLocalContentTitle(content.contentTitle);
237
260
  setLocalContentUrl(content.contentUrl);
261
+ setLocalSelectedTags(content.tags);
238
262
  }, [content]);
239
263
  // To check if input has spaces
240
264
  const doesInputHasSpaces = isEmpty(localContentTitle.trim());
@@ -243,20 +267,23 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
243
267
  isDuplicateTitle ||
244
268
  !(contentTitleIsValid && contentUrlIsValid && localContentTitle && localContentUrl) ||
245
269
  (!newCategory && content.mode === ContentMode.NEW_SECTION_CONTENT) ||
246
- (localContentUrl === content.contentUrl && localContentTitle === content.contentTitle);
270
+ (localContentUrl === content.contentUrl &&
271
+ localContentTitle === content.contentTitle &&
272
+ isEqual(localTagsIds, oldTagsIds));
247
273
  const lastModifiedBy = t(`Last modified {{created}} by {{by}}`, {
248
274
  created: formatDate(content.updatedOn || content.createdOn),
249
275
  by: content.updatedBy || content.createdBy,
250
276
  });
251
277
  return (React.createElement(React.Fragment, null,
252
- isPreview && content.mode !== ContentMode.ADD && content.mode !== ContentMode.NEW_SECTION_CONTENT && (React.createElement("li", { className: `push-bottom-narrow ${snapshot.isDragging ? 'list-flat tc-drag' : ''}` },
278
+ isPreview && content.mode !== ContentMode.ADD && content.mode !== ContentMode.NEW_SECTION_CONTENT && (React.createElement("li", { className: `push-bottom-narrow ${(snapshot === null || snapshot === void 0 ? void 0 : snapshot.isDragging) ? 'list-flat tc-drag' : ''}` },
253
279
  isArrangingContent && (React.createElement(Icon, { size: "sm" },
254
280
  React.createElement(GripVerticalIcon, { style: { cursor: 'move' }, title: t('Drag'), color: "#06c", className: "pf-v5-u-mr-sm" }))),
255
281
  !isArrangingContent ? (React.createElement(React.Fragment, null,
256
282
  React.createElement(TopContentSingleItemLink, { url: getTopContentUrl(content.contentUrl), title: content.contentTitle, contentId: content.topContentId, needsAttention: content.isAttentionNeeded, lastModifiedBy: lastModifiedBy, selectedVersion: selectedVersion }),
257
283
  ' ',
258
284
  React.createElement(Button, { variant: "link", isInline: true, icon: React.createElement(EditAltIcon, null), onClick: editToggle, title: 'Edit' }))) : (content.contentTitle),
259
- React.createElement("div", null, lastModifiedBy))),
285
+ React.createElement("div", null, lastModifiedBy),
286
+ React.createElement("div", null, (content.tags || []).map((tag) => (React.createElement(Label, { isCompact: true, className: "pf-v5-u-mr-xs pf-v5-u-mt-sm", key: tag.id }, tag.tagName)))))),
260
287
  (!isPreview || content.mode === ContentMode.ADD || content.mode === ContentMode.NEW_SECTION_CONTENT) && (React.createElement("form", { noValidate: true, onSubmit: onSubmit, className: "card card-light push-bottom" },
261
288
  content.mode === ContentMode.NEW_SECTION_CONTENT && (React.createElement(AddNewCategoryDropDown, { onCategoryChange: onAddedNewCategoryChange })),
262
289
  React.createElement("div", { className: "form-group" },
@@ -282,6 +309,11 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
282
309
  " Duplicate url. This url is already added in ",
283
310
  formatDuplicateWarning(duplicatUrlErrorArray),
284
311
  "."))),
312
+ React.createElement(Flex, { className: "pf-v5-u-my-lg" },
313
+ React.createElement(FlexItem, { flex: { default: 'flex_1' } },
314
+ React.createElement(FormGroup, { label: t('Tags') },
315
+ React.createElement("div", { className: "pf-v5-c-form-control" },
316
+ React.createElement(TagsSelector, { tagOptions: tagOptions, onChange: handleLocalTagChange, selectedTags: localSelectedTags }))))),
285
317
  React.createElement("span", { className: "top-content-single-item-footer" },
286
318
  React.createElement("span", null,
287
319
  React.createElement(Button, { variant: "primary", onClick: onSave, isDisabled: isSaveButtonDisabled || isSaving, isLoading: isSaving },
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/TopContentEditor/TopContentEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAA+C,MAAM,OAAO,CAAC;AA6BpE,wBAAgB,gBAAgB,sBAyT/B"}
1
+ {"version":3,"file":"TopContentEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/TopContentEditor/TopContentEditor.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AA+BhF,wBAAgB,gBAAgB,sBA4V/B"}
@@ -8,14 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { Accordion, Alert, AlertVariant, Bullseye, Button, EmptyState, EmptyStateVariant, Spinner, Tooltip, } from '@patternfly/react-core';
11
- import { ToastNotification, TopContentSearch } from '@rh-support/components';
11
+ import { TagsSelector, ToastNotification, TopContentSearch } from '@rh-support/components';
12
12
  import { getVersion, isRegularVersion } from '@rh-support/utils';
13
13
  import isEmpty from 'lodash/isEmpty';
14
- import React, { useEffect, useMemo, useRef, useState } from 'react';
14
+ import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
15
15
  import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';
16
16
  import { Trans, useTranslation } from 'react-i18next';
17
17
  import { CATEGORY_LIMIT } from '../../../constants/TopContent';
18
+ import { TagManagementDispatchContext, TagManagementStateContext } from '../../../context/TagManagementContextProvider';
18
19
  import { useTopContentContext, useTopContentDispatchContext } from '../../../context/TopContentProvider';
20
+ import { fetchTopContentTags } from '../../../reducers/TagManagmentReducer';
19
21
  import { flagContentUsage, isMajorOrNamedVersion } from '../../../reducers/TopContentHelpers';
20
22
  import { CategoryMode, fetchTopContent, reArrangeCategory, resetChangeInCategory, resetContentWithSelectedProduct, resetDuplicatUrls, setAddNewSection, setIsAddingCategory, setIsSearchModeEnabled, setTopContentArrangingCategory, setTopContentArrangingContent, } from '../../../reducers/TopContentReducer';
21
23
  import CategoryLimit from '../CategoryLimit/CategoryLimit';
@@ -33,10 +35,13 @@ export function TopContentEditor() {
33
35
  const [newCategoryVersion, setNewCategoryVersion] = useState(undefined);
34
36
  const [searchQuery, setSearchQuery] = useState('');
35
37
  const topContentResultsRef = useRef(null);
38
+ const [filteredTags, setFilteredTags] = useState([]);
36
39
  const { topContentResponse, topContentEditState, isAddingCategory, isCatOnlyForMajorVersion, isSearchModeEnabled, selectedProduct, selectedVersion, categoryUsage, } = useTopContentContext();
40
+ const { tags } = useContext(TagManagementStateContext);
37
41
  const topContentDispatch = useTopContentDispatchContext();
42
+ const tagManagerDispatch = useContext(TagManagementDispatchContext);
38
43
  const flagContentEditState = useMemo(() => flagContentUsage(topContentEditState, categoryUsage, selectedVersion), [topContentEditState, categoryUsage, selectedVersion]);
39
- const [filteredTC, setFilteredTC] = useState(flagContentEditState);
44
+ const [filteredByQueryTC, setFilteredByQueryTC] = useState(flagContentEditState);
40
45
  const onProductChange = (selectedProduct) => {
41
46
  resetContentWithSelectedProduct(topContentDispatch, selectedProduct);
42
47
  };
@@ -48,10 +53,27 @@ export function TopContentEditor() {
48
53
  return;
49
54
  fetchTopContent(topContentDispatch, selectedProduct, selectedVersion);
50
55
  };
56
+ const filteredTC = useMemo(() => {
57
+ if (isEmpty(filteredTags))
58
+ return filteredByQueryTC;
59
+ const filteredTagsIds = filteredTags.map((tag) => tag.id);
60
+ //filter top contents on basis of tags
61
+ const filteredData = filteredByQueryTC.flatMap((item) => {
62
+ const contents = item.content.filter((content) => (content.tags || []).some((tag) => filteredTagsIds.includes(tag.id)));
63
+ if (!isEmpty(contents))
64
+ return [Object.assign(Object.assign({}, item), { content: contents })];
65
+ return [];
66
+ });
67
+ return filteredData;
68
+ }, [filteredByQueryTC, filteredTags]);
51
69
  useEffect(() => {
52
- !isSearchModeEnabled && setFilteredTC(flagContentEditState);
70
+ !isSearchModeEnabled && setFilteredByQueryTC(flagContentEditState);
53
71
  // eslint-disable-next-line react-hooks/exhaustive-deps
54
72
  }, [flagContentEditState]);
73
+ useEffect(() => {
74
+ fetchTopContentTags(tagManagerDispatch);
75
+ // eslint-disable-next-line react-hooks/exhaustive-deps
76
+ }, []);
55
77
  const onAddCategory = (isMajorVersionOnly, isCreatingNewSet = false, version, hasMajorContentCreatingMinorContent) => {
56
78
  hasMajorContentCreatingMinorContent && resetDuplicatUrls(topContentDispatch);
57
79
  setCategoryToOpen(null);
@@ -97,7 +119,8 @@ export function TopContentEditor() {
97
119
  !isAddingCategory &&
98
120
  selectedVersion &&
99
121
  flagContentEditState.length !== 0 &&
100
- !isSearchModeEnabled;
122
+ !isSearchModeEnabled &&
123
+ isEmpty(filteredTags);
101
124
  const isContentOnlyForMajorVersion = !topContentResponse.isFetching &&
102
125
  flagContentEditState.length !== 0 &&
103
126
  isRegularVersion(selectedVersion) &&
@@ -105,7 +128,7 @@ export function TopContentEditor() {
105
128
  !isAddingCategory;
106
129
  const onSearch = (searchTerm, searchResults) => {
107
130
  setIsSearchModeEnabled(topContentDispatch, searchTerm ? true : false);
108
- setFilteredTC(searchResults);
131
+ setFilteredByQueryTC(searchResults);
109
132
  };
110
133
  const minorSelectedNoMinorContentButAvailableMajorContent = isContentOnlyForMajorVersion && getVersion(selectedVersion).minor && flagContentEditState.length !== 0;
111
134
  const isCategoryLimitReached = filteredTC.length >= CATEGORY_LIMIT.MAX;
@@ -113,7 +136,12 @@ export function TopContentEditor() {
113
136
  React.createElement(TopContentHeader, null),
114
137
  !topContentResponse.isFetching && topContentResponse.isError && (React.createElement(Alert, { isInline: true, variant: AlertVariant.danger, title: React.createElement(Trans, null, "Error loading Top Content") })),
115
138
  React.createElement(TopContentProductVersionSelector, { selectedProduct: selectedProduct, selectedVersion: selectedVersion, onProductChange: onProductChange, onVersionChange: onVersionChange }),
116
- !topContentResponse.isFetching && (React.createElement(TopContentSearch, { dataTrackingId: "top-content-filter-manage", topContentData: flagContentEditState, onSearch: onSearch, topContentResultsWrapperRef: topContentResultsRef, searchQuery: searchQuery, setSearchQuery: setSearchQuery })),
139
+ !topContentResponse.isFetching && (React.createElement("div", { className: "toolbar" },
140
+ React.createElement(TopContentSearch, { dataTrackingId: "top-content-filter-manage", topContentData: flagContentEditState, onSearch: onSearch, topContentResultsWrapperRef: topContentResultsRef, searchQuery: searchQuery, setSearchQuery: setSearchQuery, className: "toolbar-content" }),
141
+ React.createElement("div", { className: "toolbar-content pf-v5-u-ml-md" },
142
+ React.createElement("label", { htmlFor: 'tag-selector' },
143
+ React.createElement(Trans, null, "All tags")),
144
+ React.createElement(TagsSelector, { tagOptions: tags, onChange: setFilteredTags, selectedTags: filteredTags })))),
117
145
  React.createElement("div", { className: "top-content-manage-wrapper pf-v5-u-pt-md" },
118
146
  !topContentResponse.isFetching && React.createElement(TopContentSuggestion, { searchQuery: searchQuery }),
119
147
  topContentResponse.isFetching ? (React.createElement(Bullseye, null,
@@ -131,7 +159,8 @@ export function TopContentEditor() {
131
159
  category.catMode === CategoryMode.EXISTING_SECTION && (React.createElement(Draggable, { draggableId: `c${category.id}`, index: i, isDragDisabled: !isArrangingCats, key: `c-${i}-${category.id}` }, (provided, snapshot) => category.helperText ? (React.createElement(Tooltip, { content: React.createElement("div", null, category.helperText) },
132
160
  React.createElement(TopContentCategory, { isExpanded: isSearchModeEnabled
133
161
  ? true
134
- : category.id === categoryToOpen, category: category, provided: provided, innerRef: provided.innerRef, isArrangingCats: isArrangingCats, snapshot: snapshot }))) : (React.createElement(TopContentCategory, { isExpanded: isSearchModeEnabled
162
+ : category.id === categoryToOpen, category: category, provided: provided, innerRef: provided.innerRef, isArrangingCats: isArrangingCats, snapshot: snapshot }))) : (React.createElement(TopContentCategory, { isExpanded: isSearchModeEnabled ||
163
+ !isEmpty(filteredTags)
135
164
  ? true
136
165
  : category.id === categoryToOpen, category: category, provided: provided, innerRef: provided.innerRef, isArrangingCats: isArrangingCats, snapshot: snapshot })))),
137
166
  category.catMode === CategoryMode.NEW_SECTION && (React.createElement(TopContentCategoryNew, { category: category, key: 'new-section', version: newCategoryVersion }))))),
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/TopContentManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,MAAM;CAAG;AAEnB,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAUjD"}
1
+ {"version":3,"file":"TopContentManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/TopContentManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,MAAM;CAAG;AAEnB,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAYjD"}
@@ -1,11 +1,13 @@
1
1
  import { ErrorBoundary } from '@rh-support/components';
2
2
  import React from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
+ import { TagManagementContextProvider } from '../../context/TagManagementContextProvider';
4
5
  import { TopContentContextProvider } from '../../context/TopContentProvider';
5
6
  import { TopContentEditor } from './TopContentEditor/TopContentEditor';
6
7
  export function TopContentManagement(props) {
7
8
  const { t } = useTranslation();
8
9
  return (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading suggestions') } },
9
10
  React.createElement(TopContentContextProvider, null,
10
- React.createElement(TopContentEditor, null))));
11
+ React.createElement(TagManagementContextProvider, null,
12
+ React.createElement(TopContentEditor, null)))));
11
13
  }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ITagManagementState, TagManagementDisptachType } from '../reducers/TagManagmentReducer';
3
+ export declare const TagManagementStateContext: React.Context<ITagManagementState>;
4
+ export declare const TagManagementDispatchContext: React.Context<TagManagementDisptachType>;
5
+ export declare function TagManagementContextProvider({ children }: {
6
+ children: any;
7
+ }): React.JSX.Element;
8
+ //# sourceMappingURL=TagManagementContextProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagManagementContextProvider.d.ts","sourceRoot":"","sources":["../../../src/context/TagManagementContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAEH,mBAAmB,EACnB,yBAAyB,EAE5B,MAAM,iCAAiC,CAAC;AAGzC,eAAO,MAAM,yBAAyB,oCAAsE,CAAC;AAC7G,eAAO,MAAM,4BAA4B,0CAA8C,CAAC;AAExF,wBAAgB,4BAA4B,CAAC,EAAE,QAAQ,EAAE;;CAAA,qBAOxD"}
@@ -0,0 +1,10 @@
1
+ import React, { useReducer } from 'react';
2
+ import { initialTagManagementState, TagManagementReducer, } from '../reducers/TagManagmentReducer';
3
+ const initialDispatchContext = null;
4
+ export const TagManagementStateContext = React.createContext(initialTagManagementState);
5
+ export const TagManagementDispatchContext = React.createContext(initialDispatchContext);
6
+ export function TagManagementContextProvider({ children }) {
7
+ const [tagManagementState, dispatch] = useReducer(TagManagementReducer, initialTagManagementState);
8
+ return (React.createElement(TagManagementStateContext.Provider, { value: Object.assign({}, tagManagementState) },
9
+ React.createElement(TagManagementDispatchContext.Provider, { value: dispatch }, children)));
10
+ }
@@ -0,0 +1,27 @@
1
+ import { ITag, ITagPostBody, ITagPutBody, ITopContentUpdateTagBodyItem } from '@cee-eng/hydrajs/@types/models/tagModels';
2
+ import { IAction, IApiResponseDetails } from '@rh-support/types/shared';
3
+ export declare enum TagManagementReducerConstants {
4
+ getAllTags = "getAllTags",
5
+ createNewTag = "createNewTag",
6
+ updateTag = "updateTag",
7
+ deleteTag = "deleteTag",
8
+ resetTags = "resetTags"
9
+ }
10
+ interface ITagItemState extends ITag {
11
+ numberOfLinkedContents?: number;
12
+ }
13
+ export interface ITagManagementState {
14
+ tagResponse: IApiResponseDetails<ITag[]>;
15
+ tags: ITagItemState[];
16
+ }
17
+ export declare const initialTagManagementState: ITagManagementState;
18
+ type IActionType = IAction<TagManagementReducerConstants, ITagManagementState>;
19
+ export type TagManagementDisptachType = (value: IActionType) => void;
20
+ export declare const TagManagementReducer: (state: ITagManagementState, action: IActionType) => ITagManagementState;
21
+ export declare const fetchTopContentTags: (dispatch: TagManagementDisptachType) => Promise<void>;
22
+ export declare const createNewTags: (dispatch: TagManagementDisptachType, tags: ITagPostBody[]) => Promise<void>;
23
+ export declare const updateTag: (dispatch: TagManagementDisptachType, tag: ITagPutBody, tagsState: ITagItemState[]) => Promise<void>;
24
+ export declare const deleteTag: (dispatch: TagManagementDisptachType, deletedTag: ITag, tagManagementState: ITagManagementState) => Promise<void>;
25
+ export declare const updateTopContentWithTags: (dispatch: TagManagementDisptachType, content: ITopContentUpdateTagBodyItem, tagManagementState: ITagManagementState) => Promise<void>;
26
+ export {};
27
+ //# sourceMappingURL=TagManagmentReducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagManagmentReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/TagManagmentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,4BAA4B,EAC/B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGxE,oBAAY,6BAA6B;IACrC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,SAAS,cAAc;CAC1B;AAED,UAAU,aAAc,SAAQ,IAAI;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACnC;AACD,MAAM,WAAW,mBAAmB;IAChC,WAAW,EAAE,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC;IACzC,IAAI,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,eAAO,MAAM,yBAAyB,EAAE,mBAGvC,CAAC;AAEF,KAAK,WAAW,GAAG,OAAO,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;AAC/E,MAAM,MAAM,yBAAyB,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAErE,eAAO,MAAM,oBAAoB,UAAW,mBAAmB,0BAAwB,mBAsBtF,CAAC;AAEF,eAAO,MAAM,mBAAmB,aAAoB,yBAAyB,kBAuC5E,CAAC;AAEF,eAAO,MAAM,aAAa,aAAoB,yBAAyB,QAAQ,YAAY,EAAE,kBAU5F,CAAC;AAEF,eAAO,MAAM,SAAS,aAAoB,yBAAyB,OAAO,WAAW,aAAa,aAAa,EAAE,kBAYhH,CAAC;AAEF,eAAO,MAAM,SAAS,aACR,yBAAyB,cACvB,IAAI,sBACI,mBAAmB,kBAc1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,aACvB,yBAAyB,WAC1B,4BAA4B,sBACjB,mBAAmB,kBAO1C,CAAC"}
@@ -0,0 +1,127 @@
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 { pcm } from '@cee-eng/hydrajs';
11
+ import { getApiResourceObject } from '@rh-support/utils';
12
+ export var TagManagementReducerConstants;
13
+ (function (TagManagementReducerConstants) {
14
+ TagManagementReducerConstants["getAllTags"] = "getAllTags";
15
+ TagManagementReducerConstants["createNewTag"] = "createNewTag";
16
+ TagManagementReducerConstants["updateTag"] = "updateTag";
17
+ TagManagementReducerConstants["deleteTag"] = "deleteTag";
18
+ TagManagementReducerConstants["resetTags"] = "resetTags";
19
+ })(TagManagementReducerConstants || (TagManagementReducerConstants = {}));
20
+ export const initialTagManagementState = {
21
+ tagResponse: getApiResourceObject([]),
22
+ tags: [],
23
+ };
24
+ export const TagManagementReducer = (state, action) => {
25
+ var _a, _b, _c, _d, _e;
26
+ switch (action.type) {
27
+ case TagManagementReducerConstants.resetTags: {
28
+ return initialTagManagementState;
29
+ }
30
+ case TagManagementReducerConstants.getAllTags: {
31
+ return Object.assign(Object.assign({}, state), { tagResponse: (_a = action === null || action === void 0 ? void 0 : action.payload) === null || _a === void 0 ? void 0 : _a.tagResponse, tags: (_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.tags });
32
+ }
33
+ case TagManagementReducerConstants.createNewTag: {
34
+ return Object.assign(Object.assign({}, state), { tags: [...state.tags, ...(_c = action === null || action === void 0 ? void 0 : action.payload) === null || _c === void 0 ? void 0 : _c.tags], tagResponse: getApiResourceObject([...state.tags, ...(_d = action === null || action === void 0 ? void 0 : action.payload) === null || _d === void 0 ? void 0 : _d.tags]) });
35
+ }
36
+ case TagManagementReducerConstants.updateTag: {
37
+ return Object.assign(Object.assign({}, state), { tags: (_e = action === null || action === void 0 ? void 0 : action.payload) === null || _e === void 0 ? void 0 : _e.tags });
38
+ }
39
+ default: {
40
+ return state;
41
+ }
42
+ }
43
+ };
44
+ export const fetchTopContentTags = (dispatch) => __awaiter(void 0, void 0, void 0, function* () {
45
+ try {
46
+ dispatch({
47
+ type: TagManagementReducerConstants.getAllTags,
48
+ payload: {
49
+ tagResponse: getApiResourceObject([], true),
50
+ tags: [],
51
+ },
52
+ });
53
+ const [tagsResponse, tagsWithLinkedContentCount] = yield Promise.all([
54
+ pcm.topContentTag.getTopContentTags({}),
55
+ pcm.topContentTag.getAllLinkedTags(),
56
+ ]);
57
+ const tags = tagsResponse.map((tag) => {
58
+ const contentCount = tagsWithLinkedContentCount.find((t) => t.tagId === tag.id);
59
+ return Object.assign(Object.assign({}, tag), { numberOfLinkedContents: contentCount ? contentCount.numberOfLinkedContents : 0 });
60
+ });
61
+ dispatch({
62
+ type: TagManagementReducerConstants.getAllTags,
63
+ payload: {
64
+ tagResponse: getApiResourceObject(tags, false),
65
+ tags,
66
+ },
67
+ });
68
+ }
69
+ catch (err) {
70
+ dispatch({
71
+ type: TagManagementReducerConstants.getAllTags,
72
+ payload: {
73
+ tagResponse: getApiResourceObject([], false, true, err.message),
74
+ tags: [],
75
+ },
76
+ });
77
+ }
78
+ });
79
+ export const createNewTags = (dispatch, tags) => __awaiter(void 0, void 0, void 0, function* () {
80
+ try {
81
+ const response = yield pcm.topContentTag.postTopContentTags(tags);
82
+ dispatch({
83
+ type: TagManagementReducerConstants.createNewTag,
84
+ payload: { tags: response.tags },
85
+ });
86
+ }
87
+ catch (err) {
88
+ dispatch({ type: TagManagementReducerConstants.createNewTag, payload: { tags: [] } });
89
+ }
90
+ });
91
+ export const updateTag = (dispatch, tag, tagsState) => __awaiter(void 0, void 0, void 0, function* () {
92
+ try {
93
+ const { tags: editedTags } = yield pcm.topContentTag.patchTopContentTag([tag]);
94
+ const updatedTag = editedTags[0];
95
+ const updatedTagsState = tagsState.map((tag) => (tag.id === updatedTag.id ? Object.assign(Object.assign({}, tag), updatedTag) : tag));
96
+ dispatch({
97
+ type: TagManagementReducerConstants.updateTag,
98
+ payload: { tags: updatedTagsState, tagResponse: getApiResourceObject(updatedTagsState) },
99
+ });
100
+ }
101
+ catch (err) {
102
+ console.log(err);
103
+ }
104
+ });
105
+ export const deleteTag = (dispatch, deletedTag, tagManagementState) => __awaiter(void 0, void 0, void 0, function* () {
106
+ try {
107
+ yield pcm.topContentTag.deleteTopContentTag(deletedTag.id);
108
+ const updatedTags = tagManagementState.tags.filter((t) => t.id !== deletedTag.id);
109
+ dispatch({
110
+ type: TagManagementReducerConstants.updateTag,
111
+ payload: {
112
+ tags: updatedTags,
113
+ },
114
+ });
115
+ }
116
+ catch (err) {
117
+ console.log(err);
118
+ }
119
+ });
120
+ export const updateTopContentWithTags = (dispatch, content, tagManagementState) => __awaiter(void 0, void 0, void 0, function* () {
121
+ try {
122
+ yield pcm.topContentTag.updateTagsOfTopContent({ topContents: [content] });
123
+ }
124
+ catch (err) {
125
+ console.log(err);
126
+ }
127
+ });
@@ -2,6 +2,7 @@ import { IProduct as IHydraProduct, IProduct } from '@cee-eng/hydrajs/@types/mod
2
2
  import { ITopContent, ITopContentCategory, ITopContentList, ITopContentResourceUsagesResponse } from '@cee-eng/hydrajs/@types/models/topContent/topContentModel';
3
3
  import { IAction, IApiResponseDetails } from '@rh-support/types/shared';
4
4
  export interface ITopContentItemState extends ITopContent {
5
+ tagList?: (number | string)[];
5
6
  mode?: ContentMode;
6
7
  isAttentionNeeded?: boolean;
7
8
  }
@@ -92,9 +93,9 @@ export declare const fetchTopContentRecourseUsage: (dispatch: TopContentReducerD
92
93
  export declare const addTopContent: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], categoryId: number) => void;
93
94
  export declare const deleteTopContent: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], categoryId: number, topContentId: number) => Promise<never>;
94
95
  export declare const removeTopContent: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], categoryId: number, i: number) => void;
95
- export declare const saveAddedNewSectionContents: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], selectedCategory: ITopContentCategory, selectedProduct: Partial<IProduct>, selectedVersion: string, isCatOnlyForMajorVersion: boolean, newContent: any, isCreatingNewSet?: boolean) => Promise<never>;
96
- export declare const saveAddToTopContent: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], id: number, categoryId: number, content: ITopContentItemState, index: number) => Promise<never>;
97
- export declare const saveChangeInCategoryContent: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], categoryId: number, content: ITopContentItemState) => Promise<never>;
96
+ export declare const saveAddedNewSectionContents: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], selectedCategory: ITopContentCategory, selectedProduct: Partial<IProduct>, selectedVersion: string, isCatOnlyForMajorVersion: boolean, newContent: any, isCreatingNewSet?: boolean) => Promise<import("@cee-eng/hydrajs/@types/models/topContent/topContentModel").ITopContentBody>;
97
+ export declare const saveAddToTopContent: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], id: number, categoryId: number, content: ITopContentItemState, index: number) => Promise<import("@cee-eng/hydrajs/@types/models/topContent/topContentModel").ITopContentBody>;
98
+ export declare const saveChangeInCategoryContent: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], categoryId: number, content: ITopContentItemState, deletedTags?: any[]) => Promise<never>;
98
99
  export declare const reArrangeContent: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[], categoryId: number) => Promise<never>;
99
100
  export declare const reArrangeCategory: (dispatch: TopContentReducerDispatchType, topContentEditState: ITopContentEditState[]) => Promise<never>;
100
101
  export declare const fetchCategories: (dispatch: TopContentReducerDispatchType) => Promise<never>;
@@ -1 +1 @@
1
- {"version":3,"file":"TopContentReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/TopContentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,EACH,WAAW,EAEX,mBAAmB,EACnB,eAAe,EAGf,iCAAiC,EAEpC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAOxE,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACrD,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;EAOE;AACF,UAAU,YAAY;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC/B;AAED,MAAM,WAAW,oCAAoC;IACjD,EAAE,E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A2B,aAC1B,6BAA6B,uBAClB,oBAAoB,EAAE,oBACzB,mBAAmB,mBACpB,QAAQ,QAAQ,CAAC,mBACjB,MAAM,4BACG,OAAO,cACrB,GAAG,qBACG,OAAO,iGAoE5B,CAAC;AAGF,eAAO,MAAM,mBAAmB,aAClB,6BAA6B,uBAClB,oBAAoB,EAAE,MACvC,MAAM,cACE,MAAM,WACT,oBAAoB,SACtB,MAAM,iGA2DhB,CAAC;AAGF,eAAO,MAAM,2BAA2B,aAC1B,6BAA6B,uBAClB,oBAAoB,EAAE,cAC/B,MAAM,WACT,oBAAoB,gBACf,GAAG,EAAE,mBAqDtB,CAAC;AAGF,eAAO,MAAM,gBAAgB,aACf,6BAA6B,uBAClB,oBAAoB,EAAE,cAC/B,MAAM,mBA+BrB,CAAC;AAGF,eAAO,MAAM,iBAAiB,aAChB,6BAA6B,uBAClB,oBAAoB,EAAE,mBA2B9C,CAAC;AAEF,eAAO,MAAM,eAAe,aAAoB,6BAA6B,mBAwB5E,CAAC;AAEF,eAAO,MAAM,sBAAsB,aAAc,6BAA6B,uBAAuB,OAAO,SAK3G,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAc,6BAA6B,SAKxE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aACzB,6BAA6B,eAC1B,MAAM,WACV,MAAM,kBAsBlB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aACzB,6BAA6B,cAC3B,qBAAqB,gBACnB,MAAM,mBAavB,CAAC"}
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { pcm } from '@cee-eng/hydrajs';
11
11
  import { getApiResourceObject, getVersion } from '@rh-support/utils';
12
+ import { isEmpty } from 'lodash';
12
13
  import cloneDeep from 'lodash/cloneDeep';
13
14
  import { intialTopContentContext } from '../context/TopContentProvider';
14
15
  import { getContentUrls } from './TopContentHelpers';
@@ -359,6 +360,7 @@ export const saveAddedNewSectionContents = (dispatch, topContentEditState, selec
359
360
  contentUrls: getContentUrls(topContentEditState),
360
361
  },
361
362
  });
363
+ return res;
362
364
  }
363
365
  catch (e) {
364
366
  console.log(e);
@@ -403,6 +405,7 @@ export const saveAddToTopContent = (dispatch, topContentEditState, id, categoryI
403
405
  contentUrls: getContentUrls(topContentEditState),
404
406
  },
405
407
  });
408
+ return res;
406
409
  }
407
410
  catch (e) {
408
411
  console.log(e);
@@ -410,21 +413,26 @@ export const saveAddToTopContent = (dispatch, topContentEditState, id, categoryI
410
413
  }
411
414
  });
412
415
  // user saves content updates
413
- export const saveChangeInCategoryContent = (dispatch, topContentEditState, categoryId, content) => __awaiter(void 0, void 0, void 0, function* () {
416
+ export const saveChangeInCategoryContent = (dispatch, topContentEditState, categoryId, content, deletedTags) => __awaiter(void 0, void 0, void 0, function* () {
414
417
  const toUpdate = {
415
418
  id: content.topContentId,
416
419
  contentTitle: content.contentTitle,
417
420
  contentUrl: content.contentUrl,
418
421
  contentRank: content.contentRank,
422
+ tagList: content.tagList, // list of new tagIds which needs to be added in content
423
+ expiryDate: content.expiryDate,
419
424
  isActive: 1,
420
425
  };
421
426
  try {
427
+ if (deletedTags && !isEmpty(deletedTags)) {
428
+ yield Promise.all(deletedTags.map((t) => pcm.topContentTag.deleteTagFromTopContent(content.topContentId, t)));
429
+ }
422
430
  const updatedContent = yield pcm.topContent.patchTopContent({ topContents: [toUpdate] });
423
431
  topContentEditState.forEach((cat) => {
424
432
  if (cat.categoryId === categoryId) {
425
433
  const index = cat.content.findIndex((c) => c.topContentId === content.topContentId);
426
434
  if (index !== -1) {
427
- cat.content[index] = Object.assign(Object.assign({}, cat.content[index]), { mode: ContentMode.INITIAL, contentTitle: content.contentTitle, contentUrl: content.contentUrl, updatedBy: updatedContent.topContents[0].updatedBy, updatedOn: updatedContent.topContents[0].updatedOn });
435
+ cat.content[index] = Object.assign(Object.assign({}, cat.content[index]), { mode: ContentMode.INITIAL, contentTitle: content.contentTitle, contentUrl: content.contentUrl, updatedBy: updatedContent.topContents[0].updatedBy, updatedOn: updatedContent.topContents[0].updatedOn, tags: content.tags, expiryDate: content.expiryDate });
428
436
  }
429
437
  }
430
438
  });
@@ -41,10 +41,15 @@
41
41
  display: flex;
42
42
  -ms-flex-direction: column;
43
43
  flex-direction: column;
44
+ flex-wrap: wrap;
44
45
  padding: 1rem 1.2rem;
45
46
  background-color: #f0f0f0;
46
47
  border: 1px solid #d2d2d2;
47
48
 
49
+ .toolbar-content {
50
+ width: 49%;
51
+ }
52
+
48
53
  label {
49
54
  font-size: 14px;
50
55
  margin-bottom: 0;
@@ -176,6 +181,7 @@
176
181
 
177
182
  .pf-v5-c-tabs__item.pf-m-current {
178
183
  background-color: white;
184
+ min-width: 200px;
179
185
  a {
180
186
  color: black;
181
187
  }
@@ -212,6 +218,28 @@
212
218
  }
213
219
  }
214
220
 
221
+ #manage-expired-content {
222
+ .expired-content-manage-wrapper {
223
+ border: 1px solid #ccc;
224
+ border-top: none;
225
+
226
+ dt {
227
+ margin: 0;
228
+ }
229
+ }
230
+ }
231
+
232
+ #tags-manager-content {
233
+ .tags-manager-wrapper {
234
+ border: 1px solid #ccc;
235
+ border-top: none;
236
+
237
+ dt {
238
+ margin: 0;
239
+ }
240
+ }
241
+ }
242
+
215
243
  // specific overrides under manage because of a different implementation
216
244
  .pf-v5-c-select {
217
245
  .pf-v5-c-select__toggle-wrapper > form:first-child {
@@ -148,6 +148,30 @@ div.pf-v5-c-pagination__nav-page-select {
148
148
  border-bottom: 1px solid black;
149
149
  }
150
150
 
151
+ .pf-v5-c-chip {
152
+ .pf-v5-svg {
153
+ font-size: 12px;
154
+ }
155
+ }
156
+
157
+ .pf-v5-c-switch__label {
158
+ color: black !important;
159
+ font-size: 16px;
160
+ font-weight: 400;
161
+ outline: none !important;
162
+ }
163
+
164
+ .pf-v5-c-menu__content {
165
+ width: 100%;
166
+ }
167
+
151
168
  .pf-v5-c-accordion .pf-v5-c-accordion__toggle {
152
169
  padding: 1rem !important;
153
170
  }
171
+
172
+ .pf-v5-c-chip-group__list {
173
+ padding: 0;
174
+ .pf-v5-c-chip-group__list-item {
175
+ margin: 0;
176
+ }
177
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/manage",
3
- "version": "2.1.83",
3
+ "version": "2.1.85",
4
4
  "description": "Customer Support Manage App",
5
5
  "author": "Jordan Eudy <jeudy100@gmail.com>",
6
6
  "license": "ISC",
@@ -45,7 +45,7 @@
45
45
  "prepublishOnly": "npm run build"
46
46
  },
47
47
  "peerDependencies": {
48
- "@cee-eng/hydrajs": "4.17.17",
48
+ "@cee-eng/hydrajs": "4.17.21",
49
49
  "@patternfly/patternfly": "5.1.0",
50
50
  "@patternfly/react-core": "5.1.1",
51
51
  "@patternfly/react-table": "5.1.1",
@@ -75,16 +75,16 @@
75
75
  "typescript": "^5.3.3"
76
76
  },
77
77
  "dependencies": {
78
- "@cee-eng/hydrajs": "4.17.17",
78
+ "@cee-eng/hydrajs": "4.17.21",
79
79
  "@patternfly/patternfly": "5.1.0",
80
80
  "@patternfly/react-core": "5.1.1",
81
81
  "@patternfly/react-table": "5.1.1",
82
- "@rh-support/components": "2.1.62",
83
- "@rh-support/configs": "2.0.19",
84
- "@rh-support/react-context": "2.1.70",
82
+ "@rh-support/components": "2.1.64",
83
+ "@rh-support/configs": "2.0.20",
84
+ "@rh-support/react-context": "2.1.72",
85
85
  "@rh-support/types": "2.0.4",
86
- "@rh-support/user-permissions": "2.1.45",
87
- "@rh-support/utils": "2.1.34",
86
+ "@rh-support/user-permissions": "2.1.46",
87
+ "@rh-support/utils": "2.1.35",
88
88
  "@types/react-beautiful-dnd": "^13.0.0",
89
89
  "lodash": ">=4.17.15",
90
90
  "mark.js": "^8.11.1",
@@ -102,5 +102,5 @@
102
102
  "defaults and supports es6-module",
103
103
  "maintained node versions"
104
104
  ],
105
- "gitHead": "ecb9820a2fe40793e79c0f9f4786ec657070fe64"
105
+ "gitHead": "ebd66de0a7cb1d33da81051cd7a554540806a510"
106
106
  }