Skip to content

Commit

Permalink
fix: mark as missing primary source functionality in activities (#1152)
Browse files Browse the repository at this point in the history
* fix: mark as missing primary source functionality in activities

see the issue for details

fixes issue #1142

* 🤖 GITHUB ACTIONS: formatting 🤖
  • Loading branch information
DanielPalafox authored Sep 21, 2021
1 parent 97f2051 commit ee0bd6d
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 7 deletions.
14 changes: 14 additions & 0 deletions src/app/core/record-affiliations/record-affiliations.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,18 @@ export class RecordAffiliationService {
tap(() => this.getAffiliations({ forceReload: true }))
)
}

updatePreferredSource(putCode: string): Observable<any> {
return this._http
.get(
environment.API_WEB +
'affiliations/updateToMaxDisplay.json?putCode=' +
putCode
)
.pipe(
retry(3),
catchError((error) => this._errorHandler.handleError(error)),
tap(() => this.getAffiliations({ forceReload: true }))
)
}
}
14 changes: 14 additions & 0 deletions src/app/core/record-fundings/record-fundings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,18 @@ export class RecordFundingsService {
environment.API_WEB + 'workspace/retrieve-funding-import-wizards.json'
)
}

updatePreferredSource(putCode: string): Observable<any> {
return this._http
.get(
environment.API_WEB +
'fundings/updateToMaxDisplay.json?putCode=' +
putCode
)
.pipe(
retry(3),
catchError((error) => this._errorHandler.handleError(error)),
tap(() => this.getFundings({ forceReload: true }))
)
}
}
14 changes: 14 additions & 0 deletions src/app/core/record-peer-review/record-peer-review.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,18 @@ export class RecordPeerReviewService {
tap(() => this.getPeerReviewGroups({ forceReload: true }))
)
}

updatePreferredSource(putCode: string): Observable<any> {
return this._http
.get(
environment.API_WEB +
'peer-reviews/updateToMaxDisplay.json?putCode=' +
putCode
)
.pipe(
retry(3),
catchError((error) => this._errorHandler.handleError(error)),
tap(() => this.getPeerReviewGroups({ forceReload: true }))
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,18 @@ export class RecordResearchResourceService {
tap(() => this.getResearchResourcePage({ forceReload: true }))
)
}

updatePreferredSource(putCode: string): Observable<any> {
return this._http
.get(
environment.API_WEB +
'research-resources/updateToMaxDisplay.json?putCode=' +
putCode
)
.pipe(
retry(3),
catchError((error) => this._errorHandler.handleError(error)),
tap(() => this.getResearchResourcePage({ forceReload: true }))
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ export class AffiliationStackComponent implements OnInit {
}

makePrimaryCard(affiliation: Affiliation) {
// TODO
console.warn(this.stackPanelsDisplay)
this._affiliationService
.updatePreferredSource(affiliation.putCode.value)
.subscribe()
}

changeTopPanelOfTheStack(affiliation: Affiliation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ export class FundingStackComponent implements OnInit {
}

makePrimaryCard(funding: Funding) {
// TODO
console.debug(this.stackPanelsDisplay)
this._fundingService
.updatePreferredSource(funding.putCode.value)
.subscribe()
}

changeTopPanelOfTheStack(funding: Funding) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ export class PeerReviewStackComponent implements OnInit {
}

makePrimaryCard(peerReview: PeerReview) {
// TODO
this._recordPeerReviewService
.updatePreferredSource(peerReview.putCode.value)
.subscribe()
}

changeTopPanelOfTheStack(peerReview: PeerReview) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ResearchResourcesGroup,
} from '../../../types/record-research-resources.endpoint'
import { PlatformInfo, PlatformInfoService } from '../../../cdk/platform-info'
import { RecordResearchResourceService } from '../../../core/record-research-resource/record-research-resource.service'

@Component({
selector: 'app-research-resource-stack',
Expand Down Expand Up @@ -49,7 +50,10 @@ export class ResearchResourceStackComponent implements OnInit {
isMobile: boolean
platform: PlatformInfo

constructor(private _platformInfo: PlatformInfoService) {
constructor(
private _platformInfo: PlatformInfoService,
private _recordResearchResourceService: RecordResearchResourceService
) {
this._platformInfo.get().subscribe((platformInfo) => {
this.platform = platformInfo
})
Expand Down Expand Up @@ -109,7 +113,9 @@ export class ResearchResourceStackComponent implements OnInit {
}

makePrimaryCard(researchResource: ResearchResource) {
// TODO
this._recordResearchResourceService
.updatePreferredSource(researchResource.putCode)
.subscribe()
}

changeTopPanelOfTheStack(researchResource: ResearchResource) {
Expand Down

0 comments on commit ee0bd6d

Please sign in to comment.