[Library | new-theme]: Improvements & Do not show "Add to ORCID" button in search datasources with pids.

1. dataProvider.component.ts: In method "searchRelatedDatasources()", size can be always 0 (refine query).
2. advancedSearchForm.component.html: [Bug fix] Make all the button line clickable and functional in advanced search form.
3. result-preview.component.ts: Added get method "isResultType()" which checks if result.resultType is result, publication, dataset, software, other.
4. result-preview.component.html: [Bug fix] Call <orcid-work> (add/remove from ORCID buttons) only for results - check for identifiers is not enough, now datasources also have pids.
This commit is contained in:
Konstantina Galouni 2022-05-19 19:08:04 +03:00
parent 8154b9f307
commit 4ce80019e7
4 changed files with 10 additions and 5 deletions

View File

@ -745,7 +745,7 @@ export class DataProviderComponent {
this.searchDatasources(1, this.searchNumber);
} else if (activeTabId == 'relatedDatasources') {
this.activeTab = "relatedDatasources";
this.searchRelatedDatasources(1, this.searchNumber);
this.searchRelatedDatasources(1, 0);
} else if (activeTabId == 'statistics') {
this.activeTab = 'statistics';
this.statsClicked = true;

View File

@ -114,8 +114,8 @@
</div>
</div>
</div>
<a class="uk-card-footer uk-link-reset uk-tile-primary uk-flex uk-flex-center uk-light">
<button (click)="queryChanged()" class="uk-button uk-button-text">
<a (click)="queryChanged()" class="uk-card-footer uk-link-reset uk-tile-primary uk-flex uk-flex-center uk-light">
<button class="uk-button uk-button-text">
<span class="uk-flex uk-flex-middle">
<icon name="search" [flex]="true"></icon>
<span class="uk-margin-small-left">Search</span>

View File

@ -300,7 +300,7 @@
<!--&& loggedIn (card footer)-->
<div *ngIf="(result.pop_inf && result.DOI) ||
((properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community') &&
((showOrcid && result.identifiers && result.identifiers.size > 0) || result.orcidCreationDates?.length > 0))"
((showOrcid && result.identifiers && result.identifiers.size > 0 && isResultType) || result.orcidCreationDates?.length > 0))"
class="result-preview-bottom uk-text-small"
[ngClass]="{'uk-card-footer': isCard}">
<!-- Impact Factors-->
@ -379,7 +379,7 @@
<!-- && loggedIn -->
<!-- TODO: change colors/opacity and disabled attr for ORCID buttons -->
<span *ngIf="(properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community')
&& showOrcid && result.identifiers && result.identifiers.size > 0"
&& showOrcid && result.identifiers && result.identifiers.size > 0 && isResultType"
class="uk-width-1-3 uk-width-expand@s">
<!-- class="uk-flex uk-flex-middle uk-flex-right uk-width-expand">-->
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0"

View File

@ -174,4 +174,9 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
return this.routerHelper.createQueryParam(this.urlParam,this.result.id)
}
public get isResultType() {
return this.result.resultType == "publication" || this.result.resultType == "dataset" ||
this.result.resultType == "software" || this.result.resultType == "other" || this.result.resultType == "result";
}
}