Skip to content
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

fix: ne pas afficher les contribs personnalisées #1478

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ const AUTOSUGGEST_MAX_RESULTS = 15;

const searchDocumentsQuery = `
query searchDocuments($sources: [String!]! = "", $search: String = "") {
documents(where: {title: {_ilike: $search}, source: {_in: $sources}, _not: {document: {_has_key: "split"}}}, limit: ${AUTOSUGGEST_MAX_RESULTS}) {
documents(
where: {
title: { _ilike: $search }
source: { _in: $sources }
_or: [
{ source: { _neq: "contributions" } }
{ source: { _eq: "contributions" }, document: { _contains: { idcc: "0000" } } }
]
}
limit: ${AUTOSUGGEST_MAX_RESULTS}
) {
source
title
cdtnId: cdtn_id
Expand Down Expand Up @@ -136,6 +146,7 @@ const renderInputComponent = (inputProps) => (
function shouldRenderSuggestions(value) {
return value.trim().length > 2;
}

function renderSectionTitle(section) {
return section.suggestions.length ? (
<Box bg={th.colors.neutral} fontWeight="bold" p={th.space.xxsmall}>
Expand All @@ -154,7 +165,7 @@ const renderSuggestion = (content) => (
<div>
{content.title}
{content.category === "document" && (
<strong> | {getLabelBySource(content.source)}</strong>
<strong> | {getLabelBySource(content.source)}</strong>
)}
</div>
);
Expand Down
Loading