mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 14:33:03 +00:00
Merge pull request #2007 from arvoConsultores/DS-8408
In Advanced Search, list collections alphabetically
This commit is contained in:
@@ -369,3 +369,8 @@ vocabularies:
|
|||||||
- filter: 'subject'
|
- filter: 'subject'
|
||||||
vocabulary: 'srsc'
|
vocabulary: 'srsc'
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
# Default collection/community sorting order at Advanced search, Create/update community and collection when there are not a query.
|
||||||
|
comcolSelectionSort:
|
||||||
|
sortField: 'dc.title'
|
||||||
|
sortDirection: 'ASC'
|
@@ -11,6 +11,7 @@ import { PaginatedSearchOptions } from '../../search/models/paginated-search-opt
|
|||||||
import { hasValue } from '../../empty.util';
|
import { hasValue } from '../../empty.util';
|
||||||
import { createPaginatedList } from '../../testing/utils.test';
|
import { createPaginatedList } from '../../testing/utils.test';
|
||||||
import { NotificationsService } from '../../notifications/notifications.service';
|
import { NotificationsService } from '../../notifications/notifications.service';
|
||||||
|
import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model';
|
||||||
|
|
||||||
describe('DSOSelectorComponent', () => {
|
describe('DSOSelectorComponent', () => {
|
||||||
let component: DSOSelectorComponent;
|
let component: DSOSelectorComponent;
|
||||||
@@ -34,7 +35,7 @@ describe('DSOSelectorComponent', () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const searchService = {
|
const searchService = {
|
||||||
search: (options: PaginatedSearchOptions) => {
|
search: (options: PaginatedSearchOptions, responseMsToLive?: number, useCachedVersionIfAvailable = true) => {
|
||||||
if (hasValue(options.query) && options.query.startsWith('search.resourceid')) {
|
if (hasValue(options.query) && options.query.startsWith('search.resourceid')) {
|
||||||
return createSuccessfulRemoteDataObject$(createPaginatedList([searchResult]));
|
return createSuccessfulRemoteDataObject$(createPaginatedList([searchResult]));
|
||||||
} else if (options.pagination.currentPage === 1) {
|
} else if (options.pagination.currentPage === 1) {
|
||||||
@@ -120,6 +121,43 @@ describe('DSOSelectorComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('search', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
spyOn(searchService, 'search').and.callThrough();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should specify how to sort if no query is given', () => {
|
||||||
|
component.sort = new SortOptions('dc.title', SortDirection.ASC);
|
||||||
|
component.search(undefined, 0);
|
||||||
|
|
||||||
|
expect(searchService.search).toHaveBeenCalledWith(
|
||||||
|
jasmine.objectContaining({
|
||||||
|
query: undefined,
|
||||||
|
sort: jasmine.objectContaining({
|
||||||
|
field: 'dc.title',
|
||||||
|
direction: SortDirection.ASC,
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
null,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not specify how to sort if a query is given', () => {
|
||||||
|
component.sort = new SortOptions('dc.title', SortDirection.ASC);
|
||||||
|
component.search('testQuery', 0);
|
||||||
|
|
||||||
|
expect(searchService.search).toHaveBeenCalledWith(
|
||||||
|
jasmine.objectContaining({
|
||||||
|
query: 'testQuery',
|
||||||
|
sort: null,
|
||||||
|
}),
|
||||||
|
null,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('when search returns an error', () => {
|
describe('when search returns an error', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyOn(searchService, 'search').and.returnValue(createFailedRemoteDataObject$());
|
spyOn(searchService, 'search').and.returnValue(createFailedRemoteDataObject$());
|
||||||
|
@@ -31,6 +31,7 @@ import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from
|
|||||||
import { hasNoValue, hasValue, isEmpty, isNotEmpty } from '../../empty.util';
|
import { hasNoValue, hasValue, isEmpty, isNotEmpty } from '../../empty.util';
|
||||||
import { buildPaginatedList, PaginatedList } from '../../../core/data/paginated-list.model';
|
import { buildPaginatedList, PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import { SearchResult } from '../../search/models/search-result.model';
|
import { SearchResult } from '../../search/models/search-result.model';
|
||||||
|
import { SortOptions } from '../../../core/cache/models/sort-options.model';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { NotificationsService } from '../../notifications/notifications.service';
|
import { NotificationsService } from '../../notifications/notifications.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
@@ -69,6 +70,11 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
@Input() types: DSpaceObjectType[];
|
@Input() types: DSpaceObjectType[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sorting options
|
||||||
|
*/
|
||||||
|
@Input() sort: SortOptions;
|
||||||
|
|
||||||
// list of allowed selectable dsoTypes
|
// list of allowed selectable dsoTypes
|
||||||
typesString: string;
|
typesString: string;
|
||||||
|
|
||||||
@@ -221,13 +227,16 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
|
|||||||
* @param useCache Whether or not to use the cache
|
* @param useCache Whether or not to use the cache
|
||||||
*/
|
*/
|
||||||
search(query: string, page: number, useCache: boolean = true): Observable<RemoteData<PaginatedList<SearchResult<DSpaceObject>>>> {
|
search(query: string, page: number, useCache: boolean = true): Observable<RemoteData<PaginatedList<SearchResult<DSpaceObject>>>> {
|
||||||
|
// default sort is only used when there is not query
|
||||||
|
let efectiveSort = query ? null : this.sort;
|
||||||
return this.searchService.search(
|
return this.searchService.search(
|
||||||
new PaginatedSearchOptions({
|
new PaginatedSearchOptions({
|
||||||
query: query,
|
query: query,
|
||||||
dsoTypes: this.types,
|
dsoTypes: this.types,
|
||||||
pagination: Object.assign({}, this.defaultPagination, {
|
pagination: Object.assign({}, this.defaultPagination, {
|
||||||
currentPage: page
|
currentPage: page
|
||||||
})
|
}),
|
||||||
|
sort: efectiveSort
|
||||||
}),
|
}),
|
||||||
null,
|
null,
|
||||||
useCache,
|
useCache,
|
||||||
|
@@ -8,7 +8,8 @@ import {
|
|||||||
getCollectionCreateRoute,
|
getCollectionCreateRoute,
|
||||||
COLLECTION_PARENT_PARAMETER
|
COLLECTION_PARENT_PARAMETER
|
||||||
} from '../../../../collection-page/collection-page-routing-paths';
|
} from '../../../../collection-page/collection-page-routing-paths';
|
||||||
|
import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
/**
|
/**
|
||||||
* Component to wrap a list of existing communities inside a modal
|
* Component to wrap a list of existing communities inside a modal
|
||||||
* Used to choose a community from to create a new collection in
|
* Used to choose a community from to create a new collection in
|
||||||
@@ -23,6 +24,7 @@ export class CreateCollectionParentSelectorComponent extends DSOSelectorModalWra
|
|||||||
selectorTypes = [DSpaceObjectType.COMMUNITY];
|
selectorTypes = [DSpaceObjectType.COMMUNITY];
|
||||||
action = SelectorActionType.CREATE;
|
action = SelectorActionType.CREATE;
|
||||||
header = 'dso-selector.create.collection.sub-level';
|
header = 'dso-selector.create.collection.sub-level';
|
||||||
|
defaultSort = new SortOptions(environment.comcolSelectionSort.sortField, environment.comcolSelectionSort.sortDirection as SortDirection);
|
||||||
|
|
||||||
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
super(activeModal, route);
|
super(activeModal, route);
|
||||||
|
@@ -14,6 +14,6 @@
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<h5 class="px-2">{{'dso-selector.create.community.sub-level' | translate}}</h5>
|
<h5 class="px-2">{{'dso-selector.create.community.sub-level' | translate}}</h5>
|
||||||
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
|
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" [sort]="defaultSort" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -12,6 +12,8 @@ import {
|
|||||||
getCommunityCreateRoute,
|
getCommunityCreateRoute,
|
||||||
COMMUNITY_PARENT_PARAMETER
|
COMMUNITY_PARENT_PARAMETER
|
||||||
} from '../../../../community-page/community-page-routing-paths';
|
} from '../../../../community-page/community-page-routing-paths';
|
||||||
|
import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to wrap a button - for top communities -
|
* Component to wrap a button - for top communities -
|
||||||
@@ -29,6 +31,7 @@ export class CreateCommunityParentSelectorComponent extends DSOSelectorModalWrap
|
|||||||
objectType = DSpaceObjectType.COMMUNITY;
|
objectType = DSpaceObjectType.COMMUNITY;
|
||||||
selectorTypes = [DSpaceObjectType.COMMUNITY];
|
selectorTypes = [DSpaceObjectType.COMMUNITY];
|
||||||
action = SelectorActionType.CREATE;
|
action = SelectorActionType.CREATE;
|
||||||
|
defaultSort = new SortOptions(environment.comcolSelectionSort.sortField, environment.comcolSelectionSort.sortDirection as SortDirection);
|
||||||
|
|
||||||
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
super(activeModal, route);
|
super(activeModal, route);
|
||||||
|
@@ -4,6 +4,8 @@ import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.mod
|
|||||||
import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component';
|
import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component';
|
||||||
|
import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to wrap a list of existing collections inside a modal
|
* Component to wrap a list of existing collections inside a modal
|
||||||
@@ -21,6 +23,7 @@ export class CreateItemParentSelectorComponent extends DSOSelectorModalWrapperCo
|
|||||||
selectorTypes = [DSpaceObjectType.COLLECTION];
|
selectorTypes = [DSpaceObjectType.COLLECTION];
|
||||||
action = SelectorActionType.CREATE;
|
action = SelectorActionType.CREATE;
|
||||||
header = 'dso-selector.create.item.sub-level';
|
header = 'dso-selector.create.item.sub-level';
|
||||||
|
defaultSort = new SortOptions(environment.comcolSelectionSort.sortField, environment.comcolSelectionSort.sortDirection as SortDirection);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If present this value is used to filter collection list by entity type
|
* If present this value is used to filter collection list by entity type
|
||||||
|
@@ -6,6 +6,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
|
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
|
||||||
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
|
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" [sort]="defaultSort" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -5,6 +5,7 @@ import { RemoteData } from '../../../core/data/remote-data';
|
|||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model';
|
import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model';
|
||||||
import { hasValue, isNotEmpty } from '../../empty.util';
|
import { hasValue, isNotEmpty } from '../../empty.util';
|
||||||
|
import { SortOptions } from '../../../core/cache/models/sort-options.model';
|
||||||
|
|
||||||
export enum SelectorActionType {
|
export enum SelectorActionType {
|
||||||
CREATE = 'create',
|
CREATE = 'create',
|
||||||
@@ -49,6 +50,11 @@ export abstract class DSOSelectorModalWrapperComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
action: SelectorActionType;
|
action: SelectorActionType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default DSO ordering
|
||||||
|
*/
|
||||||
|
defaultSort: SortOptions;
|
||||||
|
|
||||||
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute) {
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,6 +8,8 @@ import {
|
|||||||
SelectorActionType
|
SelectorActionType
|
||||||
} from '../dso-selector-modal-wrapper.component';
|
} from '../dso-selector-modal-wrapper.component';
|
||||||
import { getCollectionEditRoute } from '../../../../collection-page/collection-page-routing-paths';
|
import { getCollectionEditRoute } from '../../../../collection-page/collection-page-routing-paths';
|
||||||
|
import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to wrap a list of existing collections inside a modal
|
* Component to wrap a list of existing collections inside a modal
|
||||||
@@ -22,6 +24,7 @@ export class EditCollectionSelectorComponent extends DSOSelectorModalWrapperComp
|
|||||||
objectType = DSpaceObjectType.COLLECTION;
|
objectType = DSpaceObjectType.COLLECTION;
|
||||||
selectorTypes = [DSpaceObjectType.COLLECTION];
|
selectorTypes = [DSpaceObjectType.COLLECTION];
|
||||||
action = SelectorActionType.EDIT;
|
action = SelectorActionType.EDIT;
|
||||||
|
defaultSort = new SortOptions(environment.comcolSelectionSort.sortField, environment.comcolSelectionSort.sortDirection as SortDirection);
|
||||||
|
|
||||||
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
super(activeModal, route);
|
super(activeModal, route);
|
||||||
|
@@ -8,6 +8,8 @@ import {
|
|||||||
SelectorActionType
|
SelectorActionType
|
||||||
} from '../dso-selector-modal-wrapper.component';
|
} from '../dso-selector-modal-wrapper.component';
|
||||||
import { getCommunityEditRoute } from '../../../../community-page/community-page-routing-paths';
|
import { getCommunityEditRoute } from '../../../../community-page/community-page-routing-paths';
|
||||||
|
import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model';
|
||||||
|
import { environment } from '../../../../../environments/environment';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to wrap a list of existing communities inside a modal
|
* Component to wrap a list of existing communities inside a modal
|
||||||
@@ -23,6 +25,7 @@ export class EditCommunitySelectorComponent extends DSOSelectorModalWrapperCompo
|
|||||||
objectType = DSpaceObjectType.COMMUNITY;
|
objectType = DSpaceObjectType.COMMUNITY;
|
||||||
selectorTypes = [DSpaceObjectType.COMMUNITY];
|
selectorTypes = [DSpaceObjectType.COMMUNITY];
|
||||||
action = SelectorActionType.EDIT;
|
action = SelectorActionType.EDIT;
|
||||||
|
defaultSort = new SortOptions(environment.comcolSelectionSort.sortField, environment.comcolSelectionSort.sortDirection as SortDirection);
|
||||||
|
|
||||||
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute, private router: Router) {
|
||||||
super(activeModal, route);
|
super(activeModal, route);
|
||||||
|
@@ -0,0 +1,11 @@
|
|||||||
|
<div>
|
||||||
|
<div class="modal-header">{{'dso-selector.'+ action + '.' + objectType.toString().toLowerCase() + '.head' | translate}}
|
||||||
|
<button type="button" class="close" (click)="close()" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
|
||||||
|
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
|
</div>
|
||||||
|
</div>
|
@@ -14,7 +14,7 @@ import { Item } from '../../../../core/shared/item.model';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-edit-item-selector',
|
selector: 'ds-edit-item-selector',
|
||||||
templateUrl: '../dso-selector-modal-wrapper.component.html',
|
templateUrl: 'edit-item-selector.component.html',
|
||||||
})
|
})
|
||||||
export class EditItemSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit {
|
export class EditItemSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit {
|
||||||
objectType = DSpaceObjectType.ITEM;
|
objectType = DSpaceObjectType.ITEM;
|
||||||
|
@@ -14,6 +14,6 @@
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<h5 class="px-2">{{'dso-selector.' + action + '.' + objectType.toString().toLowerCase() + '.input-header' | translate}}</h5>
|
<h5 class="px-2">{{'dso-selector.' + action + '.' + objectType.toString().toLowerCase() + '.input-header' | translate}}</h5>
|
||||||
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
|
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" [sort]="defaultSort" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -4,6 +4,8 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|||||||
import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model';
|
import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model';
|
||||||
import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../../dso-selector/modal-wrappers/dso-selector-modal-wrapper.component';
|
import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../../dso-selector/modal-wrappers/dso-selector-modal-wrapper.component';
|
||||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||||
|
import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model';
|
||||||
|
import { environment } from '../../../../environments/environment';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to wrap a button - to select the entire repository -
|
* Component to wrap a button - to select the entire repository -
|
||||||
@@ -33,6 +35,11 @@ export class ScopeSelectorModalComponent extends DSOSelectorModalWrapperComponen
|
|||||||
*/
|
*/
|
||||||
scopeChange = new EventEmitter<DSpaceObject>();
|
scopeChange = new EventEmitter<DSpaceObject>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default DSO ordering
|
||||||
|
*/
|
||||||
|
defaultSort = new SortOptions(environment.comcolSelectionSort.sortField, environment.comcolSelectionSort.sortDirection as SortDirection);
|
||||||
|
|
||||||
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute) {
|
constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute) {
|
||||||
super(activeModal, route);
|
super(activeModal, route);
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,7 @@ import { CommunityListConfig } from './community-list-config.interface';
|
|||||||
import { HomeConfig } from './homepage-config.interface';
|
import { HomeConfig } from './homepage-config.interface';
|
||||||
import { MarkdownConfig } from './markdown-config.interface';
|
import { MarkdownConfig } from './markdown-config.interface';
|
||||||
import { FilterVocabularyConfig } from './filter-vocabulary-config';
|
import { FilterVocabularyConfig } from './filter-vocabulary-config';
|
||||||
|
import { DiscoverySortConfig } from './discovery-sort.config';
|
||||||
|
|
||||||
interface AppConfig extends Config {
|
interface AppConfig extends Config {
|
||||||
ui: UIServerConfig;
|
ui: UIServerConfig;
|
||||||
@@ -46,6 +47,7 @@ interface AppConfig extends Config {
|
|||||||
info: InfoConfig;
|
info: InfoConfig;
|
||||||
markdown: MarkdownConfig;
|
markdown: MarkdownConfig;
|
||||||
vocabularies: FilterVocabularyConfig[];
|
vocabularies: FilterVocabularyConfig[];
|
||||||
|
comcolSelectionSort: DiscoverySortConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -21,6 +21,7 @@ import { CommunityListConfig } from './community-list-config.interface';
|
|||||||
import { HomeConfig } from './homepage-config.interface';
|
import { HomeConfig } from './homepage-config.interface';
|
||||||
import { MarkdownConfig } from './markdown-config.interface';
|
import { MarkdownConfig } from './markdown-config.interface';
|
||||||
import { FilterVocabularyConfig } from './filter-vocabulary-config';
|
import { FilterVocabularyConfig } from './filter-vocabulary-config';
|
||||||
|
import { DiscoverySortConfig } from './discovery-sort.config';
|
||||||
|
|
||||||
export class DefaultAppConfig implements AppConfig {
|
export class DefaultAppConfig implements AppConfig {
|
||||||
production = false;
|
production = false;
|
||||||
@@ -421,4 +422,10 @@ export class DefaultAppConfig implements AppConfig {
|
|||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Configuration that determines the metadata sorting of community and collection edition and creation when there are not a search query.
|
||||||
|
comcolSelectionSort: DiscoverySortConfig = {
|
||||||
|
sortField:'dc.title',
|
||||||
|
sortDirection:'ASC',
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
14
src/config/discovery-sort.config.ts
Normal file
14
src/config/discovery-sort.config.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { Config } from './config.interface';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Config that determines a metadata sorting config.
|
||||||
|
* It's created mainly to sort by metadata community and collection edition and creation
|
||||||
|
*/
|
||||||
|
export class DiscoverySortConfig implements Config {
|
||||||
|
|
||||||
|
public sortField: string;
|
||||||
|
/**
|
||||||
|
* ASC / DESC values expected
|
||||||
|
*/
|
||||||
|
public sortDirection: string;
|
||||||
|
}
|
@@ -297,6 +297,10 @@ export const environment: BuildConfig = {
|
|||||||
enabled: false,
|
enabled: false,
|
||||||
mathjax: false,
|
mathjax: false,
|
||||||
},
|
},
|
||||||
|
comcolSelectionSort: {
|
||||||
|
sortField:'dc.title',
|
||||||
|
sortDirection:'ASC',
|
||||||
|
},
|
||||||
|
|
||||||
vocabularies: [
|
vocabularies: [
|
||||||
{
|
{
|
||||||
|
@@ -6,6 +6,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
|
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
|
||||||
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
|
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" [sort]="defaultSort" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -14,6 +14,6 @@
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<h5 class="px-2">{{'dso-selector.create.community.sub-level' | translate}}</h5>
|
<h5 class="px-2">{{'dso-selector.create.community.sub-level' | translate}}</h5>
|
||||||
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
|
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" [sort]="defaultSort" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -6,6 +6,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
|
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
|
||||||
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
|
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" [sort]="defaultSort" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -6,6 +6,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
|
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
|
||||||
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
|
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" [sort]="defaultSort" (onSelect)="selectObject($event)"></ds-dso-selector>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user