mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 06:23:03 +00:00
ESLint: fix dangling commas
This commit is contained in:
@@ -31,7 +31,7 @@ import { PrimaryBitstreamService } from '../../core/data/primary-bitstream.servi
|
||||
selector: 'ds-edit-bitstream-page',
|
||||
styleUrls: ['./edit-bitstream-page.component.scss'],
|
||||
templateUrl: './edit-bitstream-page.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
/**
|
||||
* Page component for editing a bitstream
|
||||
@@ -124,11 +124,11 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
name: 'fileName',
|
||||
required: true,
|
||||
validators: {
|
||||
required: null
|
||||
required: null,
|
||||
},
|
||||
errorMessages: {
|
||||
required: 'You must provide a file name for the bitstream'
|
||||
}
|
||||
required: 'You must provide a file name for the bitstream',
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -136,8 +136,8 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
primaryBitstreamModel = new DynamicCustomSwitchModel({
|
||||
id: 'primaryBitstream',
|
||||
name: 'primaryBitstream'
|
||||
}
|
||||
name: 'primaryBitstream',
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -147,7 +147,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
hasSelectableMetadata: false, metadataFields: [], repeatable: false, submissionId: '',
|
||||
id: 'description',
|
||||
name: 'description',
|
||||
rows: 10
|
||||
rows: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -155,7 +155,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
selectedFormatModel = new DynamicSelectModel({
|
||||
id: 'selectedFormat',
|
||||
name: 'selectedFormat'
|
||||
name: 'selectedFormat',
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -163,7 +163,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
newFormatModel = new DynamicInputModel({
|
||||
id: 'newFormat',
|
||||
name: 'newFormat'
|
||||
name: 'newFormat',
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -172,20 +172,20 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
iiifLabelModel = new DsDynamicInputModel({
|
||||
hasSelectableMetadata: false, metadataFields: [], repeatable: false, submissionId: '',
|
||||
id: 'iiifLabel',
|
||||
name: 'iiifLabel'
|
||||
name: 'iiifLabel',
|
||||
},
|
||||
{
|
||||
grid: {
|
||||
host: 'col col-lg-6 d-inline-block'
|
||||
}
|
||||
host: 'col col-lg-6 d-inline-block',
|
||||
},
|
||||
});
|
||||
iiifLabelContainer = new DynamicFormGroupModel({
|
||||
id: 'iiifLabelContainer',
|
||||
group: [this.iiifLabelModel]
|
||||
group: [this.iiifLabelModel],
|
||||
}, {
|
||||
grid: {
|
||||
host: 'form-row'
|
||||
}
|
||||
host: 'form-row',
|
||||
},
|
||||
});
|
||||
|
||||
iiifTocModel = new DsDynamicInputModel({
|
||||
@@ -194,16 +194,16 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
name: 'iiifToc',
|
||||
}, {
|
||||
grid: {
|
||||
host: 'col col-lg-6 d-inline-block'
|
||||
}
|
||||
host: 'col col-lg-6 d-inline-block',
|
||||
},
|
||||
});
|
||||
iiifTocContainer = new DynamicFormGroupModel({
|
||||
id: 'iiifTocContainer',
|
||||
group: [this.iiifTocModel]
|
||||
group: [this.iiifTocModel],
|
||||
}, {
|
||||
grid: {
|
||||
host: 'form-row'
|
||||
}
|
||||
host: 'form-row',
|
||||
},
|
||||
});
|
||||
|
||||
iiifWidthModel = new DsDynamicInputModel({
|
||||
@@ -212,34 +212,34 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
name: 'iiifWidth',
|
||||
}, {
|
||||
grid: {
|
||||
host: 'col col-lg-6 d-inline-block'
|
||||
}
|
||||
host: 'col col-lg-6 d-inline-block',
|
||||
},
|
||||
});
|
||||
iiifWidthContainer = new DynamicFormGroupModel({
|
||||
id: 'iiifWidthContainer',
|
||||
group: [this.iiifWidthModel]
|
||||
group: [this.iiifWidthModel],
|
||||
}, {
|
||||
grid: {
|
||||
host: 'form-row'
|
||||
}
|
||||
host: 'form-row',
|
||||
},
|
||||
});
|
||||
|
||||
iiifHeightModel = new DsDynamicInputModel({
|
||||
hasSelectableMetadata: false, metadataFields: [], repeatable: false, submissionId: '',
|
||||
id: 'iiifHeight',
|
||||
name: 'iiifHeight'
|
||||
name: 'iiifHeight',
|
||||
}, {
|
||||
grid: {
|
||||
host: 'col col-lg-6 d-inline-block'
|
||||
}
|
||||
host: 'col col-lg-6 d-inline-block',
|
||||
},
|
||||
});
|
||||
iiifHeightContainer = new DynamicFormGroupModel({
|
||||
id: 'iiifHeightContainer',
|
||||
group: [this.iiifHeightModel]
|
||||
group: [this.iiifHeightModel],
|
||||
}, {
|
||||
grid: {
|
||||
host: 'form-row'
|
||||
}
|
||||
host: 'form-row',
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -257,26 +257,26 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
id: 'fileNamePrimaryContainer',
|
||||
group: [
|
||||
this.fileNameModel,
|
||||
this.primaryBitstreamModel
|
||||
]
|
||||
this.primaryBitstreamModel,
|
||||
],
|
||||
}, {
|
||||
grid: {
|
||||
host: 'form-row'
|
||||
}
|
||||
host: 'form-row',
|
||||
},
|
||||
}),
|
||||
new DynamicFormGroupModel({
|
||||
id: 'descriptionContainer',
|
||||
group: [
|
||||
this.descriptionModel
|
||||
]
|
||||
this.descriptionModel,
|
||||
],
|
||||
}),
|
||||
new DynamicFormGroupModel({
|
||||
id: 'formatContainer',
|
||||
group: [
|
||||
this.selectedFormatModel,
|
||||
this.newFormatModel
|
||||
]
|
||||
})
|
||||
this.newFormatModel,
|
||||
],
|
||||
}),
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -290,49 +290,49 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
formLayout: DynamicFormLayout = {
|
||||
fileName: {
|
||||
grid: {
|
||||
host: 'col col-sm-8 d-inline-block'
|
||||
}
|
||||
host: 'col col-sm-8 d-inline-block',
|
||||
},
|
||||
},
|
||||
primaryBitstream: {
|
||||
grid: {
|
||||
host: 'col col-sm-4 d-inline-block switch border-0'
|
||||
}
|
||||
host: 'col col-sm-4 d-inline-block switch border-0',
|
||||
},
|
||||
},
|
||||
description: {
|
||||
grid: {
|
||||
host: 'col-12 d-inline-block'
|
||||
}
|
||||
host: 'col-12 d-inline-block',
|
||||
},
|
||||
},
|
||||
embargo: {
|
||||
grid: {
|
||||
host: 'col-12 d-inline-block'
|
||||
}
|
||||
host: 'col-12 d-inline-block',
|
||||
},
|
||||
},
|
||||
selectedFormat: {
|
||||
grid: {
|
||||
host: 'col col-sm-6 d-inline-block'
|
||||
}
|
||||
host: 'col col-sm-6 d-inline-block',
|
||||
},
|
||||
},
|
||||
newFormat: {
|
||||
grid: {
|
||||
host: this.newFormatBaseLayout + ' invisible'
|
||||
}
|
||||
host: this.newFormatBaseLayout + ' invisible',
|
||||
},
|
||||
},
|
||||
fileNamePrimaryContainer: {
|
||||
grid: {
|
||||
host: 'row position-relative'
|
||||
}
|
||||
host: 'row position-relative',
|
||||
},
|
||||
},
|
||||
descriptionContainer: {
|
||||
grid: {
|
||||
host: 'row'
|
||||
}
|
||||
host: 'row',
|
||||
},
|
||||
},
|
||||
formatContainer: {
|
||||
grid: {
|
||||
host: 'row'
|
||||
}
|
||||
}
|
||||
host: 'row',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -440,14 +440,14 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
this.primaryBitstreamUUID = hasValue(primaryBitstream) ? primaryBitstream.uuid : null;
|
||||
this.itemId = item.uuid;
|
||||
this.setIiifStatus(this.bitstream);
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
this.subs.push(
|
||||
this.translate.onLangChange
|
||||
.subscribe(() => {
|
||||
this.updateFieldTranslations();
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -469,39 +469,39 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
this.formGroup.patchValue({
|
||||
fileNamePrimaryContainer: {
|
||||
fileName: bitstream.name,
|
||||
primaryBitstream: this.primaryBitstreamUUID === bitstream.uuid
|
||||
primaryBitstream: this.primaryBitstreamUUID === bitstream.uuid,
|
||||
},
|
||||
descriptionContainer: {
|
||||
description: bitstream.firstMetadataValue('dc.description')
|
||||
description: bitstream.firstMetadataValue('dc.description'),
|
||||
},
|
||||
formatContainer: {
|
||||
newFormat: hasValue(bitstream.firstMetadata('dc.format')) ? bitstream.firstMetadata('dc.format').value : undefined
|
||||
}
|
||||
newFormat: hasValue(bitstream.firstMetadata('dc.format')) ? bitstream.firstMetadata('dc.format').value : undefined,
|
||||
},
|
||||
});
|
||||
if (this.isIIIF) {
|
||||
this.formGroup.patchValue({
|
||||
iiifLabelContainer: {
|
||||
iiifLabel: bitstream.firstMetadataValue(this.IIIF_LABEL_METADATA)
|
||||
iiifLabel: bitstream.firstMetadataValue(this.IIIF_LABEL_METADATA),
|
||||
},
|
||||
iiifTocContainer: {
|
||||
iiifToc: bitstream.firstMetadataValue(this.IIIF_TOC_METADATA)
|
||||
iiifToc: bitstream.firstMetadataValue(this.IIIF_TOC_METADATA),
|
||||
},
|
||||
iiifWidthContainer: {
|
||||
iiifWidth: bitstream.firstMetadataValue(this.IMAGE_WIDTH_METADATA)
|
||||
iiifWidth: bitstream.firstMetadataValue(this.IMAGE_WIDTH_METADATA),
|
||||
},
|
||||
iiifHeightContainer: {
|
||||
iiifHeight: bitstream.firstMetadataValue(this.IMAGE_HEIGHT_METADATA)
|
||||
}
|
||||
iiifHeight: bitstream.firstMetadataValue(this.IMAGE_HEIGHT_METADATA),
|
||||
},
|
||||
});
|
||||
}
|
||||
this.bitstream.format.pipe(
|
||||
getAllSucceededRemoteDataPayload()
|
||||
getAllSucceededRemoteDataPayload(),
|
||||
).subscribe((format: BitstreamFormat) => {
|
||||
this.originalFormat = format;
|
||||
this.formGroup.patchValue({
|
||||
formatContainer: {
|
||||
selectedFormat: format.id
|
||||
}
|
||||
selectedFormat: format.id,
|
||||
},
|
||||
});
|
||||
this.updateNewFormatLayout(format.id);
|
||||
});
|
||||
@@ -514,7 +514,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
this.selectedFormatModel.options = this.formats.map((format: BitstreamFormat) =>
|
||||
Object.assign({
|
||||
value: format.id,
|
||||
label: this.isUnknownFormat(format.id) ? this.translate.instant(this.KEY_PREFIX + 'selectedFormat.unknown') : format.shortDescription
|
||||
label: this.isUnknownFormat(format.id) ? this.translate.instant(this.KEY_PREFIX + 'selectedFormat.unknown') : format.shortDescription,
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
this.inputModels.forEach(
|
||||
(fieldModel: DynamicFormControlModel) => {
|
||||
this.updateFieldTranslation(fieldModel);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -600,11 +600,11 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
const completedBundleRd$ = bundleRd$.pipe(getFirstCompletedRemoteData());
|
||||
|
||||
this.subs.push(completedBundleRd$.pipe(
|
||||
filter((bundleRd: RemoteData<Bundle>) => bundleRd.hasFailed)
|
||||
filter((bundleRd: RemoteData<Bundle>) => bundleRd.hasFailed),
|
||||
).subscribe((bundleRd: RemoteData<Bundle>) => {
|
||||
this.notificationsService.error(
|
||||
this.translate.instant(this.NOTIFICATIONS_PREFIX + 'error.primaryBitstream.title'),
|
||||
bundleRd.errorMessage
|
||||
bundleRd.errorMessage,
|
||||
);
|
||||
errorWhileSaving = true;
|
||||
}));
|
||||
@@ -616,13 +616,13 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
} else {
|
||||
return this.bundle;
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
this.subs.push(bundle$.pipe(
|
||||
hasValueOperator(),
|
||||
switchMap((bundle: Bundle) => this.bitstreamService.findByHref(bundle._links.primaryBitstream.href, false)),
|
||||
getFirstSucceededRemoteDataPayload()
|
||||
getFirstSucceededRemoteDataPayload(),
|
||||
).subscribe((bitstream: Bitstream) => {
|
||||
this.primaryBitstreamUUID = hasValue(bitstream) ? bitstream.uuid : null;
|
||||
}));
|
||||
@@ -637,12 +637,12 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
if (hasValue(formatResponse) && formatResponse.hasFailed) {
|
||||
this.notificationsService.error(
|
||||
this.translate.instant(this.NOTIFICATIONS_PREFIX + 'error.format.title'),
|
||||
formatResponse.errorMessage
|
||||
formatResponse.errorMessage,
|
||||
);
|
||||
} else {
|
||||
return formatResponse.payload;
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
bitstream$ = observableOf(this.bitstream);
|
||||
@@ -652,14 +652,14 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
tap(([bundle]) => this.bundle = bundle),
|
||||
switchMap(() => {
|
||||
return this.bitstreamService.update(updatedBitstream).pipe(
|
||||
getFirstSucceededRemoteDataPayload()
|
||||
getFirstSucceededRemoteDataPayload(),
|
||||
);
|
||||
})
|
||||
}),
|
||||
).subscribe(() => {
|
||||
this.bitstreamService.commitUpdates();
|
||||
this.notificationsService.success(
|
||||
this.translate.instant(this.NOTIFICATIONS_PREFIX + 'saved.title'),
|
||||
this.translate.instant(this.NOTIFICATIONS_PREFIX + 'saved.content')
|
||||
this.translate.instant(this.NOTIFICATIONS_PREFIX + 'saved.content'),
|
||||
);
|
||||
if (!errorWhileSaving) {
|
||||
this.navigateToItemEditBitstreams();
|
||||
@@ -753,13 +753,13 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
getFirstSucceededRemoteData(),
|
||||
map((item: RemoteData<Item>) =>
|
||||
(item.payload.firstMetadataValue('dspace.iiif.enabled') &&
|
||||
item.payload.firstMetadataValue('dspace.iiif.enabled').match(regexIIIFItem) !== null)
|
||||
item.payload.firstMetadataValue('dspace.iiif.enabled').match(regexIIIFItem) !== null),
|
||||
))));
|
||||
|
||||
const iiifSub = combineLatest(
|
||||
isImage$,
|
||||
isIIIFBundle$,
|
||||
isEnabled$
|
||||
isEnabled$,
|
||||
).subscribe(([isImage, isIIIFBundle, isEnabled]) => {
|
||||
if (isImage && isIIIFBundle && isEnabled) {
|
||||
this.isIIIF = true;
|
||||
|
Reference in New Issue
Block a user