@rh-support/manage 2.1.86 → 2.1.88
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/components/ManageTags/TagsManager.d.ts.map +1 -1
- package/lib/esm/components/ManageTags/TagsManager.js +12 -4
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +2 -2
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +9 -1
- package/lib/esm/reducers/TagManagmentReducer.d.ts +1 -1
- package/lib/esm/reducers/TagManagmentReducer.d.ts.map +1 -1
- package/lib/esm/reducers/TagManagmentReducer.js +15 -5
- package/lib/esm/reducers/TopContentReducer.js +11 -11
- package/package.json +6 -6
|
@@ -1 +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,
|
|
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,sBAuXlC"}
|
|
@@ -57,8 +57,16 @@ export default function TagsManager() {
|
|
|
57
57
|
});
|
|
58
58
|
return filteredIds;
|
|
59
59
|
}, [tagSearchTerm, tags]);
|
|
60
|
+
const getTopContentTags = () => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
try {
|
|
62
|
+
yield fetchTopContentTags(dispatch);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
ToastNotification.addDangerMessage(t('Error loading tag details'));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
60
68
|
useEffect(() => {
|
|
61
|
-
|
|
69
|
+
getTopContentTags();
|
|
62
70
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
71
|
}, []);
|
|
64
72
|
const onCreateNewTag = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -74,7 +82,7 @@ export default function TagsManager() {
|
|
|
74
82
|
}
|
|
75
83
|
catch (err) {
|
|
76
84
|
console.log({ err });
|
|
77
|
-
ToastNotification.
|
|
85
|
+
ToastNotification.addDangerMessage(t('Error creating tag'));
|
|
78
86
|
}
|
|
79
87
|
finally {
|
|
80
88
|
setIsCreatingNewTag(false);
|
|
@@ -106,7 +114,7 @@ export default function TagsManager() {
|
|
|
106
114
|
}
|
|
107
115
|
catch (err) {
|
|
108
116
|
console.log(err);
|
|
109
|
-
ToastNotification.
|
|
117
|
+
ToastNotification.addDangerMessage(t('Error editing tag'));
|
|
110
118
|
}
|
|
111
119
|
finally {
|
|
112
120
|
setisEditingTagName(false);
|
|
@@ -133,7 +141,7 @@ export default function TagsManager() {
|
|
|
133
141
|
}
|
|
134
142
|
catch (err) {
|
|
135
143
|
console.log(err);
|
|
136
|
-
ToastNotification.
|
|
144
|
+
ToastNotification.addDangerMessage(t('Error deleting tag'));
|
|
137
145
|
}
|
|
138
146
|
finally {
|
|
139
147
|
setDeleteTagModalOpen(false);
|
|
@@ -51,7 +51,7 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
|
|
|
51
51
|
const topContentDispatch = useTopContentDispatchContext();
|
|
52
52
|
const [localContentUrl, setLocalContentUrl] = useState(content.contentUrl);
|
|
53
53
|
const [localContentTitle, setLocalContentTitle] = useState(content.contentTitle);
|
|
54
|
-
const [localSelectedTags, setLocalSelectedTags] = useState(content.tags);
|
|
54
|
+
const [localSelectedTags, setLocalSelectedTags] = useState(content.tags || []);
|
|
55
55
|
const [newCategory, setNewCategory] = useState(undefined);
|
|
56
56
|
const [contentTitleIsValid, setContentTitleIsValid] = useState(true);
|
|
57
57
|
const [contentUrlIsValid, setContentUrlIsValid] = useState(true);
|
|
@@ -248,7 +248,7 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
|
|
|
248
248
|
useEffect(() => {
|
|
249
249
|
setLocalContentTitle(content.contentTitle);
|
|
250
250
|
setLocalContentUrl(content.contentUrl);
|
|
251
|
-
setLocalSelectedTags(content.tags);
|
|
251
|
+
setLocalSelectedTags(content.tags || []);
|
|
252
252
|
}, [content]);
|
|
253
253
|
// To check if input has spaces
|
|
254
254
|
const doesInputHasSpaces = isEmpty(localContentTitle.trim());
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,sBAqW/B"}
|
|
@@ -70,8 +70,16 @@ export function TopContentEditor() {
|
|
|
70
70
|
!isSearchModeEnabled && setFilteredByQueryTC(flagContentEditState);
|
|
71
71
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
72
|
}, [flagContentEditState]);
|
|
73
|
+
const getTopContentTags = () => __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
try {
|
|
75
|
+
yield fetchTopContentTags(tagManagerDispatch, false);
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
ToastNotification.addDangerMessage(t('Error loading tag details'));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
73
81
|
useEffect(() => {
|
|
74
|
-
|
|
82
|
+
getTopContentTags();
|
|
75
83
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
84
|
}, []);
|
|
77
85
|
const onAddCategory = (isMajorVersionOnly, isCreatingNewSet = false, version, hasMajorContentCreatingMinorContent) => {
|
|
@@ -18,7 +18,7 @@ export declare const initialTagManagementState: ITagManagementState;
|
|
|
18
18
|
type IActionType = IAction<TagManagementReducerConstants, ITagManagementState>;
|
|
19
19
|
export type TagManagementDisptachType = (value: IActionType) => void;
|
|
20
20
|
export declare const TagManagementReducer: (state: ITagManagementState, action: IActionType) => ITagManagementState;
|
|
21
|
-
export declare const fetchTopContentTags: (dispatch: TagManagementDisptachType) => Promise<
|
|
21
|
+
export declare const fetchTopContentTags: (dispatch: TagManagementDisptachType, getAllLinkedTags?: boolean) => Promise<never>;
|
|
22
22
|
export declare const createNewTags: (dispatch: TagManagementDisptachType, tags: ITagPostBody[]) => Promise<void>;
|
|
23
23
|
export declare const updateTag: (dispatch: TagManagementDisptachType, tag: ITagPutBody, tagsState: ITagItemState[]) => Promise<void>;
|
|
24
24
|
export declare const deleteTag: (dispatch: TagManagementDisptachType, deletedTag: ITag, tagManagementState: ITagManagementState) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagManagmentReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/TagManagmentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,IAAI,
|
|
1
|
+
{"version":3,"file":"TagManagmentReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/TagManagmentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,IAAI,EAEJ,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,qBAAoB,OAAO,mBAkDvG,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"}
|
|
@@ -41,7 +41,7 @@ export const TagManagementReducer = (state, action) => {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
export const fetchTopContentTags = (dispatch) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
+
export const fetchTopContentTags = (dispatch, getAllLinkedTags = true) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
45
|
try {
|
|
46
46
|
dispatch({
|
|
47
47
|
type: TagManagementReducerConstants.getAllTags,
|
|
@@ -50,10 +50,19 @@ export const fetchTopContentTags = (dispatch) => __awaiter(void 0, void 0, void
|
|
|
50
50
|
tags: [],
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
const tagsResponse = yield pcm.topContentTag.getTopContentTags({});
|
|
54
|
+
let tagsWithLinkedContentCount = [];
|
|
55
|
+
if (getAllLinkedTags) {
|
|
56
|
+
try {
|
|
57
|
+
tagsWithLinkedContentCount = yield pcm.topContentTag.getAllLinkedTags();
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
console.log(err);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!Array.isArray(tagsWithLinkedContentCount)) {
|
|
64
|
+
tagsWithLinkedContentCount = [];
|
|
65
|
+
}
|
|
57
66
|
const tags = tagsResponse.map((tag) => {
|
|
58
67
|
const contentCount = tagsWithLinkedContentCount.find((t) => t.tagId === tag.id);
|
|
59
68
|
return Object.assign(Object.assign({}, tag), { numberOfLinkedContents: contentCount ? contentCount.numberOfLinkedContents : 0 });
|
|
@@ -74,6 +83,7 @@ export const fetchTopContentTags = (dispatch) => __awaiter(void 0, void 0, void
|
|
|
74
83
|
tags: [],
|
|
75
84
|
},
|
|
76
85
|
});
|
|
86
|
+
return Promise.reject(err);
|
|
77
87
|
}
|
|
78
88
|
});
|
|
79
89
|
export const createNewTags = (dispatch, tags) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -323,18 +323,18 @@ export const saveAddedNewSectionContents = (dispatch, topContentEditState, selec
|
|
|
323
323
|
minorVersion: isCatOnlyForMajorVersion ? null : versionObj.minor,
|
|
324
324
|
isActive: 1,
|
|
325
325
|
};
|
|
326
|
-
// create the category for version (major/minor)
|
|
327
|
-
const result = yield pcm.topContent.postTopContentMaster([createMasterIdParam]);
|
|
328
|
-
const topContentMasterDataId = result.topContentMasters[0].id;
|
|
329
|
-
const toAdd = {
|
|
330
|
-
topContentMasterDataId,
|
|
331
|
-
contentTitle: newContent.contentTitle,
|
|
332
|
-
contentUrl: newContent.contentUrl,
|
|
333
|
-
categoryName: selectedCategory.categoryName,
|
|
334
|
-
categoryId: selectedCategory.id,
|
|
335
|
-
isActive: 1,
|
|
336
|
-
};
|
|
337
326
|
try {
|
|
327
|
+
// create the category for version (major/minor)
|
|
328
|
+
const result = yield pcm.topContent.postTopContentMaster([createMasterIdParam]);
|
|
329
|
+
const topContentMasterDataId = result.topContentMasters[0].id;
|
|
330
|
+
const toAdd = {
|
|
331
|
+
topContentMasterDataId,
|
|
332
|
+
contentTitle: newContent.contentTitle,
|
|
333
|
+
contentUrl: newContent.contentUrl,
|
|
334
|
+
categoryName: selectedCategory.categoryName,
|
|
335
|
+
categoryId: selectedCategory.id,
|
|
336
|
+
isActive: 1,
|
|
337
|
+
};
|
|
338
338
|
const res = yield pcm.topContent.postTopContent({ topContents: [toAdd] });
|
|
339
339
|
yield pcm.topContentTag.updateTagsOfTopContent({
|
|
340
340
|
topContents: [{ id: res.topContents[0].id, tagList: newContent.tagList }],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.88",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -79,12 +79,12 @@
|
|
|
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.
|
|
82
|
+
"@rh-support/components": "2.1.66",
|
|
83
83
|
"@rh-support/configs": "2.0.20",
|
|
84
|
-
"@rh-support/react-context": "2.1.
|
|
84
|
+
"@rh-support/react-context": "2.1.74",
|
|
85
85
|
"@rh-support/types": "2.0.4",
|
|
86
|
-
"@rh-support/user-permissions": "2.1.
|
|
87
|
-
"@rh-support/utils": "2.1.
|
|
86
|
+
"@rh-support/user-permissions": "2.1.47",
|
|
87
|
+
"@rh-support/utils": "2.1.36",
|
|
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": "
|
|
105
|
+
"gitHead": "61c0c9bde34842643e215fc2b8146d27a2fd2cfd"
|
|
106
106
|
}
|