Skip to content

Commit

Permalink
[CST-12145] commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaismailati committed Oct 30, 2023
1 parent e87c12c commit 8e0af9b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ export class QualityAssuranceTopicDataService extends IdentifiableDataService<Qu
return this.findAllData.findAll(options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
}

/**
* Search for Quality Assurance topics.
* @param options The search options.
* @param useCachedVersionIfAvailable Whether to use cached version if available.
* @param reRequestOnStale Whether to re-request on stale.
* @param linksToFollow The links to follow.
* @returns An observable of remote data containing a paginated list of Quality Assurance topics.
*/
public searchTopics(options: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<QualityAssuranceTopicObject>[]): Observable<RemoteData<PaginatedList<QualityAssuranceTopicObject>>> {
return this.searchData.searchBy(this.searchByTargetMethod, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
}

/**
* Clear FindAll topics requests from cache
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ export class QaEventNotificationComponent implements OnInit {
searchParams: [new RequestParam('source', this.source), new RequestParam('target', this.item.id)]
};

// const findListEventOptions: FindListOptions = {
// searchParams: [new RequestParam('topic', topic.name), new RequestParam('target', this.item.id)]
// };

this.events$ = this.qualityAssuranceTopicDataService.getTopics(findListTopicOptions).pipe(
this.events$ = this.qualityAssuranceTopicDataService.searchTopics(findListTopicOptions).pipe(
getFirstCompletedRemoteData(),
getRemoteDataPayload(),
getPaginatedListPayload(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { QualityAssuranceSourceObject } from 'src/app/core/suggestion-notificati
})
export class MyDspaceQaEventsNotificationsComponent implements OnInit {

/**
* An Observable that emits an array of QualityAssuranceSourceObject.
*/
sources$: Observable<QualityAssuranceSourceObject[]> = of([]);

constructor(private qualityAssuranceSourceDataService: QualityAssuranceSourceDataService) { }
Expand All @@ -20,6 +23,11 @@ export class MyDspaceQaEventsNotificationsComponent implements OnInit {
this.getSources();
}

/**
* Retrieves the sources for Quality Assurance.
* @returns An Observable of the sources for Quality Assurance.
* @throws An error if the retrieval of Quality Assurance sources fails.
*/
getSources() {
this.sources$ = this.qualityAssuranceSourceDataService.getSources()
.pipe(
Expand Down

0 comments on commit 8e0af9b

Please sign in to comment.