Skip to content

[App Search] Wired up existing promoted documents on suggestion view#113967

Merged
JasonStoltz merged 6 commits intoelastic:masterfrom
JasonStoltz:suggestion-view
Oct 6, 2021
Merged

[App Search] Wired up existing promoted documents on suggestion view#113967
JasonStoltz merged 6 commits intoelastic:masterfrom
JasonStoltz:suggestion-view

Conversation

@JasonStoltz
Copy link
Member

Summary

This PR wires up the existing promoted documents section of the suggestion details view.

If a suggestion has an existing curation associated with it, you will see the following page:
screencapture-localhost-5601-pow-app-enterprise-search-app-search-engines-pokemon-curations-suggestions-shelll-2021-10-05-12_29_55

If not, you will see:
screencapture-localhost-5601-pow-app-enterprise-search-app-search-engines-pokemon-curations-suggestions-foo-bar-baz-2021-10-05-12_29_39

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@JasonStoltz JasonStoltz requested a review from a team October 5, 2021 16:31
@JasonStoltz JasonStoltz added v7.16.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed labels Oct 5, 2021
Copy link
Contributor

@byronhulcher byronhulcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, left some minor comments

{results.length > 0 ? (
results.map((result) => (
<EuiFlexItem grow={false} key={result.id.raw}>
<EuiFlexItem key={result.id.raw} style={{ width: '100%' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather this was in a SCSS file but 🤷

}),
}
);
const [documentDetails, curation] = await Promise.all(promises);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great solution!

Comment on lines +147 to +165
const getDocumentDetails = async (http: HttpSetup, engineName: string, documentIds: string[]) => {
return http.post(`/internal/app_search/engines/${engineName}/search`, {
query: { query: '' },
body: JSON.stringify({
page: {
size: 100,
},
filters: {
id: documentIds,
},
}),
});
};

const getCuration = async (http: HttpSetup, engineName: string, curationId: string) => {
return http.get(`/internal/app_search/engines/${engineName}/curations/${curationId}`, {
query: { skip_record_analytics: 'true' },
});
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth testing these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, there's no logic to them, I just pulled them out for readability.

@byronhulcher
Copy link
Contributor

@elasticmachine merge upstream

@byronhulcher
Copy link
Contributor

@elasticmachine merge upstream

@byronhulcher
Copy link
Contributor

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 1.4MB 1.4MB +368.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @byronhulcher

@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes v7.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants