mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[TLC-249] Linting
This commit is contained in:
@@ -10,7 +10,7 @@ import { ItemStatusComponent } from './item-status/item-status.component';
|
||||
import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component';
|
||||
import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component';
|
||||
import { ItemMoveComponent } from './item-move/item-move.component';
|
||||
import { ItemRegisterDoiComponent } from './item-register-doi/item-registerdoi.component'
|
||||
import { ItemRegisterDoiComponent } from './item-register-doi/item-registerdoi.component';
|
||||
import { ItemRelationshipsComponent } from './item-relationships/item-relationships.component';
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component';
|
||||
|
@@ -27,7 +27,7 @@ export class ItemRegisterDoiComponent extends AbstractSimpleItemActionComponent
|
||||
protected messageKey = 'registerdoi';
|
||||
doiToUpdateMessage = 'item.edit.' + this.messageKey + '.to-update';
|
||||
identifiers$: Observable<Identifier[]>;
|
||||
processing: boolean = false;
|
||||
processing = false;
|
||||
|
||||
constructor(protected route: ActivatedRoute,
|
||||
protected router: Router,
|
||||
@@ -38,6 +38,9 @@ export class ItemRegisterDoiComponent extends AbstractSimpleItemActionComponent
|
||||
super(route, router, notificationsService, itemDataService, translateService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise component
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
this.itemRD$ = this.route.data.pipe(
|
||||
map((data) => data.dso),
|
||||
@@ -74,6 +77,9 @@ export class ItemRegisterDoiComponent extends AbstractSimpleItemActionComponent
|
||||
this.registerDoi();
|
||||
}
|
||||
|
||||
/**
|
||||
* Request that a pending, minted or null DOI be queued for registration
|
||||
*/
|
||||
registerDoi() {
|
||||
this.processing = true;
|
||||
this.itemDataService.registerDOI(this.item.id).pipe(getFirstCompletedRemoteData()).subscribe(
|
||||
|
@@ -113,7 +113,7 @@ export class ItemStatusComponent implements OnInit {
|
||||
// Observable for configuration determining whether the Register DOI feature is enabled
|
||||
let registerConfigEnabled$: Observable<boolean> = this.configurationService.findByPropertyName('identifiers.item-status.register').pipe(
|
||||
map((enabled: RemoteData<ConfigurationProperty>) => {
|
||||
let show: boolean = false;
|
||||
let show = false;
|
||||
if (enabled.hasSucceeded) {
|
||||
if (enabled.payload !== undefined && enabled.payload !== null) {
|
||||
if (enabled.payload.values !== undefined) {
|
||||
@@ -154,14 +154,14 @@ export class ItemStatusComponent implements OnInit {
|
||||
let showRegister$: Observable<boolean> = combineLatest([this.identifiers$, registerConfigEnabled$]).pipe(
|
||||
distinctUntilChanged(),
|
||||
map(([identifiers, enabled]) => {
|
||||
let no_doi: boolean = true;
|
||||
let pending: boolean = false;
|
||||
let no_doi = true;
|
||||
let pending = false;
|
||||
if (identifiers !== undefined && identifiers !== null) {
|
||||
identifiers.forEach((identifier: Identifier) => {
|
||||
if (hasValue(identifier) && identifier.identifierType == 'doi') {
|
||||
if (hasValue(identifier) && identifier.identifierType === 'doi') {
|
||||
// The item has some kind of DOI
|
||||
no_doi = false;
|
||||
if (identifier.identifierStatus == '10' || identifier.identifierStatus == '11'
|
||||
if (identifier.identifierStatus === '10' || identifier.identifierStatus === '11'
|
||||
|| identifier.identifierStatus == null) {
|
||||
// The item's DOI is pending, minted or null.
|
||||
// It isn't registered, reserved, queued for registration or reservation or update, deleted
|
||||
@@ -174,7 +174,7 @@ export class ItemStatusComponent implements OnInit {
|
||||
// If there is no DOI, or a pending/minted/null DOI, and the config is enabled, return true
|
||||
return ((pending || no_doi) && enabled);
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
// Subscribe to changes from the showRegister check and rebuild operations list accordingly
|
||||
this.subs.push(showRegister$.subscribe((show) => {
|
||||
|
Reference in New Issue
Block a user