Skip to content

Commit

Permalink
Merge branch 'master' into linked-contribution-title
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineBda committed Sep 26, 2024
2 parents bdb4f4f + f7f0d8a commit 625f29c
Show file tree
Hide file tree
Showing 24 changed files with 119 additions and 93 deletions.
28 changes: 0 additions & 28 deletions .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
}
},
"npmClient": "yarn",
"version": "2.49.2",
"version": "2.49.4",
"useWorkspaces": true
}
8 changes: 8 additions & 0 deletions shared/elasticsearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shared/elasticsearch/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 8 additions & 0 deletions shared/eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shared/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shared/eslint-config",
"version": "2.49.2",
"version": "2.49.4",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
8 changes: 8 additions & 0 deletions shared/types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shared/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions shared/utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shared/utils/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 8 additions & 0 deletions targets/alert-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion targets/alert-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alert-cli",
"version": "2.49.2",
"version": "2.49.4",
"engines": {
"node": ">=20.0.2"
},
Expand Down
10 changes: 10 additions & 0 deletions targets/export-elasticsearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion targets/export-elasticsearch/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "export-elasticsearch",
"version": "2.49.2",
"version": "2.49.4",
"license": "MIT",
"description": "",
"main": "./build/index.js",
Expand Down
6 changes: 5 additions & 1 deletion targets/export-elasticsearch/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ 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";

import {
ExportEsRunMiddleware,
GlossaryMiddleware,
} from "./controllers/middlewares";
import { S3Parameters, S3Repository, ExportRepository } from "./repositories";
import { ExportRepository, S3Parameters, S3Repository } from "./repositories";
import {
CopyContainerService,
ExportService,
Expand Down Expand Up @@ -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({
Expand Down
10 changes: 10 additions & 0 deletions targets/frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion targets/frontend/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
14 changes: 8 additions & 6 deletions targets/frontend/src/components/documents/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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},
Expand Down
41 changes: 0 additions & 41 deletions targets/frontend/src/components/documents/SearchFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Select,
Stack,
} from "@mui/material";
import { useQuery } from "urql";

import { Button } from "../button";

Expand All @@ -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]:
Expand Down Expand Up @@ -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
}
}
}
`;
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

0 comments on commit 625f29c

Please sign in to comment.