@@ -23,10 +23,8 @@ export const SuggestionTargetActionTypes = {
2323 MARK_USER_SUGGESTIONS_AS_VISITED : type ( 'dspace/integration/openaire/suggestions/target/MARK_USER_SUGGESTIONS_AS_VISITED' ) ,
2424} ;
2525
26- /* tslint:disable:max-classes-per-file */
27-
2826/**
29- * An ngrx action to retrieve all the Suggestion Targets.
27+ * A ngrx action to retrieve all the Suggestion Targets.
3028 */
3129export class RetrieveTargetsBySourceAction implements Action {
3230 type = SuggestionTargetActionTypes . RETRIEVE_TARGETS_BY_SOURCE ;
@@ -56,18 +54,34 @@ export class RetrieveTargetsBySourceAction implements Action {
5654}
5755
5856/**
59- * An ngrx action for retrieving 'all Suggestion Targets' error.
57+ * A ngrx action for notifying error.
6058 */
61- export class RetrieveAllTargetsErrorAction implements Action {
59+ export class RetrieveTargetsBySourceErrorAction implements Action {
6260 type = SuggestionTargetActionTypes . RETRIEVE_TARGETS_BY_SOURCE_ERROR ;
61+ payload : {
62+ source : string ;
63+ } ;
64+
65+ /**
66+ * Create a new RetrieveTargetsBySourceAction.
67+ *
68+ * @param source
69+ * the source for which to retrieve suggestion targets
70+ */
71+ constructor ( source : string ) {
72+ this . payload = {
73+ source,
74+ } ;
75+ }
6376}
6477
6578/**
66- * An ngrx action to load the Suggestion Target objects.
79+ * A ngrx action to load the Suggestion Target objects.
6780 */
6881export class AddTargetAction implements Action {
6982 type = SuggestionTargetActionTypes . ADD_TARGETS ;
7083 payload : {
84+ source : string ;
7185 targets : SuggestionTarget [ ] ;
7286 totalPages : number ;
7387 currentPage : number ;
@@ -77,6 +91,8 @@ export class AddTargetAction implements Action {
7791 /**
7892 * Create a new AddTargetAction.
7993 *
94+ * @param source
95+ * the source of suggestion targets
8096 * @param targets
8197 * the list of targets
8298 * @param totalPages
@@ -86,8 +102,9 @@ export class AddTargetAction implements Action {
86102 * @param totalElements
87103 * the total available Suggestion Targets
88104 */
89- constructor ( targets : SuggestionTarget [ ] , totalPages : number , currentPage : number , totalElements : number ) {
105+ constructor ( source : string , targets : SuggestionTarget [ ] , totalPages : number , currentPage : number , totalElements : number ) {
90106 this . payload = {
107+ source,
91108 targets,
92109 totalPages,
93110 currentPage,
@@ -98,7 +115,7 @@ export class AddTargetAction implements Action {
98115}
99116
100117/**
101- * An ngrx action to load the user Suggestion Target object.
118+ * A ngrx action to load the user Suggestion Target object.
102119 * Called by the ??? effect.
103120 */
104121export class AddUserSuggestionsAction implements Action {
@@ -120,7 +137,7 @@ export class AddUserSuggestionsAction implements Action {
120137}
121138
122139/**
123- * An ngrx action to reload the user Suggestion Target object.
140+ * A ngrx action to reload the user Suggestion Target object.
124141 * Called by the ??? effect.
125142 */
126143export class RefreshUserSuggestionsAction implements Action {
@@ -135,21 +152,34 @@ export class RefreshUserSuggestionsErrorAction implements Action {
135152}
136153
137154/**
138- * An ngrx action to Mark User Suggestions As Visited.
155+ * A ngrx action to Mark User Suggestions As Visited.
139156 * Called by the ??? effect.
140157 */
141158export class MarkUserSuggestionsAsVisitedAction implements Action {
142159 type = SuggestionTargetActionTypes . MARK_USER_SUGGESTIONS_AS_VISITED ;
143160}
144161
145162/**
146- * An ngrx action to clear targets state.
163+ * A ngrx action to clear targets state.
147164 */
148165export class ClearSuggestionTargetsAction implements Action {
149166 type = SuggestionTargetActionTypes . CLEAR_TARGETS ;
150- }
167+ payload : {
168+ source : string ;
169+ } ;
151170
152- /* tslint:enable:max-classes-per-file */
171+ /**
172+ * Create a new ClearSuggestionTargetsAction.
173+ *
174+ * @param source
175+ * the source of suggestion targets
176+ */
177+ constructor ( source : string ) {
178+ this . payload = {
179+ source,
180+ } ;
181+ }
182+ }
153183
154184/**
155185 * Export a type alias of all actions in this action group
@@ -161,5 +191,5 @@ export type SuggestionTargetsActions
161191 | ClearSuggestionTargetsAction
162192 | MarkUserSuggestionsAsVisitedAction
163193 | RetrieveTargetsBySourceAction
164- | RetrieveAllTargetsErrorAction
194+ | RetrieveTargetsBySourceErrorAction
165195 | RefreshUserSuggestionsAction ;
0 commit comments