Commit 915c51d
Port #1326 to dtq-dev-9-base: Add search icon to community and collection
The DSO action menu of a Community or Collection gains a scoped-search entry
that opens /search restricted to that container, on the first page
(/search?spc.page=1&scope=<uuid>).
This is a rewrite, not a translation. On 7.x the entry was one more object in
the array returned by DSOEditMenuResolver (`id: 'search-dso'`, `index: 3`).
That resolver does not exist on v9 - the DSO edit menu is assembled from menu
providers registered in app.menus.ts - so the port is:
* new `ComColSearchMenuProvider extends DSpaceObjectPageMenuProvider`, modelled
on the sibling `comcol-subscribe.menu.ts`, returning one LINK section
{ text: 'search.title', link: '/search',
queryParams: { 'spc.page': '1', scope: dso.uuid }, icon: 'search' };
* registered FIRST inside `DsoOptionMenuProvider.withSubs([...])` with
`.onRoute(MenuRoute.COMMUNITY_PAGE, MenuRoute.COLLECTION_PAGE)` - ordering on
v9 comes from the position in withSubs([...]), which is why 7.x's `index: 3`
is dropped rather than translated. `id: 'search-dso'` and `active: false` are
dropped for the same reason: `PartialMenuSection.id` is optional and
auto-assigned, and no sibling provider sets either;
* `[queryParams]="itemModel.queryParams"` added to the LINK anchor in
dso-edit-menu-section.component.html. `LinkMenuItemModel.queryParams` already
exists on 9-base (vanilla) but the DSO-edit renderer silently dropped it, so
this one line is what makes the model half work.
The 7.x resolver-spec hunks have no target on v9 and are replaced by the new
provider spec (2 cases). The two page specs the source commit also adds
(community-page / collection-page) are deliberately NOT ported: they do not
exist on 9-base or on dspace-9.3, they are written pre-standalone, and their
single assertion is `expect(query(By.css('ds-dso-edit-menu'))).toBeTruthy()`,
which does not exercise this feature at all.
UX note, decided by the repository owner (decision O-4): on v9 every DSO_EDIT
sub-provider is nested under DsoOptionMenuProvider, so the magnifier is an entry
inside the "options" dropdown rather than a button next to Subscribe/Edit. The
new section is visible unconditionally (a scoped search was public on 7.x too),
which flips `hasSubSections$` from false to true for anonymous visitors and
therefore makes the "options" button itself visible to them for the first time.
That is accepted: the feature is unchanged, only the chrome around it is new.
Source: fecfa07 (dtq-dev PR #1326)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent bba4d90 commit 915c51d
5 files changed
Lines changed: 119 additions & 1 deletion
File tree
- src/app
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
173 | 177 | | |
174 | 178 | | |
175 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
176 | 189 | | |
177 | 190 | | |
178 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
0 commit comments