diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index c2603b8d2..c1bb46caa 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -61,20 +61,6 @@ www: fsGroup: 1000 runAsUser: 1000 runAsGroup: 1000 - tolerations: - - key: startup - operator: Equal - value: cdtn - effect: NoSchedule - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: nodepool - operator: In - values: - - cdtn-worker-nodepool export: ~chart: app @@ -100,20 +86,6 @@ export: oblik.socialgouv.io/min-request-memory: "2Gi" oblik.socialgouv.io/min-limit-cpu: "2000m" oblik.socialgouv.io/min-limit-memory: "4Gi" - tolerations: - - key: startup - operator: Equal - value: cdtn - effect: NoSchedule - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: nodepool - operator: In - values: - - cdtn-worker-nodepool hasura: ~chart: hasura diff --git a/CHANGELOG.md b/CHANGELOG.md index b16187c38..6329dd9d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.49.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.3...v2.49.4) (2024-09-26) + +### Bug Fixes + +- ne pas afficher les contribs personnalisées ([#1478](https://github.com/SocialGouv/cdtn-admin/issues/1478)) ([cfd1c8e](https://github.com/SocialGouv/cdtn-admin/commit/cfd1c8eb98ebb67a3741cf3bd49ea6b2bdabfc92)) + +## [2.49.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.2...v2.49.3) (2024-09-23) + +### Bug Fixes + +- augmente la taille autorisée pour glossariser un contenu ([#1476](https://github.com/SocialGouv/cdtn-admin/issues/1476)) ([d1d850e](https://github.com/SocialGouv/cdtn-admin/commit/d1d850ef2b6c3b54239a57239a1696c72a603e56)) +- back to main nodepool ([#1474](https://github.com/SocialGouv/cdtn-admin/issues/1474)) ([fa4294d](https://github.com/SocialGouv/cdtn-admin/commit/fa4294db291ad036e1245db11801317cde39d84d)) + ## [2.49.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.1...v2.49.2) (2024-09-18) ### Bug Fixes diff --git a/lerna.json b/lerna.json index fbf1426ff..3bf0bf768 100644 --- a/lerna.json +++ b/lerna.json @@ -7,6 +7,6 @@ } }, "npmClient": "yarn", - "version": "2.49.2", + "version": "2.49.4", "useWorkspaces": true } diff --git a/shared/elasticsearch/CHANGELOG.md b/shared/elasticsearch/CHANGELOG.md index 5fcc9ab4f..f8b6f8086 100644 --- a/shared/elasticsearch/CHANGELOG.md +++ b/shared/elasticsearch/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.49.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.3...v2.49.4) (2024-09-26) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.49.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.2...v2.49.3) (2024-09-23) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + ## [2.49.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.1...v2.49.2) (2024-09-18) **Note:** Version bump only for package @socialgouv/cdtn-elasticsearch diff --git a/shared/elasticsearch/package.json b/shared/elasticsearch/package.json index 0b643a76f..9d94d7aef 100644 --- a/shared/elasticsearch/package.json +++ b/shared/elasticsearch/package.json @@ -1,7 +1,7 @@ { "name": "@socialgouv/cdtn-elasticsearch", "description": "SocialGouv - Code du travail numerique - Infrastructure - Elasticsearch", - "version": "2.49.2", + "version": "2.49.4", "babel": { "plugins": [ "@babel/plugin-transform-modules-commonjs" diff --git a/shared/eslint-config/CHANGELOG.md b/shared/eslint-config/CHANGELOG.md index e2a66de3f..61c4f3ccc 100644 --- a/shared/eslint-config/CHANGELOG.md +++ b/shared/eslint-config/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.49.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.3...v2.49.4) (2024-09-26) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.49.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.2...v2.49.3) (2024-09-23) + +**Note:** Version bump only for package @shared/eslint-config + ## [2.49.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.1...v2.49.2) (2024-09-18) **Note:** Version bump only for package @shared/eslint-config diff --git a/shared/eslint-config/package.json b/shared/eslint-config/package.json index 5039b4cc0..8308172d6 100644 --- a/shared/eslint-config/package.json +++ b/shared/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@shared/eslint-config", - "version": "2.49.2", + "version": "2.49.4", "main": "index.js", "private": true, "dependencies": { diff --git a/shared/types/CHANGELOG.md b/shared/types/CHANGELOG.md index 645724d7f..1053d4263 100644 --- a/shared/types/CHANGELOG.md +++ b/shared/types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.49.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.3...v2.49.4) (2024-09-26) + +**Note:** Version bump only for package @socialgouv/cdtn-types + +## [2.49.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.2...v2.49.3) (2024-09-23) + +**Note:** Version bump only for package @socialgouv/cdtn-types + ## [2.49.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.1...v2.49.2) (2024-09-18) **Note:** Version bump only for package @socialgouv/cdtn-types diff --git a/shared/types/package.json b/shared/types/package.json index 3ca89b171..4f8929afd 100644 --- a/shared/types/package.json +++ b/shared/types/package.json @@ -10,7 +10,7 @@ "type": "git", "url": "https://github.com/SocialGouv/cdtn-admin.git" }, - "version": "2.49.2", + "version": "2.49.4", "main": "build/index.js", "module": "build/index.js", "types": "build/index.d.ts", diff --git a/shared/utils/CHANGELOG.md b/shared/utils/CHANGELOG.md index 95e480df5..59daf6735 100644 --- a/shared/utils/CHANGELOG.md +++ b/shared/utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.49.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.3...v2.49.4) (2024-09-26) + +**Note:** Version bump only for package @shared/utils + +## [2.49.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.2...v2.49.3) (2024-09-23) + +**Note:** Version bump only for package @shared/utils + ## [2.49.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.1...v2.49.2) (2024-09-18) **Note:** Version bump only for package @shared/utils diff --git a/shared/utils/package.json b/shared/utils/package.json index 9c94f7d8a..ea3951b9b 100644 --- a/shared/utils/package.json +++ b/shared/utils/package.json @@ -1,6 +1,6 @@ { "name": "@shared/utils", - "version": "2.49.2", + "version": "2.49.4", "dependencies": { "@socialgouv/cdtn-sources": "^4.91.1", "@socialgouv/cdtn-utils": "^4.109.0", diff --git a/targets/alert-cli/CHANGELOG.md b/targets/alert-cli/CHANGELOG.md index 77618dfdb..20b4ebff8 100644 --- a/targets/alert-cli/CHANGELOG.md +++ b/targets/alert-cli/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.49.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.3...v2.49.4) (2024-09-26) + +**Note:** Version bump only for package alert-cli + +## [2.49.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.2...v2.49.3) (2024-09-23) + +**Note:** Version bump only for package alert-cli + ## [2.49.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.1...v2.49.2) (2024-09-18) ### Bug Fixes diff --git a/targets/alert-cli/package.json b/targets/alert-cli/package.json index bd83ef1d5..50f71da93 100644 --- a/targets/alert-cli/package.json +++ b/targets/alert-cli/package.json @@ -1,6 +1,6 @@ { "name": "alert-cli", - "version": "2.49.2", + "version": "2.49.4", "engines": { "node": ">=20.0.2" }, diff --git a/targets/export-elasticsearch/CHANGELOG.md b/targets/export-elasticsearch/CHANGELOG.md index 7ede5613a..c7b18614e 100644 --- a/targets/export-elasticsearch/CHANGELOG.md +++ b/targets/export-elasticsearch/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.49.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.3...v2.49.4) (2024-09-26) + +**Note:** Version bump only for package export-elasticsearch + +## [2.49.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.2...v2.49.3) (2024-09-23) + +### Bug Fixes + +- augmente la taille autorisée pour glossariser un contenu ([#1476](https://github.com/SocialGouv/cdtn-admin/issues/1476)) ([d1d850e](https://github.com/SocialGouv/cdtn-admin/commit/d1d850ef2b6c3b54239a57239a1696c72a603e56)) + ## [2.49.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.1...v2.49.2) (2024-09-18) **Note:** Version bump only for package export-elasticsearch diff --git a/targets/export-elasticsearch/package.json b/targets/export-elasticsearch/package.json index 95ecd249b..920adf29c 100644 --- a/targets/export-elasticsearch/package.json +++ b/targets/export-elasticsearch/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "export-elasticsearch", - "version": "2.49.2", + "version": "2.49.4", "license": "MIT", "description": "", "main": "./build/index.js", diff --git a/targets/export-elasticsearch/src/server.ts b/targets/export-elasticsearch/src/server.ts index d038adb31..efd5c0292 100644 --- a/targets/export-elasticsearch/src/server.ts +++ b/targets/export-elasticsearch/src/server.ts @@ -4,6 +4,7 @@ import "./controllers"; import bodyParser from "body-parser"; import cors from "cors"; import type { NextFunction, Request, Response } from "express"; +import express from "express"; import { Container } from "inversify"; import { InversifyExpressServer } from "inversify-express-utils"; @@ -11,7 +12,7 @@ import { ExportEsRunMiddleware, GlossaryMiddleware, } from "./controllers/middlewares"; -import { S3Parameters, S3Repository, ExportRepository } from "./repositories"; +import { ExportRepository, S3Parameters, S3Repository } from "./repositories"; import { CopyContainerService, ExportService, @@ -87,6 +88,9 @@ rootContainer // create server const server = new InversifyExpressServer(rootContainer); server.setConfig((srv) => { + // Increase limit for glossary + srv.use(express.json({ limit: "5mb" })); + // add body parser srv.use( bodyParser.urlencoded({ diff --git a/targets/frontend/CHANGELOG.md b/targets/frontend/CHANGELOG.md index 37d3e45e4..0511c9a4a 100644 --- a/targets/frontend/CHANGELOG.md +++ b/targets/frontend/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.49.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.3...v2.49.4) (2024-09-26) + +### Bug Fixes + +- ne pas afficher les contribs personnalisées ([#1478](https://github.com/SocialGouv/cdtn-admin/issues/1478)) ([cfd1c8e](https://github.com/SocialGouv/cdtn-admin/commit/cfd1c8eb98ebb67a3741cf3bd49ea6b2bdabfc92)) + +## [2.49.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.2...v2.49.3) (2024-09-23) + +**Note:** Version bump only for package frontend + ## [2.49.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.1...v2.49.2) (2024-09-18) **Note:** Version bump only for package frontend diff --git a/targets/frontend/package.json b/targets/frontend/package.json index 12e3caa50..e6b2d8d4a 100644 --- a/targets/frontend/package.json +++ b/targets/frontend/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "2.49.2", + "version": "2.49.4", "dependencies": { "@aws-sdk/client-s3": "^3.525.0", "@codegouvfr/react-dsfr": "^0.76.4", diff --git a/targets/frontend/src/components/documents/Container.js b/targets/frontend/src/components/documents/Container.js index c8ebf5703..97f18a8c5 100644 --- a/targets/frontend/src/components/documents/Container.js +++ b/targets/frontend/src/components/documents/Container.js @@ -129,9 +129,10 @@ DocumentListContainer.propTypes = { const searchDocumentQuery = ` query documents($source: String, $search: String!, $published: [Boolean!]!, $available: [Boolean!]!, $offset: Int = 0, $limit: Int = 50) { documents(where: { - _not: { - document: {_has_key: "split"} - } + _or: [ + { source: { _neq: "contributions" } } + { source: { _eq: "contributions" }, document: { _contains: { idcc: "0000" } } } + ] _and: { source: {_eq: $source, _neq: "code_du_travail"} title: {_ilike: $search} @@ -149,9 +150,10 @@ query documents($source: String, $search: String!, $published: [Boolean!]!, $ava } documents_aggregate(where: { - _not: { - document: {_has_key: "split"} - } + _or: [ + { source: { _neq: "contributions" } } + { source: { _eq: "contributions" }, document: { _contains: { idcc: "0000" } } } + ] _and: { source: {_eq: $source, _neq: "code_du_travail"} title: {_ilike: $search}, diff --git a/targets/frontend/src/components/documents/SearchFilters.js b/targets/frontend/src/components/documents/SearchFilters.js index 503fad852..23bffb6d8 100644 --- a/targets/frontend/src/components/documents/SearchFilters.js +++ b/targets/frontend/src/components/documents/SearchFilters.js @@ -12,7 +12,6 @@ import { Select, Stack, } from "@mui/material"; -import { useQuery } from "urql"; import { Button } from "../button"; @@ -36,28 +35,8 @@ export function SearchFilters({ initialValues, onSearchUpdate }) { ]; const { handleSubmit, register } = useForm(); - const [result] = useQuery({ - query: sourceQuery, - variables: { - available: - initialValues.available === "yes" - ? [true] - : initialValues.available === "no" - ? [false] - : [true, false], - published: - initialValues.published === "yes" - ? [true] - : initialValues.published === "no" - ? [false] - : [true, false], - search: `%${initialValues.q}%`, - source: initialValues.source || null, - }, - }); function triggerUpdateUrl(event) { - console.log("update filters"); onSearchUpdate({ ...initialValues, [event.target.name]: @@ -201,23 +180,3 @@ SearchFilters.propTypes = { }), onSearchUpdate: PropTypes.func.isRequired, }; - -const sourceQuery = ` -query documents($source: String, $search: String!, $published: [Boolean!]!, $available: [Boolean!]!) { - sources: documents_aggregate(where: { - _not: { - document: {_has_key: "split"} - } - _and: { - source: {_eq: $source, _neq: "code_du_travail"} - title: {_ilike: $search}, - is_published: {_in: $published} - is_available: {_in: $available} - } - }) { - nodes { - source - } - } -} -`; diff --git a/targets/frontend/src/components/forms/ContentPicker/ContentSearch.js b/targets/frontend/src/components/forms/ContentPicker/ContentSearch.js index 099ae8dc8..80fb88372 100644 --- a/targets/frontend/src/components/forms/ContentPicker/ContentSearch.js +++ b/targets/frontend/src/components/forms/ContentPicker/ContentSearch.js @@ -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 @@ -136,6 +146,7 @@ const renderInputComponent = (inputProps) => ( function shouldRenderSuggestions(value) { return value.trim().length > 2; } + function renderSectionTitle(section) { return section.suggestions.length ? ( @@ -154,7 +165,7 @@ const renderSuggestion = (content) => (
{content.title} {content.category === "document" && ( - | {getLabelBySource(content.source)} + | {getLabelBySource(content.source)} )}
); diff --git a/targets/frontend/src/components/home/UnThemedContent.tsx b/targets/frontend/src/components/home/UnThemedContent.tsx index 205056946..0d2a6ea0c 100644 --- a/targets/frontend/src/components/home/UnThemedContent.tsx +++ b/targets/frontend/src/components/home/UnThemedContent.tsx @@ -18,12 +18,9 @@ query getUnthemed($themeSources: [String!]!) { {_not: { relation_b: {type: {_eq: "${RELATIONS.THEME_CONTENT}"} a :{source: {_eq: "${SOURCES.THEMES}"}} } }} - {_and: [ - {_not: {document: {_has_key: "split"}}}, - {_or: [ - {_not: {document: {_has_key: "idcc"}}}, - {document: {_contains: {idcc: "0000"}}} - ]} + {_or: [ + {_not: {document: {_has_key: "idcc"}}}, + {document: {_contains: {idcc: "0000"}}} ]} ] }) { diff --git a/targets/ingester/CHANGELOG.md b/targets/ingester/CHANGELOG.md index 59e4da26e..ee632beaa 100644 --- a/targets/ingester/CHANGELOG.md +++ b/targets/ingester/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.49.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.3...v2.49.4) (2024-09-26) + +**Note:** Version bump only for package ingester + +## [2.49.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.2...v2.49.3) (2024-09-23) + +**Note:** Version bump only for package ingester + ## [2.49.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.49.1...v2.49.2) (2024-09-18) **Note:** Version bump only for package ingester diff --git a/targets/ingester/package.json b/targets/ingester/package.json index ab57e2990..bfabbb7bd 100644 --- a/targets/ingester/package.json +++ b/targets/ingester/package.json @@ -1,6 +1,6 @@ { "name": "ingester", - "version": "2.49.2", + "version": "2.49.4", "dependencies": { "@shared/utils": "workspace:^", "@socialgouv/cdtn-slugify": "4.52.1",