mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge branch 'main' into fix-bistream-download-cache
This commit is contained in:
@@ -22,6 +22,8 @@ import { MetadataValue } from '../../core/shared/metadata.models';
|
||||
import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators';
|
||||
import { collectionFormEntityTypeSelectionConfig, collectionFormModels, } from './collection-form.models';
|
||||
import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type';
|
||||
import { hasNoValue, isNotNull } from 'src/app/shared/empty.util';
|
||||
|
||||
|
||||
/**
|
||||
* Form used for creating and editing collections
|
||||
@@ -66,6 +68,12 @@ export class CollectionFormComponent extends ComColFormComponent<Collection> imp
|
||||
super(formService, translate, notificationsService, authService, requestService, objectCache);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (hasNoValue(this.formModel) && isNotNull(this.dso)) {
|
||||
this.initializeForm();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect changes to the dso and initialize the form,
|
||||
* if the dso changes, exists and it is not the first change
|
||||
|
@@ -23,7 +23,7 @@
|
||||
(blur)="onBlur($event)"
|
||||
(click)="$event.stopPropagation(); openDropdown(sdRef);"
|
||||
(focus)="onFocus($event)"
|
||||
(keypress)="$event.preventDefault()">
|
||||
(keydown)="selectOnKeyDown($event, sdRef)">
|
||||
</div>
|
||||
|
||||
<div ngbDropdownMenu
|
||||
|
@@ -98,6 +98,23 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* KeyDown handler to allow toggling the dropdown via keyboard
|
||||
* @param event KeyboardEvent
|
||||
* @param sdRef The reference of the NgbDropdown.
|
||||
*/
|
||||
selectOnKeyDown(event: KeyboardEvent, sdRef: NgbDropdown) {
|
||||
const keyName = event.key;
|
||||
|
||||
if (keyName === ' ' || keyName === 'Enter') {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
sdRef.toggle();
|
||||
} else if (keyName === 'ArrowDown' || keyName === 'ArrowUp') {
|
||||
this.openDropdown(sdRef);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads any new entries
|
||||
*/
|
||||
|
Reference in New Issue
Block a user