Skip to content

Commit d14ef60

Browse files
committed
Patch: Error when no token + Maintenance items
1 parent 9fc68a2 commit d14ef60

File tree

5 files changed

+322
-234
lines changed

5 files changed

+322
-234
lines changed

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ The goal is to continue to refine and improve this code base on a regular basis.
2121

2222
### Improvement plan
2323

24-
To manage development activities related to this project, a standard internal issue tracking system used at Principal Publisher will be used. Also, regular touchpoints with the search vendor, as well as formal service requests entered through their portal, could also spark some development activities from a vendor perspective.
24+
To manage development activities related to this project, a standard internal issue tracking system used at Principal Publisher will be used. Also, regular touchpoints with the search vendor, as well as formal service requests entered through their portal, could spark development activities from the vendor's team.
2525

2626
Example of code contributions may be related to:
2727

2828
- development/configurations of AI-powered features and other innovations
2929
- bug fixes, accessibility and security improvements
3030
- project maintenance chores
3131

32-
For more details, please [consult full checklist of to do items](todo.md).
32+
For more details, please [consult the checklist of "to do" items](todo.md).
3333

3434
## Releases and API
3535

3636
All changes contributed through Pull requests will be packaged as releases. Releases are completed through the "Releases" tab in this GitHub repository; then, deployment to MWS follows the reguar release management cycle accordingly.
3737

38-
Each new verion of this project is defined based on an evaluaton of the impacts of changes against any formerly up-to-date LIVE Search UI implementation on Canada.ca. The scope constitutes of all files within the "dist" folder (distribution files), which are JavaScript scripts and CSS styles. Additionally, volume of usage for features can also be taken into consideration as part of the evaluation of impact on versioning. For example, an interactive feature from the Javascript which is known by certitude to have never been used in a production environment, wouldn't cause any breaking change if modified and therefore, wouldn't generate a major version.
38+
Each new verion of this project is defined based on an evaluaton of the impacts of changes against any formerly up-to-date LIVE Search UI implementation on Canada.ca. The scope constitutes of all files within the "dist" folder (distribution files), which are JavaScript scripts and CSS style sheets. Additionally, volume of usage for features can also be taken into consideration as part of the evaluation of impact on versioning. For example, an interactive feature from the Javascript which is known by certitude to have never been used in a production environment, wouldn't cause any breaking change if modified and therefore, wouldn't generate a major version necessarily.
3939

