Commit Graph

18 Commits

Author SHA1 Message Date
Art Lowel
21e8879f77 remove circular dependencies 2020-08-28 11:34:17 +02:00
lotte
8bf241c182 angular cli 2020-03-18 16:03:40 +01:00
lotte
4ae8997ada added tests for breadcrumbs service and component 2020-02-26 14:44:34 +01:00
L. Henze
46b86ec6c7 Desktop view: also using allOptions array, and tidying 2019-10-08 12:52:10 -04:00
L. Henze
c46480c97f from @art-lowel: update onSelectChange to work with ngModel
Because we're working with ngModel, we're no longer getting a generic JS event in the onSelectChange, but simply the id of the selected option. I use that Id to find the option in the allOptions array that matches, and then use the data inside that matching option to navigate to the correct page.
2019-10-08 12:40:57 -04:00
L. Henze
c957031317 from @art-lowel: Observable for currentOptionId
Next in order to know what page we're on, I use the route.url observable angular provides us that contains the current url, pipe that through a filter to ensure it has a value for the map below, which will just get the last part of the current url, so the community or collection id, or the type of the browse page.
2019-10-08 12:32:40 -04:00
L. Henze
3d8ffd6fe3 from @art-lowel: create array and map all options to it
I created a list in the component that contains all the possible values a button or an option in the select can have, that way we can get rid of those *ngIfs in the template, and render everything with an *ngFor
Instead of putting all the data needed to select an option and to redirect to the correct option in the template, I created an interface to represent all the info we need: ComColPageNavOption
During ngOnInit, I first take the browseBy types in the config, and perform a map operation on them, that basically means, turn every element of this array in to something else using the function inside the map operator.
So inside the map function I each BrowseByTypeConfig object in to a ComColPageNavOption object
Afterwards I check whether we're dealing with a collection or a community, and in each case I create a ComColPageNavOption object, and add it to the front of the allOptions array
...this.allOptions means enumerate everything that's currently in the allOptions array, so I put my new object first, then enumerate everything that was already there, and assign the result again to this.allOptions
2019-10-08 12:15:25 -04:00
lhenze
d4d4a6121e Mobile view: adding select element for navigation 2019-10-01 12:12:50 -04:00
L. Henze
f443a2bcce Excess whitespace removed 2019-09-05 10:52:05 -04:00
lhenze
72c382d5c3 Using "type" value to determine path & innerHTML of first button 2019-08-23 17:59:08 -04:00
lhenze
86d3389438 One approach 2019-08-23 17:52:29 -04:00
lhenze
b73ad7a8f0 Managed to pass URL value and not have it be sanitized 2019-08-22 12:47:33 -04:00
lhenze
8f93d723a5 Problem: Attempt to extend comcol-page-browse-by
Cannot pass a URL.  it is getting sanitized
2019-08-21 16:07:34 -04:00
lhenze
16b3e8af35 Comcol component - adding styles 2019-08-21 13:59:54 -04:00
Kristof De Langhe
369a6dfaea 62063: JSDocs and comments 2019-04-30 17:24:58 +02:00
Kristof De Langhe
41e55d8d44 62063: Configurable Browse-By menus 2019-04-30 16:54:50 +02:00
Kristof De Langhe
64f301d1dd 59415: messages, subject link on comcol pages and documentation updates 2019-01-29 17:22:23 +01:00
Kristof De Langhe
0312e659a4 59415: Browse-By links on community and collection pages' 2019-01-29 16:07:53 +01:00