Skip to content

Commit

Permalink
Merge commit '3fa2bc97256bd854fc8f34cf99e7c3df3f70f0dc' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonestla committed Dec 11, 2024
2 parents c1f5518 + 3fa2bc9 commit 916a2f6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 39 deletions.
4 changes: 2 additions & 2 deletions client/src/pages/networks/components/clusters/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function ClustersButton() {
const { currentTab } = useTab()
const { integrationOptions } = useIntegration()
const { parameters, handleParametersChange } = useParameters()
const { search, currentQuery } = useSearchData(currentTab)
const { search } = useSearchData(currentTab)

if (integrationOptions.showClustersButton === false) return null

Expand All @@ -22,7 +22,7 @@ export default function ClustersButton() {
iconPosition="right"
icon={parameters.clusters ? "arrow-up-line" : "arrow-down-line"}
onClick={() => handleParametersChange("clusters", !parameters.clusters)}
disabled={search.isFetching || Boolean(search.error) || !currentQuery}
disabled={search.isFetching || Boolean(search.error)}
>
{intl.formatMessage({
id: parameters.clusters ? "networks.clusters.button.rm" : "networks.clusters.button.add",
Expand Down
33 changes: 17 additions & 16 deletions client/src/pages/networks/components/search-bar/get-started.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default function NetworkSearchBarGetStarted() {
<NetworkGetStartedPage title={intl.formatMessage({ id: "networks.get-started.search-bar.title" })}>
<Text>{intl.formatMessage({ id: "networks.get-started.search-bar.description" })}</Text>
<SearchBar
className="fr-mb-4w"
isLarge
buttonLabel={intl.formatMessage({ id: "networks.search-bar.button-label" })}
placeholder={intl.formatMessage({ id: "networks.search-bar.placeholder" })}
Expand All @@ -22,26 +23,26 @@ export default function NetworkSearchBarGetStarted() {
handlePageChange({ q: networkQuery(value) })
}}
/>
<TagGroup className="fr-mt-2w">
<Tag as="button" onClick={() => handleQueryChange('"Exemple 1"')}>
{"Exemple 1"}
<Text size="sm" className="fr-mb-1w">
{intl.formatMessage({ id: "networks.get-started.search-bar.examples" })}
</Text>
<TagGroup>
<Tag as="button" onClick={() => handleQueryChange("*")}>
{"Tout rechercher"}
</Tag>
<Tag as="button" onClick={() => handleQueryChange('"Exemple 2" AND "Example 3"')}>
{'"Exemple 2" AND "Example 3"'}
<Tag as="button" onClick={() => handleQueryChange('"quantum mechanics" AND dna')}>
{'"quantum mechanics" AND dna'}
</Tag>
<Tag as="button" onClick={() => handleQueryChange('("Exemple 4" AND "Exemple 5") OR ("Example 6")')}>
{'("Exemple 4" AND "Exemple 5") OR ("Example 6")'}
<Tag as="button" onClick={() => handleQueryChange("forest NOT (cosmology OR random)")}>
{"forest NOT (cosmology OR random)"}
</Tag>
</TagGroup>
{/* <Text size="sm" className="fr-mt-3w">
{"La fonction de recherche utilise le moteur Elasticsearch : "}
<Link
target="_blank"
href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html"
<Tag
as="button"
onClick={() => handleQueryChange('("climate model" OR "climate models") AND NOT (mars OR saturne)')}
>
{"voir la documentation"}
</Link>
</Text> */}
{'("climate model" OR "climate models") AND NOT (mars OR saturn)'}
</Tag>
</TagGroup>
</NetworkGetStartedPage>
)
}
22 changes: 1 addition & 21 deletions client/src/pages/networks/components/search-bar/modal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Container, SearchBar, Tag, TagGroup } from "@dataesr/dsfr-plus"
import { Container, SearchBar } from "@dataesr/dsfr-plus"
import Modal from "../../../../components/modal"
import useUrl from "../../../search/hooks/useUrl"
import { useIntl } from "react-intl"
Expand All @@ -23,26 +23,6 @@ export default function NetworkSearchBarModal() {
window.dsfr(document.getElementById(id)).modal.conceal()
}}
/>
<TagGroup className="fr-mt-2w">
<Tag as="button" onClick={() => handleQueryChange('"Exemple 1"')}>
{"Exemple 1"}
</Tag>
<Tag as="button" onClick={() => handleQueryChange('"Exemple 2" AND "Example 3"')}>
{'"Exemple 2" AND "Example 3"'}
</Tag>
<Tag as="button" onClick={() => handleQueryChange('("Exemple 4" AND "Exemple 5") OR ("Example 6")')}>
{'("Exemple 4" AND "Exemple 5") OR ("Example 6")'}
</Tag>
</TagGroup>
{/* <Text size="sm" className="fr-mt-3w">
{"La fonction de recherche utilise le moteur Elasticsearch : "}
<Link
target="_blank"
href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html"
>
{"voir la documentation"}
</Link>
</Text> */}
</Container>
</Modal>
)
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/networks/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"networks.get-started.home.text-2": "It takes the form of a network visualization, highlighting co-occurrences and communities present in a corpus of documents.",
"networks.get-started.search-bar.title": "What are you looking for?",
"networks.get-started.search-bar.description": "Define the scope of the corpus to be analyzed by searching our databases.",
"networks.get-started.search-bar.examples": "Examples :",
"networks.get-started.select-source.title": "Which source do you want to use?",
"networks.get-started.select-source.description": "Choose the source of documents to be analyzed.",
"networks.get-started.select-model.title": "Which communities do you want to visualize?",
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/networks/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"networks.get-started.home.text-2": "Il prend la forme d'une visualisation de réseaux, mettant en évidence les co-occurrences et les communautés présentes dans un corpus de documents.",
"networks.get-started.search-bar.title": "Que recherchez vous ?",
"networks.get-started.search-bar.description": "Définissez le périmètre du corpus à analyser grâce à une recherche dans nos bases de données.",
"networks.get-started.search-bar.examples": "Exemples :",
"networks.get-started.select-source.title": "Quelle source voulez-vous utiliser ?",
"networks.get-started.select-source.description": "Choississez la source de documents à analyser.",
"networks.get-started.select-model.title": "Quelles communautés souhaitez-vous visualiser ?",
Expand Down

0 comments on commit 916a2f6

Please sign in to comment.