40-
Search UI follows [Semantic Versioning 2.0.0](https://semver.org/)
40+
Aside from the evaluation based on usage, Search UI follows [Semantic Versioning 2.0.0](https://semver.org/)
4141

4242
---
4343

@@ -138,15 +138,15 @@ For example, to override the search results template, you would do something alo
138138
Template override should technically only be used on a few instances of the search pages. If all pages would benefit from a template override, then the recommended action would be to modify the default template HTML code at the source through a pull request.
139139

140140
- `sr-single`
141-
: Template for all search results individually
141+
: Template for all search results individually; your custom template MUST include an hyperlink with the class `result-link`, which SHOULD also include the data attribute `data-dtm-srchlnknm` for analytis tracking
142142
- `sr-nores`
143-
: For when there is no results to show
143+
: For when there is no results to show; your custom template MUST include a heading of level H2
144144
- `sr-error`
145-
: For when an error occurs in the communication between the search page and the search engine
145+
: For when an error occurs in the communication between the search page and the search engine; your custom template MUST include a heading of level H2
146146
- `sr-query-summary`
147-
: For the summary zone above the search results. Recommended to include an H2 tag for accessibility purposes
147+
: For the summary zone above the search results; your custom template MUST include a heading of level H2
148148
- `sr-noquery-summary`
149-
: For the summary zone above the search results on advanced search pages. Recommended to include an H2 tag for accessibility purposes
149+
: For the summary zone above the search results on advanced search pages; your custom template MUST include a heading of level H2
150150
- `sr-did-you-mean`
151151
: For the "Did you mean" suggestion section
152152
- `sr-pager-previous`
@@ -157,6 +157,8 @@ Template override should technically only be used on a few instances of the sear
157157
: For the next page button
158158
- `sr-pager-container`
159159
: For the wrapper of all pagniation button
160+
- `sr-qs-hint`
161+
: Message announced to screen reader to provide instructions on QS
160162

161163
As demonstrated in the example above, and by looking at the default templates, you'll notice that some variables can be used within the templates to be replaced by dynamic content coming from the search engine's API response.
162164

@@ -196,6 +198,10 @@ Here is the extensive list of what variables can be used in templates:
196198
: returns what the search engine considers a better search query in case a low amount or zero results show (based on criteria handled within the serach engine). To be used on Did you mean template
197199
- `page`
198200
: returns page number. To be used on Pagination template
201+
- `result.raw.disp_declared_type`
202+
: returns name of the declared type as defined in the meta data of the page (specific to News items)
203+
- `result.raw.description`
204+
: returns the meta description of the pages in the results; can be displayed instead of the default "matches excerpt".
199205

200206
#### Parameters
201207

@@ -218,7 +224,7 @@ Sometimes your search pages contain more than one input relevant to the search's
218224
- `dmn`
219225
: Search for search terms in input, only on a specific domain
220226
- `sort`
221-
: Sort search results based on different criteria. Options are: by relevance (default when undefined) or by date when parameter is set
227+
: Sort search results based on different criteria. Options are: by relevance (default when undefined) or by date when parameter is set to `descending` or `ascending`
222228
- `elctn_cat`
223229
: Used specifically for Elections Canada, to define a scope of search amongst their collection. See **/src/connector.js** to see all the options available
224230
- `site`
@@ -229,6 +235,12 @@ Sometimes your search pages contain more than one input relevant to the search's
229235
: Search , within documents of a certain file type. Options are: `application/pdf`, `ps`, `application/msword`, `application/vnd.ms-excel`, `application/vnd.ms-powerpoint`, `application/rtf`
230236
- `originLevel3`
231237
: Allows for mimicking a specific search page/context by setting its path through this URL parameter; this takes precedence over the configuration through data attribute
238+
- `startdate`
239+
: returns results that have a date meta data higher than or equal to the date provided
240+
- `enddate`
241+
: returns results that have a date meta data lower than or equal to the date provided
242+
- `declaredtype`
243+
: returns results based on the type provided, mapped to disp_declared_type behind the scenes (specific to News items)
232244

233245
### Other
234246

index.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
---
22
title: Search user interface (UI) with Headless
33
lang: en
4-
dateModified: 2025-08-04
4+
dateModified: 2025-11-03
55
---
66

77
<p class="lead">This is a demo site for the GC Search UI.</p>
88

9-
<h2 id="test">Test pages</h2>
10-
<p>To test search pages, please make sure you <a href="test/index.html">have a valid token</a>.</p>
9+
<h2 id="test">Working examples</h2>
10+
11+
<div class="alert alert-info" role="alert">
12+
<h3>Before you test</h3>
13+
<p>To properly test pages below, such as getting results back from the search engine, please make sure you <a href="test/index.html">have a valid token</a>.</p>
14+
</div>
1115

1216
<h3>Regular pages</h3>
1317
<ul>
@@ -29,6 +33,7 @@ <h3>Advanced tests</h3>
2933
<li><a href="test/budget.html">Budget sample</a></li>
3034
<li><a href="test/gazette.html">Canada Gazette sample</a></li>
3135
<li><a href="test/template.html">Custom summary and results templates</a></li>
36+
<li><a href="test/no-token.html">Error message when no access token provided</a></li>
3237
<li><a href="test/newsadv-en.html">News Advanced Search user interface</a></li>
3338
<li><a href="test/newsadv-fr.html">Interface utilisateur de la recherche avancée d'actualités</a></li>
3439
</ul>

0 commit comments

Comments
 (0)