@rh-support/manage 2.1.98 → 2.1.100
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/ManageExpiredContents/ExpiredContentManager.d.ts.map +1 -1
- package/lib/esm/components/ManageExpiredContents/ExpiredContentManager.js +1 -3
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItem.d.ts.map +1 -1
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItem.js +2 -2
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.d.ts.map +1 -1
- package/lib/esm/components/ManageExpiredContents/ExpiredContentSingleItemView.js +2 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +0 -1
- package/lib/esm/reducers/ExpiredContentReducer.d.ts +2 -1
- package/lib/esm/reducers/ExpiredContentReducer.d.ts.map +1 -1
- package/lib/esm/reducers/ExpiredContentReducer.js +25 -8
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpiredContentManager.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentManager.tsx"],"names":[],"mappings":"AAeA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAUhF,MAAM,CAAC,OAAO,UAAU,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ExpiredContentManager.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentManager.tsx"],"names":[],"mappings":"AAeA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAUhF,MAAM,CAAC,OAAO,UAAU,qBAAqB,sBAmH5C"}
|
|
@@ -13,8 +13,7 @@ import ExpiredContentHeader from './ExpiredContentHeader';
|
|
|
13
13
|
export default function ExipredContentManager() {
|
|
14
14
|
const expiredContentResultsRef = useRef(null);
|
|
15
15
|
const { t } = useTranslation();
|
|
16
|
-
const
|
|
17
|
-
const { expiredContentEditState, expiredContentResponse, filteredTags } = useContext(ExpiredContentStateContext);
|
|
16
|
+
const { expiredContentEditState, expiredContentResponse, filteredTags, showApprochingExpiry } = useContext(ExpiredContentStateContext);
|
|
18
17
|
const { tags: availableTags } = useContext(TagManagementStateContext);
|
|
19
18
|
const dispatch = useContext(ExpiredContentDispatchContext);
|
|
20
19
|
const tagManagerDispatch = useContext(TagManagementDispatchContext);
|
|
@@ -37,7 +36,6 @@ export default function ExipredContentManager() {
|
|
|
37
36
|
return filteredData;
|
|
38
37
|
}, [contentFilteredByQuery, filteredTags]);
|
|
39
38
|
const handleChange = (_event, checked) => {
|
|
40
|
-
setShowApprochingExpiry(checked);
|
|
41
39
|
fetchExpiredContent(dispatch, checked);
|
|
42
40
|
};
|
|
43
41
|
const onTagFilterChange = (tags) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpiredContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentSingleItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,EAEH,eAAe,EACf,wBAAwB,EAE3B,MAAM,sCAAsC,CAAC;AAG9C,UAAU,MAAM;IACZ,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,wBAAwB,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ExpiredContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentSingleItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,EAEH,eAAe,EACf,wBAAwB,EAE3B,MAAM,sCAAsC,CAAC;AAG9C,UAAU,MAAM;IACZ,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,wBAAwB,CAAC;CACtC;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,MAAM,qBA4G7E"}
|
|
@@ -19,7 +19,7 @@ import ExpiredContentSingleItemView from './ExpiredContentSingleItemView';
|
|
|
19
19
|
export default function ExpiredContentSingleItem({ content, category }) {
|
|
20
20
|
var _a, _b;
|
|
21
21
|
const { t } = useTranslation();
|
|
22
|
-
const { expiredContentEditState, filteredTags } = useContext(ExpiredContentStateContext);
|
|
22
|
+
const { expiredContentEditState, filteredTags, showApprochingExpiry } = useContext(ExpiredContentStateContext);
|
|
23
23
|
const dispatch = useContext(ExpiredContentDispatchContext);
|
|
24
24
|
const [isPreview, setIsPreview] = useState(true);
|
|
25
25
|
const [isSaving, setIsSaving] = useState(false);
|
|
@@ -30,7 +30,7 @@ export default function ExpiredContentSingleItem({ content, category }) {
|
|
|
30
30
|
const onSave = (updatedContent, deletedTags) => __awaiter(this, void 0, void 0, function* () {
|
|
31
31
|
try {
|
|
32
32
|
setIsSaving(true);
|
|
33
|
-
yield updateExpiredContent(dispatch, expiredContentEditState, category.categoryId, updatedContent, deletedTags);
|
|
33
|
+
yield updateExpiredContent(dispatch, expiredContentEditState, category.categoryId, updatedContent, deletedTags, showApprochingExpiry);
|
|
34
34
|
editToggle();
|
|
35
35
|
ToastNotification.addSuccessMessage(t('Content updated successfully'));
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpiredContentSingleItemView.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentSingleItemView.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAIhF,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,
|
|
1
|
+
{"version":3,"file":"ExpiredContentSingleItemView.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageExpiredContents/ExpiredContentSingleItemView.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAIhF,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,qBAqQR"}
|
|
@@ -90,7 +90,8 @@ export default function ExpiredContentSingleItemView({ category, content, onCanc
|
|
|
90
90
|
setLocalExpiryDate(str);
|
|
91
91
|
};
|
|
92
92
|
const expiryDateValidator = (date) => {
|
|
93
|
-
|
|
93
|
+
const today = new Date();
|
|
94
|
+
if (date < today)
|
|
94
95
|
return t('Invalid expiry date');
|
|
95
96
|
return '';
|
|
96
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAiB,aAAa,EAAE,MAAM,0CAA0C,CAAC;AA8BtG,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,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,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,6CA2B/C;AAED,eAAO,MAAM,oBAAoB,kDAAmD,MAAM,
|
|
1
|
+
{"version":3,"file":"TopContentSingleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAiB,aAAa,EAAE,MAAM,0CAA0C,CAAC;AA8BtG,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,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,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,6CA2B/C;AAED,eAAO,MAAM,oBAAoB,kDAAmD,MAAM,sBAkiBzF,CAAC"}
|
|
@@ -275,7 +275,6 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
|
|
|
275
275
|
};
|
|
276
276
|
const expiryDateValidator = (date) => {
|
|
277
277
|
const today = new Date();
|
|
278
|
-
today.setHours(0, 0, 0, 0);
|
|
279
278
|
if (date < today)
|
|
280
279
|
return t('Invalid expiry date');
|
|
281
280
|
return '';
|
|
@@ -14,6 +14,7 @@ export interface IExpiredContentState {
|
|
|
14
14
|
expiredContentResponse: IApiResponseDetails<IExpiredContentEditState[]>;
|
|
15
15
|
expiredContentEditState: IExpiredContentEditState[];
|
|
16
16
|
filteredTags: ITag[];
|
|
17
|
+
showApprochingExpiry: boolean;
|
|
17
18
|
}
|
|
18
19
|
export declare const initialExpiredContent: IExpiredContentState;
|
|
19
20
|
export declare enum ExpiredContentReducerConstants {
|
|
@@ -28,7 +29,7 @@ export type ExpiredContentDispatchType = (value: IActionType) => void;
|
|
|
28
29
|
export declare const ExpiredContentReducer: (state: IExpiredContentState, action: IActionType) => IExpiredContentState;
|
|
29
30
|
export declare const isContentExpired: (expiryDate: string | undefined) => boolean;
|
|
30
31
|
export declare const fetchExpiredContent: (dispatch: ExpiredContentDispatchType, fetchApproachingExpiry?: boolean) => Promise<void>;
|
|
31
|
-
export declare const updateExpiredContent: (dispatch: ExpiredContentDispatchType, expiredContentEditState: IExpiredContentEditState[], categoryId: number, content: IExpiredContent, deletedTags?: any[]) => Promise<void>;
|
|
32
|
+
export declare const updateExpiredContent: (dispatch: ExpiredContentDispatchType, expiredContentEditState: IExpiredContentEditState[], categoryId: number, content: IExpiredContent, deletedTags?: any[], showApprochingExpiry?: boolean) => Promise<void>;
|
|
32
33
|
export declare const deleteExpiredContent: (dispatch: ExpiredContentDispatchType, expiredContentEditState: IExpiredContentEditState[], categoryId: number, topContentId: number) => Promise<never>;
|
|
33
34
|
export declare const setExpiredContentFilteredTags: (dispatch: ExpiredContentDispatchType, tags: ITag[]) => void;
|
|
34
35
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpiredContentReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/ExpiredContentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAChE,OAAO,EACH,WAAW,EACX,eAAe,EAElB,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMxE,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAChD,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBACb,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC;IACxF,OAAO,EAAE,eAAe,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACjC,sBAAsB,EAAE,mBAAmB,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACxE,uBAAuB,EAAE,wBAAwB,EAAE,CAAC;IACpD,YAAY,EAAE,IAAI,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpiredContentReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/ExpiredContentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAChE,OAAO,EACH,WAAW,EACX,eAAe,EAElB,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMxE,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAChD,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBACb,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC;IACxF,OAAO,EAAE,eAAe,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACjC,sBAAsB,EAAE,mBAAmB,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACxE,uBAAuB,EAAE,wBAAwB,EAAE,CAAC;IACpD,YAAY,EAAE,IAAI,EAAE,CAAC;IACrB,oBAAoB,EAAE,OAAO,CAAC;CACjC;AAED,eAAO,MAAM,qBAAqB,EAAE,oBAKnC,CAAC;AAEF,oBAAY,8BAA8B;IACtC,iBAAiB,sBAAsB;IACvC,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,yBAAyB,8BAA8B;IACvD,kBAAkB,uBAAuB;CAC5C;AAED,KAAK,WAAW,GAAG,OAAO,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;AACjF,MAAM,MAAM,0BAA0B,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAEtE,eAAO,MAAM,qBAAqB,UAAW,oBAAoB,0BAAwB,oBAiCxF,CAAC;AAEF,eAAO,MAAM,gBAAgB,eAAgB,MAAM,GAAG,SAAS,YAM9D,CAAC;AASF,eAAO,MAAM,mBAAmB,aAClB,0BAA0B,2BACZ,OAAO,kBA8ElC,CAAC;AAEF,eAAO,MAAM,oBAAoB,aACnB,0BAA0B,2BACX,wBAAwB,EAAE,cACvC,MAAM,WACT,eAAe,gBACV,GAAG,EAAE,yBACG,OAAO,kBAmEhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,aACnB,0BAA0B,2BACX,wBAAwB,EAAE,cACvC,MAAM,gBACJ,MAAM,mBAsBvB,CAAC;AAEF,eAAO,MAAM,6BAA6B,aAAc,0BAA0B,QAAQ,IAAI,EAAE,SAK/F,CAAC"}
|
|
@@ -16,6 +16,7 @@ export const initialExpiredContent = {
|
|
|
16
16
|
expiredContentResponse: getApiResourceObject([]),
|
|
17
17
|
expiredContentEditState: [],
|
|
18
18
|
filteredTags: [],
|
|
19
|
+
showApprochingExpiry: false,
|
|
19
20
|
};
|
|
20
21
|
export var ExpiredContentReducerConstants;
|
|
21
22
|
(function (ExpiredContentReducerConstants) {
|
|
@@ -26,22 +27,22 @@ export var ExpiredContentReducerConstants;
|
|
|
26
27
|
ExpiredContentReducerConstants["updateFilteredTags"] = "updateFilteredTags";
|
|
27
28
|
})(ExpiredContentReducerConstants || (ExpiredContentReducerConstants = {}));
|
|
28
29
|
export const ExpiredContentReducer = (state, action) => {
|
|
29
|
-
var _a, _b, _c, _d, _e, _f;
|
|
30
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
30
31
|
switch (action.type) {
|
|
31
32
|
case ExpiredContentReducerConstants.resetExpiredContent: {
|
|
32
33
|
return initialExpiredContent;
|
|
33
34
|
}
|
|
34
35
|
case ExpiredContentReducerConstants.getExpiredContent: {
|
|
35
|
-
return Object.assign(Object.assign({}, state), { expiredContentEditState: [...(_a = action.payload) === null || _a === void 0 ? void 0 : _a.expiredContentEditState], expiredContentResponse: (_b = action.payload) === null || _b === void 0 ? void 0 : _b.expiredContentResponse });
|
|
36
|
+
return Object.assign(Object.assign({}, state), { expiredContentEditState: [...(_a = action.payload) === null || _a === void 0 ? void 0 : _a.expiredContentEditState], expiredContentResponse: (_b = action.payload) === null || _b === void 0 ? void 0 : _b.expiredContentResponse, showApprochingExpiry: (_c = action.payload) === null || _c === void 0 ? void 0 : _c.showApprochingExpiry });
|
|
36
37
|
}
|
|
37
38
|
case ExpiredContentReducerConstants.filterExpiredContent: {
|
|
38
|
-
return Object.assign(Object.assign({}, state), { expiredContentEditState: (
|
|
39
|
+
return Object.assign(Object.assign({}, state), { expiredContentEditState: (_d = action.payload) === null || _d === void 0 ? void 0 : _d.expiredContentEditState });
|
|
39
40
|
}
|
|
40
41
|
case ExpiredContentReducerConstants.updateExpiredContentState: {
|
|
41
|
-
return Object.assign(Object.assign({}, state), { expiredContentEditState: (
|
|
42
|
+
return Object.assign(Object.assign({}, state), { expiredContentEditState: (_e = action.payload) === null || _e === void 0 ? void 0 : _e.expiredContentEditState, expiredContentResponse: (_f = action.payload) === null || _f === void 0 ? void 0 : _f.expiredContentResponse });
|
|
42
43
|
}
|
|
43
44
|
case ExpiredContentReducerConstants.updateFilteredTags: {
|
|
44
|
-
return Object.assign(Object.assign({}, state), { filteredTags: (
|
|
45
|
+
return Object.assign(Object.assign({}, state), { filteredTags: (_g = action.payload) === null || _g === void 0 ? void 0 : _g.filteredTags });
|
|
45
46
|
}
|
|
46
47
|
default: {
|
|
47
48
|
return state;
|
|
@@ -73,6 +74,7 @@ export const fetchExpiredContent = (dispatch, fetchApproachingExpiry = false) =>
|
|
|
73
74
|
payload: {
|
|
74
75
|
expiredContentResponse: getApiResourceObject([], true),
|
|
75
76
|
expiredContentEditState: [],
|
|
77
|
+
showApprochingExpiry: fetchApproachingExpiry,
|
|
76
78
|
},
|
|
77
79
|
});
|
|
78
80
|
const [products, expiredContents] = yield Promise.all([
|
|
@@ -109,6 +111,7 @@ export const fetchExpiredContent = (dispatch, fetchApproachingExpiry = false) =>
|
|
|
109
111
|
payload: {
|
|
110
112
|
expiredContentResponse: getApiResourceObject(cloneDeep(resultGroupedByCategory)),
|
|
111
113
|
expiredContentEditState: resultGroupedByCategory,
|
|
114
|
+
showApprochingExpiry: fetchApproachingExpiry,
|
|
112
115
|
},
|
|
113
116
|
});
|
|
114
117
|
}
|
|
@@ -118,11 +121,12 @@ export const fetchExpiredContent = (dispatch, fetchApproachingExpiry = false) =>
|
|
|
118
121
|
payload: {
|
|
119
122
|
expiredContentResponse: getApiResourceObject([], false, true, err.message),
|
|
120
123
|
expiredContentEditState: [],
|
|
124
|
+
showApprochingExpiry: fetchApproachingExpiry,
|
|
121
125
|
},
|
|
122
126
|
});
|
|
123
127
|
}
|
|
124
128
|
});
|
|
125
|
-
export const updateExpiredContent = (dispatch, expiredContentEditState, categoryId, content, deletedTags) => __awaiter(void 0, void 0, void 0, function* () {
|
|
129
|
+
export const updateExpiredContent = (dispatch, expiredContentEditState, categoryId, content, deletedTags, showApprochingExpiry = false) => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
130
|
const toUpdate = {
|
|
127
131
|
id: content.topContentId,
|
|
128
132
|
contentTitle: content.contentTitle,
|
|
@@ -132,6 +136,11 @@ export const updateExpiredContent = (dispatch, expiredContentEditState, category
|
|
|
132
136
|
expiryDate: content.expiryDate,
|
|
133
137
|
isActive: 1,
|
|
134
138
|
};
|
|
139
|
+
let expiryTimeLimit = new Date();
|
|
140
|
+
if (showApprochingExpiry) {
|
|
141
|
+
// Add 7 days to the current date
|
|
142
|
+
expiryTimeLimit.setDate(expiryTimeLimit.getDate() + 7);
|
|
143
|
+
}
|
|
135
144
|
try {
|
|
136
145
|
if (deletedTags && !isEmpty(deletedTags)) {
|
|
137
146
|
yield Promise.all(deletedTags.map((t) => pcm.topContentTag.deleteTagFromTopContent(content.topContentId, t)));
|
|
@@ -146,11 +155,19 @@ export const updateExpiredContent = (dispatch, expiredContentEditState, category
|
|
|
146
155
|
}
|
|
147
156
|
});
|
|
148
157
|
// We need to clone deep current state to re-render
|
|
149
|
-
const clonedExpiredContentEditState = cloneDeep(expiredContentEditState)
|
|
158
|
+
const clonedExpiredContentEditState = cloneDeep(expiredContentEditState)
|
|
159
|
+
.map((cat) => {
|
|
160
|
+
const expiredContents = cat.content.filter((c) => {
|
|
161
|
+
const contentExpiryDate = new Date(c.expiryDate);
|
|
162
|
+
return contentExpiryDate <= expiryTimeLimit;
|
|
163
|
+
});
|
|
164
|
+
return Object.assign(Object.assign({}, cat), { content: expiredContents });
|
|
165
|
+
})
|
|
166
|
+
.filter((c) => c.content.length > 0);
|
|
150
167
|
dispatch({
|
|
151
168
|
type: ExpiredContentReducerConstants.updateExpiredContentState,
|
|
152
169
|
payload: {
|
|
153
|
-
expiredContentResponse: getApiResourceObject(
|
|
170
|
+
expiredContentResponse: getApiResourceObject(clonedExpiredContentEditState),
|
|
154
171
|
expiredContentEditState: clonedExpiredContentEditState,
|
|
155
172
|
},
|
|
156
173
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.100",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -79,9 +79,9 @@
|
|
|
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.76",
|
|
83
83
|
"@rh-support/configs": "2.0.20",
|
|
84
|
-
"@rh-support/react-context": "2.1.
|
|
84
|
+
"@rh-support/react-context": "2.1.85",
|
|
85
85
|
"@rh-support/types": "2.0.4",
|
|
86
86
|
"@rh-support/user-permissions": "2.1.49",
|
|
87
87
|
"@rh-support/utils": "2.1.38",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"defaults and supports es6-module",
|
|
103
103
|
"maintained node versions"
|
|
104
104
|
],
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "c823817e7dd1f3e6bb677467063592028f7438d7"
|
|
106
106
|
}
|