-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[App Search] Update EngineRouter & EngineNav to use EngineLogic #83138
Conversation
- useEffect init - redirect/data loading - setQueuedErrorMessage helper
- logic values - icon alerts - update tests w/ real conditional testing + remove use of mount, mount combined with shallow_useeffect leads to weirdness
...ck/plugins/enterprise_search/public/applications/app_search/components/engine/engine_nav.tsx
Outdated
Show resolved
Hide resolved
<EuiFlexGroup justifyContent="spaceBetween" gutterSize="none"> | ||
<EuiFlexItem>{RELEVANCE_TUNING_TITLE}</EuiFlexItem> | ||
<EuiFlexItem className="appSearchNavIcons"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I debated pulling this out into a separate component called EngineNavAlerts or something, but eventually decided against it for now - it felt like a pre-optimization and tests felt easier to write and more clear w/o it. We can definitely do so if we start adding more engine nav icons in the future though.
@@ -107,4 +107,30 @@ describe('engine routes', () => { | |||
}); | |||
}); | |||
}); | |||
|
|||
describe('GET /api/app_search/engines/{name}', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this made sense in the same file as the collective/plural /api/app_search/engines
, but lmk if you disagree!
/> | ||
)} | ||
{unsearchedUnconfirmedFields && ( | ||
<EuiIcon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI - I don't super love the screen reader effect of these icons since it reads out (e.g.) "Relevance Tuning Invalid Boosts" all together without much pause, but I'm not 100% sure how to fix this without a lot more code. Happy to investigate later as tech debt though!
const label = wrapper.find('[data-test-subj="EngineLabel"]').last(); | ||
expect(label.text()).toEqual(expect.stringContaining('SOME-ENGINE')); | ||
setMockValues({ ...values, isSampleEngine: true }); | ||
wrapper.setProps({}); // Re-render |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a PR coming immediately after this one that creates a new rerender(wrapper);
test helper so we don't need all these clarification comments.
...ugins/enterprise_search/public/applications/app_search/components/engine/engine_nav.test.tsx
Outdated
Show resolved
Hide resolved
...ugins/enterprise_search/public/applications/app_search/components/engine/engine_nav.test.tsx
Outdated
Show resolved
Hide resolved
...ugins/enterprise_search/public/applications/app_search/components/engine/engine_nav.test.tsx
Outdated
Show resolved
Hide resolved
...ugins/enterprise_search/public/applications/app_search/components/engine/engine_nav.test.tsx
Outdated
Show resolved
Hide resolved
When I create a new engine and populate it with documents... i see neither of these things. I see neither a Crawler link nor a Schema icon |
Shouldn't this be next the the "Schema" nav item, not the "Relevance tuning" tab? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of QA related concerns. Otherwise, I really like how this turned out, it looks and works great.
Aside: I wish GitHub let you thread remarks not just on code comments
Shoot sorry - I forgot to mention you need to have started ent-search locally with
Make sure your local ent-search is on latest master. It should at the very minimum have https://github.com/elastic/ent-search/pull/2457 merged in
No, this was moved in https://github.com/elastic/ent-search/pull/2457 as a UX enhancement - check out the screencaps in that thread for more context on the new callouts being shown. The reason is that the place to actually fix unsearched fields is in Relevance Tuning, not in Schema, so the icon should be shown over Relevance Tuning. That being said, Schema should still show an info icon and warning callout as well. |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
Ah ok, I was able to confirm now, finally. |
…) (#83207) * Add server-side route * Add EngineRouter logic - useEffect init - redirect/data loading - setQueuedErrorMessage helper * Add EngineNav logic - logic values - icon alerts - update tests w/ real conditional testing + remove use of mount, mount combined with shallow_useeffect leads to weirdness * Split out EngineRouter and EngineNav into separate files * [PR feedback] More explicit test cases
…ts-public * upstream/master: (57 commits) Remove unused asciidoc file (elastic#83228) [Lens] Remove background from lens embeddable (elastic#83061) [Discover] Unskip flaky tests based on discover fixture index pattern (elastic#82991) Removing unnecessary trailing slash in CODEOWNERS Trying to fix CODEOWNERS again, where was a non-existent team prior (elastic#83236) Trying to fix CODEOWERS, missing a starting slash (elastic#83233) skip flaky suite (elastic#83231) Add enzyme rerender test helper (elastic#83208) Move Elasticsearch type definitions out of APM (elastic#83081) [ts/checkTsProjects] produce a more useful error message (elastic#83209) [kbnClient] retry updating config if necessary (elastic#83205) I accidentally removed this line in a recent PR (elastic#83201) Don't make the caller do work the function can do (elastic#83180) [App Search] Update EngineRouter & EngineNav to use EngineLogic (elastic#83138) [Workplace Search] Add routes for Sources (elastic#83125) Update logstash pipeline management to use system index APIs (elastic#80405) [ML] Replace EuiBasicTable with EuiInMemoryTable (elastic#83057) [Metrics UI] Add basic interaction and shell for node details overlay (elastic#82013) [App Search] Added the log retention confirmation modal to the Settings page (elastic#83009) [docs] Fix create map title in import geospatial page (elastic#83172) ...
Summary
Screencaps
QA
Router tests
http://localhost:5601/api/app_search/engines/{ENGINE}
in your logs and that its response returns the JSON you'd expect to see from our internal engine APIEngine nav tests
"test": "test",
in the sample JSON/ent/select
). Then create a meta engine with the sample engine and your new engine as sourcesChecklist