Repository navigation
feat(docs-infra): add useful links if landed on 404 page - #34978
ajitsinghkaler wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Thx for taking this on, @ajitsinghkaler! Per the discussion in #31532, the generic links would appear if there can be no relevant search results. (I would be fine putting them below the search result too.)
So, they need to be somehow incorparated into the aio-file-not-found-search component.
99c2faf to
7daa5da
Compare
19aee04 to
e4c6619
Compare
|
@gkalpak can you please look into this too |
|
You can preview 99c2faf at https://pr34978-99c2faf.ngbuilds.io/. |
There was a problem hiding this comment.
Regarding why the e2e tests are failing:
The SearchResultsComponent will initially have an empty result set (since it hasn't received the search results yet) and will therefore show the #notFound template. At that point, however, the notFoundMessage property is set to "Searching...".
Then, once the results are received, the notFoundMessage is changed to "No results found" and either the #searchResults or the #notFound templates are shown (the latter now showing "No results found" instead of "Searching...").
So, while we pretend there are two states (no results or results), there are actually three: searching, no results, results
But we are piggybacking on the "no results" state to handle the "searching" case too.
Now, why this causes the e2e to fail?
In the e2e tests, we send a search query and run assertions against the search results. The way we retrieve the search results is by waiting for elements that match .search-results li.
Previously, such elements would only be present when there were some actual search results. With your changes, these elements are also present whenever the #notFound template is shown, which (as explained above) is also showing while the search is in progress.
As a result, the e2e tests will look at the generic links and think they are the search results returned by the search query and thus try to run assertions on them. These assertions will fail, of course, because these "results" do not contain the expected terms.
How to fix this?
I think the proper fix is to have three templates:
- One for when there are results (i.e. the
#searchResultstemplate we already have). - One for when there are no results showing the generic links (i.e. the
#notFoundtemplate, except with thenotFoundMessagehard-coded to "No results found."). - One for when the search is in progress without the generic links (and with a hard-coded "Searching..." message).
Then we would also need a property on the component to track whether a search is in progress or not.
LMK if that makes sense and whether you need any help with the implementation.
e4c6619 to
4da55d9
Compare
|
You can preview 4da55d9 at https://pr34978-4da55d9.ngbuilds.io/. |
4da55d9 to
6076979
Compare
|
@gkalpak I've made the changes pleas have a look |
|
You can preview 6076979 at https://pr34978-6076979.ngbuilds.io/. |
6076979 to
fed6345
Compare
|
You can preview fed6345 at https://pr34978-fed6345.ngbuilds.io/. |
|
@gkalpak why these hooks are failing can you please explain this. |
gkalpak
left a comment
There was a problem hiding this comment.
Thx for implementing this, @ajitsinghkaler! It is much cleaner now.
Can you also update the unit tests to at least verify when the extra links are shown?
fed6345 to
a750bd8
Compare
|
Hm...this PR seems to increase the main bundle by 1KB. Investigating whether that's expected... |
|
You can preview 57563b0 at https://pr34978-57563b0.ngbuilds.io/. |
In angular#35702, the payload size limit for Ivy builds was bumped to account for small incremental increases in recent PRs. The ViewEngine size has also increased similarly (~500B), but it was not updated in angular#35702, because its total increase was just below the 500B error threshold (by 6B). This commit bumps the ViewEngine size limit too. Note: Any investigation for the Ivy size increase (as a follow-up to angular#35702) will most likely also apply to ViewEngine, since the size was increased by the same amount.
…h results found Added additional links which can help user find the things they are looking for when there are no search results (when searching or on a 404 page). Note: This commit increases the main bundle's payload size due to the extra content of the `aio-search-results` component. Fixes angular#31532
…o search results found
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
OK, it seems that the increase is expected (and is caused by the changes and extra content in the I rebased on master, updated payload size limits for current master (to make it easy to see the increase by this PR) and bumped the payload size limits due to this PR's changes. |
|
You can preview 383a277 at https://pr34978-383a277.ngbuilds.io/. |
In #35702, the payload size limit for Ivy builds was bumped to account for small incremental increases in recent PRs. The ViewEngine size has also increased similarly (~500B), but it was not updated in #35702, because its total increase was just below the 500B error threshold (by 6B). This commit bumps the ViewEngine size limit too. Note: Any investigation for the Ivy size increase (as a follow-up to #35702) will most likely also apply to ViewEngine, since the size was increased by the same amount. PR Close #34978
…h results found (#34978) Added additional links which can help user find the things they are looking for when there are no search results (when searching or on a 404 page). Note: This commit increases the main bundle's payload size due to the extra content of the `aio-search-results` component. Fixes #31532 PR Close #34978
…h results found (#34978) Added additional links which can help user find the things they are looking for when there are no search results (when searching or on a 404 page). Note: This commit increases the main bundle's payload size due to the extra content of the `aio-search-results` component. Fixes #31532 PR Close #34978
In pr angular#34978 colors were not properly set, if we type wrong url in the browser and we are directed to the 404 page there some text is set to white color which as not visible set it to dark gray for visibility



Added additional links useful links which can help user find the things he is looking for on the 404 page
Fixes #31532
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
On no link found no additional shown which can be helpful
Issue Number: 31532
What is the new behavior?
Added additional links which can be helpful to users to find what they are looking for
Does this PR introduce a breaking change?
Other information