@rh-support/manage 0.2.70 → 0.2.73
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/reducers/TopContentHelpers.d.ts +1 -1
- package/lib/esm/reducers/TopContentHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/TopContentHelpers.js +7 -3
- package/lib/esm/reducers/TopContentReducer.d.ts.map +1 -1
- package/lib/esm/reducers/TopContentReducer.js +6 -3
- package/package.json +9 -9
|
@@ -6,7 +6,7 @@ export declare const getContentUrls: (contentsArray: any) => any;
|
|
|
6
6
|
* Iterate all categories and its content to with content usage data to map and flag category and its content needs attention
|
|
7
7
|
*
|
|
8
8
|
* 1. Find the outlier from the category usage data.
|
|
9
|
-
* 2. Compare and filter category usage with outlier lower boundary.
|
|
9
|
+
* 2. Compare and filter category usage with outlier lower boundary and thirty date range.
|
|
10
10
|
* 3. Use filtered data with actually category data to add need attention flag
|
|
11
11
|
* @param categories
|
|
12
12
|
* @param categoryUsage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/TopContentHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iCAAiC,EAEpC,MAAM,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"TopContentHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/TopContentHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iCAAiC,EAEpC,MAAM,2DAA2D,CAAC;AAMnE,OAAO,EAAE,oBAAoB,EAAwB,MAAM,qBAAqB,CAAC;AAEjF,eAAO,MAAM,gBAAgB,eAAgB,MAAM,WASlD,CAAC;AAEF,eAAO,MAAM,cAAc,6BAe1B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,eACb,oBAAoB,EAAE,iBACnB,iCAAiC,mBAC/B,MAAM,2BAqC1B,CAAC;AAEF,eAAO,MAAM,cAAc,oBAAqB,MAAM,KAAG,OAExD,CAAC"}
|
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { getAccessHostname } from '@rh-support/api';
|
|
13
|
-
import { outlier } from '@rh-support/utils';
|
|
13
|
+
import { addDaysToDate, isFutureDate, outlier } from '@rh-support/utils';
|
|
14
14
|
import isEmpty from 'lodash/isEmpty';
|
|
15
15
|
export const getTopContentUrl = (contentUrl) => {
|
|
16
16
|
// There is some data urls (e.g. /solutions/articles/etc.) that aren't valid urls
|
|
@@ -43,7 +43,7 @@ export const getContentUrls = (contentsArray) => {
|
|
|
43
43
|
* Iterate all categories and its content to with content usage data to map and flag category and its content needs attention
|
|
44
44
|
*
|
|
45
45
|
* 1. Find the outlier from the category usage data.
|
|
46
|
-
* 2. Compare and filter category usage with outlier lower boundary.
|
|
46
|
+
* 2. Compare and filter category usage with outlier lower boundary and thirty date range.
|
|
47
47
|
* 3. Use filtered data with actually category data to add need attention flag
|
|
48
48
|
* @param categories
|
|
49
49
|
* @param categoryUsage
|
|
@@ -60,7 +60,11 @@ export const flagContentUsage = (categories, categoryUsage, selectedVersion) =>
|
|
|
60
60
|
let isAttentionNeededOnCategory = false;
|
|
61
61
|
const contentWithFlag = content === null || content === void 0 ? void 0 : content.map((_a) => {
|
|
62
62
|
var { topContentId } = _a, rest = __rest(_a, ["topContentId"]);
|
|
63
|
-
const
|
|
63
|
+
const isContentLowerPerforming = filteredResourceUsages.some(({ resourceEntityId }) => +resourceEntityId === topContentId);
|
|
64
|
+
const updatedDatePlusThirtyDays = addDaysToDate({ days: 30, date: rest.updatedOn });
|
|
65
|
+
const isDateWithinThirtyDate = isFutureDate(updatedDatePlusThirtyDays.toString());
|
|
66
|
+
// Here we need to check that is content performing low plus edited date is outside 30 days.
|
|
67
|
+
const isAttentionNeeded = isContentLowerPerforming && !isDateWithinThirtyDate;
|
|
64
68
|
!isAttentionNeededOnCategory && (isAttentionNeededOnCategory = isAttentionNeeded);
|
|
65
69
|
return Object.assign(Object.assign({}, rest), { topContentId,
|
|
66
70
|
isAttentionNeeded });
|
|
@@ -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,EACpC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;
|
|
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,EACpC,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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mBACpB,QAAQ,QAAQ,CAAC,mBACjB,MAAM,4BACG,OAAO,cACrB,GAAG,mBA2DlB,CAAC;AAGF,eAAO,MAAM,mBAAmB,aAClB,6BAA6B,uBAClB,oBAAoB,EAAE,MACvC,MAAM,cACE,MAAM,WACT,oBAAoB,SACtB,MAAM,mBA2ChB,CAAC;AAGF,eAAO,MAAM,2BAA2B,aAC1B,6BAA6B,uBAClB,oBAAoB,EAAE,cAC/B,MAAM,WACT,oBAAoB,SACtB,MAAM,mBAyChB,CAAC;AAGF,eAAO,MAAM,gBAAgB,aACf,6BAA6B,uBAClB,oBAAoB,EAAE,cAC/B,MAAM,mBA+BrB,CAAC;AAGF,eAAO,MAAM,iBAAiB,wBAA+B,oBAAoB,EAAE,oGAiBlF,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"}
|
|
@@ -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 { cloneDeep } from 'lodash';
|
|
12
13
|
import { intialTopContentContext } from '../context/TopContentProvider';
|
|
13
14
|
import { getContentUrls } from './TopContentHelpers';
|
|
14
15
|
export var ContentMode;
|
|
@@ -407,13 +408,15 @@ export const saveChangeInCategoryContent = (dispatch, topContentEditState, categ
|
|
|
407
408
|
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 });
|
|
408
409
|
}
|
|
409
410
|
});
|
|
411
|
+
// We need to clone deep current state to re-render and re-calculate top content resource usage calculations
|
|
412
|
+
const clonedTopContentEditState = cloneDeep(topContentEditState);
|
|
410
413
|
// update both current state and original get state
|
|
411
414
|
dispatch({
|
|
412
415
|
type: TopContentReducerConstants.changeTopContentStateOnSave,
|
|
413
416
|
payload: {
|
|
414
|
-
topContentEditState,
|
|
415
|
-
topContentResponse: getApiResourceObject(
|
|
416
|
-
contentUrls: getContentUrls(
|
|
417
|
+
topContentEditState: clonedTopContentEditState,
|
|
418
|
+
topContentResponse: getApiResourceObject(clonedTopContentEditState),
|
|
419
|
+
contentUrls: getContentUrls(clonedTopContentEditState),
|
|
417
420
|
},
|
|
418
421
|
});
|
|
419
422
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.73",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"not op_mini all"
|
|
52
52
|
],
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@cee-eng/hydrajs": "4.
|
|
54
|
+
"@cee-eng/hydrajs": "4.9.1",
|
|
55
55
|
"@patternfly/patternfly": "4.185.1",
|
|
56
56
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
57
57
|
"@patternfly/pfe-collapse": "1.12.3",
|
|
@@ -89,20 +89,20 @@
|
|
|
89
89
|
"typescript": "4.3.5"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@cee-eng/hydrajs": "4.
|
|
92
|
+
"@cee-eng/hydrajs": "4.9.1",
|
|
93
93
|
"@patternfly/patternfly": "4.185.1",
|
|
94
94
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
95
95
|
"@patternfly/pfe-collapse": "1.12.3",
|
|
96
96
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
97
97
|
"@patternfly/react-core": "4.202.16",
|
|
98
98
|
"@patternfly/react-table": "4.71.16",
|
|
99
|
-
"@rh-support/api": "0.3.
|
|
100
|
-
"@rh-support/components": "1.1.
|
|
99
|
+
"@rh-support/api": "0.3.15",
|
|
100
|
+
"@rh-support/components": "1.1.59",
|
|
101
101
|
"@rh-support/configs": "0.2.5",
|
|
102
|
-
"@rh-support/react-context": "0.2.
|
|
102
|
+
"@rh-support/react-context": "0.2.60",
|
|
103
103
|
"@rh-support/types": "0.2.0",
|
|
104
|
-
"@rh-support/user-permissions": "0.2.
|
|
105
|
-
"@rh-support/utils": "0.2.
|
|
104
|
+
"@rh-support/user-permissions": "0.2.47",
|
|
105
|
+
"@rh-support/utils": "0.2.36",
|
|
106
106
|
"@types/react-beautiful-dnd": "^13.0.0",
|
|
107
107
|
"i18next": ">=17.0.1",
|
|
108
108
|
"lodash": ">=4.17.15",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"react-i18next": ">=10.11.0",
|
|
114
114
|
"react-router-dom": ">=5.1.2"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "c5cd879a2db2a9d1761c8a62eaac17d94a9f1204"
|
|
117
117
|
}
|