Skip to content

Commit 97c90cf

Browse files
committed
Merge branch 'w2p-101127_browse-by-controlled-vocabulary' into w2p-101127_browse-by-controlled-vocabulary-7.6.0-next
Remove invalid _links in BrowseDefinition models Make arrows smaller in on VocabularyTreeview template
2 parents d38b16e + 138fccf commit 97c90cf

6 files changed

Lines changed: 22 additions & 18 deletions

File tree

src/app/core/browse/browse.service.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('BrowseService', () => {
2727
const browseDefinitions = [
2828
Object.assign(new FlatBrowseDefinition(), {
2929
id: 'date',
30-
metadataBrowse: false,
30+
browseType: 'flatBrowse',
3131
sortOptions: [
3232
{
3333
name: 'title',
@@ -54,7 +54,7 @@ describe('BrowseService', () => {
5454
}),
5555
Object.assign(new ValueListBrowseDefinition(), {
5656
id: 'author',
57-
metadataBrowse: true,
57+
browseType: 'valueList',
5858
sortOptions: [
5959
{
6060
name: 'title',
@@ -158,7 +158,7 @@ describe('BrowseService', () => {
158158

159159
describe('when getBrowseEntriesFor is called with a valid browse definition id', () => {
160160
it('should call hrefOnlyDataService.findListByHref with the expected href', () => {
161-
const expected = browseDefinitions[1]._links.entries.href;
161+
const expected = (browseDefinitions[1] as ValueListBrowseDefinition)._links.entries.href;
162162

163163
scheduler.schedule(() => service.getBrowseEntriesFor(new BrowseEntrySearchOptions(browseDefinitions[1].id)).subscribe());
164164
scheduler.flush();

src/app/core/shared/flat-browse-definition.model.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { inheritSerialization } from 'cerialize';
1+
import { inheritSerialization, deserialize } from 'cerialize';
22
import { typedObject } from '../cache/builders/build-decorators';
33
import { excludeFromEquals } from '../utilities/equals.decorators';
44
import { FLAT_BROWSE_DEFINITION } from './flat-browse-definition.resource-type';
55
import { ResourceType } from './resource-type';
66
import { NonHierarchicalBrowseDefinition } from './non-hierarchical-browse-definition';
7+
import { HALLink } from './hal-link.model';
78

89
/**
910
* BrowseDefinition model for browses of type 'flatBrowse'
@@ -23,6 +24,12 @@ export class FlatBrowseDefinition extends NonHierarchicalBrowseDefinition {
2324
return this._links.self.href;
2425
}
2526

27+
@deserialize
28+
_links: {
29+
self: HALLink;
30+
items: HALLink;
31+
};
32+
2633
getRenderType(): string {
2734
return this.dataType;
2835
}

src/app/core/shared/hierarchical-browse-definition.model.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ export class HierarchicalBrowseDefinition extends BrowseDefinition {
3636
@deserialize
3737
_links: {
3838
self: HALLink;
39-
entries: HALLink;
40-
items: HALLink;
4139
vocabulary: HALLink;
4240
};
4341

src/app/core/shared/non-hierarchical-browse-definition.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { autoserialize, autoserializeAs, deserialize, inheritSerialization } from 'cerialize';
1+
import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize';
22
import { SortOption } from './sort-option.model';
33
import { BrowseByDataType } from '../../browse-by/browse-by-switcher/browse-by-decorator';
4-
import { HALLink } from './hal-link.model';
54
import { BrowseDefinition } from './browse-definition.model';
65

76
/**
@@ -22,11 +21,4 @@ export abstract class NonHierarchicalBrowseDefinition extends BrowseDefinition {
2221

2322
@autoserialize
2423
dataType: BrowseByDataType;
25-
26-
@deserialize
27-
_links: {
28-
self: HALLink;
29-
entries: HALLink;
30-
items: HALLink;
31-
};
3224
}

src/app/core/shared/value-list-browse-definition.model.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { inheritSerialization } from 'cerialize';
1+
import { inheritSerialization, deserialize } from 'cerialize';
22
import { typedObject } from '../cache/builders/build-decorators';
33
import { excludeFromEquals } from '../utilities/equals.decorators';
44
import { VALUE_LIST_BROWSE_DEFINITION } from './value-list-browse-definition.resource-type';
55
import { ResourceType } from './resource-type';
66
import { NonHierarchicalBrowseDefinition } from './non-hierarchical-browse-definition';
7+
import { HALLink } from './hal-link.model';
78

89
/**
910
* BrowseDefinition model for browses of type 'valueList'
@@ -23,6 +24,12 @@ export class ValueListBrowseDefinition extends NonHierarchicalBrowseDefinition {
2324
return this._links.self.href;
2425
}
2526

27+
@deserialize
28+
_links: {
29+
self: HALLink;
30+
entries: HALLink;
31+
};
32+
2633
getRenderType(): string {
2734
return this.dataType;
2835
}

src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h4 *ngIf="!(loading | async) && dataSource.data.length === 0" class="text-cente
2323
<!-- Leaf node -->
2424
<cdk-tree-node *cdkTreeNodeDef="let node" cdkTreeNodePadding class="d-flex">
2525
<button type="button" class="btn btn-default" cdkTreeNodeToggle>
26-
<span class="fas fa-angle-right fa-2x invisible" aria-hidden="true"></span>
26+
<span class="fas fa-angle-right invisible" aria-hidden="true"></span>
2727
</button>
2828
<label *ngIf="multiSelect" class="d-flex align-items-center m-0 p-0 form-check"
2929
[class.text-success]="node.isSelected"
@@ -54,7 +54,7 @@ <h4 *ngIf="!(loading | async) && dataSource.data.length === 0" class="text-cente
5454
<button type="button" class="btn btn-default" cdkTreeNodeToggle
5555
[attr.aria-label]="'toggle ' + node.name"
5656
(click)="loadChildren(node)">
57-
<span class="fas {{treeControl.isExpanded(node) ? 'fa-angle-down' : 'fa-angle-right'}} fa-2x"
57+
<span class="fas {{treeControl.isExpanded(node) ? 'fa-angle-down' : 'fa-angle-right'}}"
5858
aria-hidden="true"></span>
5959
</button>
6060

0 commit comments

Comments
 (0)