diff --git a/.github/workflows/deactivate.yaml b/.github/workflows/deactivate.yaml index 5f278864c7..5801ad4869 100644 --- a/.github/workflows/deactivate.yaml +++ b/.github/workflows/deactivate.yaml @@ -14,5 +14,5 @@ concurrency: jobs: kontinuous: - uses: socialgouv/workflows/.github/workflows/use-ks-gh-deactivate.yaml@v1 + uses: socialgouv/workflows/.github/workflows/use-ks-gh-with-env-deactivate.yaml@v1 secrets: inherit diff --git a/.github/workflows/preproduction.yaml b/.github/workflows/preproduction.yaml index 96259c0f5a..37ff42af4a 100644 --- a/.github/workflows/preproduction.yaml +++ b/.github/workflows/preproduction.yaml @@ -13,5 +13,5 @@ concurrency: jobs: kontinuous: name: "Deploy on Kubernetes 🐳" - uses: socialgouv/workflows/.github/workflows/use-ks-gh-preproduction.yaml@v1 + uses: socialgouv/workflows/.github/workflows/use-ks-gh-with-env-preproduction.yaml@v1 secrets: inherit diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index fc57d4c880..1b0bb01da5 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -12,5 +12,5 @@ concurrency: jobs: kontinuous: name: "Deploy on Kubernetes 🐳" - uses: socialgouv/workflows/.github/workflows/use-ks-gh-production.yaml@v1 + uses: socialgouv/workflows/.github/workflows/use-ks-gh-with-env-production.yaml@v1 secrets: inherit diff --git a/.github/workflows/review-auto.yaml b/.github/workflows/review-auto.yaml index 26272555c2..86caf77d67 100644 --- a/.github/workflows/review-auto.yaml +++ b/.github/workflows/review-auto.yaml @@ -15,5 +15,5 @@ concurrency: jobs: kontinuous: name: "Deploy on Kubernetes 🐳" - uses: socialgouv/workflows/.github/workflows/use-ks-gh-review-auto.yaml@master + uses: socialgouv/workflows/.github/workflows/use-ks-gh-with-env-review-auto.yaml@master secrets: inherit diff --git a/.github/workflows/review.yaml b/.github/workflows/review.yaml index e7d42a37c7..14a7a97232 100644 --- a/.github/workflows/review.yaml +++ b/.github/workflows/review.yaml @@ -12,5 +12,5 @@ concurrency: jobs: kontinuous: name: "Deploy on Kubernetes 🐳" - uses: socialgouv/workflows/.github/workflows/use-ks-gh-review.yaml@v1 + uses: socialgouv/workflows/.github/workflows/use-ks-gh-with-env-review.yaml@v1 secrets: inherit diff --git a/.kontinuous/config.yaml b/.kontinuous/config.yaml index f2b7eea90f..b1bc4f8370 100644 --- a/.kontinuous/config.yaml +++ b/.kontinuous/config.yaml @@ -2,19 +2,4 @@ projectName: cdtn dependencies: fabrique: extends: - - name: buildkit-service - dependencies: - contrib: - preDeploy: - importSecrets: - options: - secrets: - cdtnadminprodserver-backup-credentials: - env: [dev, preprod] - required: true - cdtn-prod-backups-access-key: - env: [prod] - required: true - cdtn-dev-backups-access-key: - env: [dev, preprod] - required: true + - name: ovh diff --git a/.kontinuous/env/dev/templates/contributions.configmap.yaml b/.kontinuous/env/dev/templates/contributions.configmap.yaml deleted file mode 100644 index 1f59b16aa2..0000000000 --- a/.kontinuous/env/dev/templates/contributions.configmap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: contributions -data: - CDTN_API_URL: "https://cdtn-api.fabrique.social.gouv.fr" - API_URI: "http://www" - HASURA_GRAPHQL_ENDPOINT: "http://hasura/v1/graphql" - NODE_ENV: "production" diff --git a/.kontinuous/env/dev/templates/contributions.sealed-secret.yaml b/.kontinuous/env/dev/templates/contributions.sealed-secret.yaml deleted file mode 100644 index c0d4153079..0000000000 --- a/.kontinuous/env/dev/templates/contributions.sealed-secret.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -apiVersion: "bitnami.com/v1alpha1" -kind: "SealedSecret" -metadata: - annotations: &a1 - sealedsecrets.bitnami.com/cluster-wide: "true" - name: contributions - namespace: null -spec: - encryptedData: - HASURA_GRAPHQL_ADMIN_SECRET: AgC4DoTx/Burraa4LQnxWJ8pa4gK7mSHWd4fFFUHWeVrTmcoxLRyVVqH8ajgXFBZ1uksTujs8LM0eDtxeO/d6e88y7lF8epCutVm/9Lr39E8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0uQj/uJEaZxIF4st3/r+iSGnrtPveBqnUgkJeqOmhf4sWJwE3xsPJM2kNYDPelWpYdxpoPaq3PNcLs7WpxMtRvwvvz2LMsWhEuUyHpe5yLOvi5swhcGqX1ALxGxfxzV+O229WfuTmV/kGUmcHhdf/VXdJRa+PYS83YK39wC1ZsoXJvPjAvEMgoTaRE8NHPWVD2ookNwdiRQIoLrSrGMP6F+Team2KtCic9ONYnM2wwUj2JCQRkFX2LZXwm9g9uR/Leuyd/IL5+tczwfF+PHfs6TQv+uKVz2qoZQZk4myQ/0JwHluOSXHTwEWkvuwGYO8QMTDOTTdp4Dor3kN7hQZyvWf41V/EHmOoLeFsdpQkWexo1FWHRZYtgG7ZVrgs07bY65gY6c1tZOKFaWhacTuneiLosz79vxn5omsFpjOOiWdSQOPZU8GkGxqJVq16H3VJg== - template: - metadata: - annotations: *a1 - name: contributions - type: "Opaque" diff --git a/.kontinuous/env/dev/templates/export.configmap.yaml b/.kontinuous/env/dev/templates/export.configmap.yaml index 135b844844..5c9fccd992 100644 --- a/.kontinuous/env/dev/templates/export.configmap.yaml +++ b/.kontinuous/env/dev/templates/export.configmap.yaml @@ -4,7 +4,7 @@ metadata: name: export-elasticsearch data: HASURA_GRAPHQL_ENDPOINT: "http://hasura/v1/graphql" - NLP_URL: "https://serving-ml-preprod.dev.fabrique.social.gouv.fr" + NLP_URL: "https://serving-ml-preprod.ovh.fabrique.social.gouv.fr" NODE_ENV: "production" LOG_LEVEL: "info" GLOSSARY_PREPROD_DISABLE: "true" diff --git a/.kontinuous/env/dev/templates/tipimail.sealed-secret.yaml b/.kontinuous/env/dev/templates/tipimail.sealed-secret.yaml new file mode 100644 index 0000000000..f95fde4d13 --- /dev/null +++ b/.kontinuous/env/dev/templates/tipimail.sealed-secret.yaml @@ -0,0 +1,17 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" + name: tipimail +spec: + encryptedData: + SMTP_E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+vo/FXE5UbmJDMKFpv+z7nQT31TAwr8dft/1lg2nnn76ZGD2mS5XA1X/piUz8/KuxDDDsOttvyJQqd/wptKgHj+fkmvWfoUGrcmJTud/QkI/BbJw== + template: + metadata: + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" + name: tipimail + type: Opaque diff --git a/.kontinuous/env/dev/templates/www.configmap.yaml b/.kontinuous/env/dev/templates/www.configmap.yaml index c7f8a756d2..f944770dee 100644 --- a/.kontinuous/env/dev/templates/www.configmap.yaml +++ b/.kontinuous/env/dev/templates/www.configmap.yaml @@ -6,7 +6,6 @@ data: HASURA_GRAPHQL_ENDPOINT: "http://hasura/v1/graphql" MATOMO_URL: "https://matomo.fabrique.social.gouv.fr/" NODE_ENV: "production" - SMTP_URL: "smtp.tipimail.com" URL_EXPORT: "http://export" BUCKET_PUBLIC_ENDPOINT: "https://cdtn-dev-public.s3.gra.io.cloud.ovh.net" BUCKET_DEFAULT_FOLDER: "default" diff --git a/.kontinuous/env/dev/templates/www.sealed-secret.yaml b/.kontinuous/env/dev/templates/www.sealed-secret.yaml index e9beb0e116..a51e1cf56c 100644 --- a/.kontinuous/env/dev/templates/www.sealed-secret.yaml +++ b/.kontinuous/env/dev/templates/www.sealed-secret.yaml @@ -1,23 +1,17 @@ ---- -apiVersion: "bitnami.com/v1alpha1" -kind: "SealedSecret" +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret metadata: - annotations: &a1 + annotations: sealedsecrets.bitnami.com/cluster-wide: "true" name: www - namespace: null spec: encryptedData: - ELASTICSEARCH_URL: AgDWMfg5QLe5H8WK5qlEqXNRE1etDhonIg9uqPJGV6/tusJD647Kvw1oULkZKPdjrLqI1sSwKCQxCF7dwQTAiAHajmCmNwE6u6juCOGOwo7toSAMfZuN/+34l97vb5sbajgBXwuFKs+0+kqJHbZkL7zHqyEyscENeHa1BzYdG46DiEIU3EXdkBXd+oNH/GDm4CHbWAyYblddFhYl2Or5hyEPOW+PniKld6e07xtUVz20iG7cr+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F4jQMAOHz64XOipFPMxncZSXounxVGJT8yBhxYEvpUq/9nufFA== template: metadata: - annotations: *a1 + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" name: www - type: "Opaque" + type: Opaque diff --git a/.kontinuous/env/dev/values.yaml b/.kontinuous/env/dev/values.yaml index 840c8605fa..05029bcc83 100644 --- a/.kontinuous/env/dev/values.yaml +++ b/.kontinuous/env/dev/values.yaml @@ -1,6 +1,6 @@ hasura: imagePackage: hasura - ~needs: [post-restore, build-hasura] + ~needs: [build-hasura] ~preDeploy.cleaner: match: kind: Deployment @@ -58,7 +58,7 @@ pg: ~tpl~owner: "{{ .Values.global.pgUser }}" secretName: "pg-db" barmanObjectStore: - ~tpl~destinationPath: "s3://cdtn-prod-backups/cdtn-admin" + ~tpl~destinationPath: "s3://cdtn-prod-backups/cdtn-admin-2024-03-26-12-33" s3Credentials: accessKeyId: ~tpl~name: "cdtn-prod-backups-access-key" @@ -73,7 +73,7 @@ pg: jobs: runs: post-restore: - ~needs: [pg] + ~needs: [pg, hasura] use: psql with: sqlFile: .kontinuous/sql/post-restore.sql diff --git a/.kontinuous/env/preprod/templates/contributions.configmap.yaml b/.kontinuous/env/preprod/templates/contributions.configmap.yaml deleted file mode 100644 index 1f59b16aa2..0000000000 --- a/.kontinuous/env/preprod/templates/contributions.configmap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: contributions -data: - CDTN_API_URL: "https://cdtn-api.fabrique.social.gouv.fr" - API_URI: "http://www" - HASURA_GRAPHQL_ENDPOINT: "http://hasura/v1/graphql" - NODE_ENV: "production" diff --git a/.kontinuous/env/preprod/templates/contributions.sealed-secret.yaml b/.kontinuous/env/preprod/templates/contributions.sealed-secret.yaml deleted file mode 100644 index c0d4153079..0000000000 --- a/.kontinuous/env/preprod/templates/contributions.sealed-secret.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -apiVersion: "bitnami.com/v1alpha1" -kind: "SealedSecret" -metadata: - annotations: &a1 - sealedsecrets.bitnami.com/cluster-wide: "true" - name: contributions - namespace: null -spec: - encryptedData: - HASURA_GRAPHQL_ADMIN_SECRET: AgC4DoTx/Burraa4LQnxWJ8pa4gK7mSHWd4fFFUHWeVrTmcoxLRyVVqH8ajgXFBZ1uksTujs8LM0eDtxeO/d6e88y7lF8epCutVm/9Lr39E8eMA4zwMU6QNrCX4j34YRonf4vbOnlUfm88XKek7DTOsUsbTp5BbO/IrESzabBJ9ntLBAdCVK+j6eGZyCC44VcfszHoiQINwi0Iax66KuA4oUvpQuTdTbB20wr9vzZarMatDDQRYtjugtYFzQQAv45+BZscb1Q+cMz+MXGOeJTDpFrhhV0OeDp5llEDhmx3nhyeRGyeWZdvONrDl4lDvftO6b8CTV1jBaoCX1r8pKcdp69WbkX2V+62lqamr5bmgJiuBWeOTHT1qQrv9uuInhrBBrkcHrXXMKlTY+p9auY/IQLw9CyBn41sK+RDteQfoZFRHSo2UOipbfgB5j9mCVnyJLDYLfyH4TEdGM6lkCATnKHr7Jz16IeR+GwmLfHrHkv3TW6zPijBBZRVcC5Z6LQNVv/6BzrKlzOkgZCKsX5pgaQWQBDSJSe8QGkx3Ccik6XpC/jgdHPEuP8zqDhE4VzWM6FrsxLAvso5WWNgdmS3i01RFa+pnFK7wLp7oLtDjKo7GyG2mXGt2B2+uvUffAmrE4jTCIbjUQtgrHHDBpq0hhxrG0njbh3SL29fNz1FeaXOFdubRfs0Zg2aNXtwDFHDrM8jCt/Yj4mY21uKup82mQZG6FCENCx+Hl7GGtuhs= - HASURA_GRAPHQL_JWT_SECRET: AgDSW4ceV9HFoxBNqg/hGa6uunl76cjtKBRSYf5LEPKzNHtXixd73LoFGa2y6/cQ/yGevNU6k7w62pkbWnz5rNAznsBE8QtBt1eRKQqjyJJ21m4sWI/MK6UI3gUS/Ad+LeCMxSoKG3XEzFSAwSndSXsgmwAP4KPpBF83DvdpVVpZtAjvPbNYNE6Ocjhtmt/TLqWjsV4Z+hkS8CKGk+PsYDEuR74Mj5TJys0MALJA9TB2dTIqMHOVZofD8T9hKH42yJWCDruH+gNNPKcleG/R0Pt7LJSamZtsqtXdxeE02tB+I9/VaEMrBL2WCJKhGHTjlDxexl4V/fswFYgXc/T4+hmPVB76xWVi6yFfggD/tLcAvgw3Ivdmbk/1c4CayKjU0+B+57EVrRqCGbJieBfbv6L3EWjU0uQj/uJEaZxIF4st3/r+iSGnrtPveBqnUgkJeqOmhf4sWJwE3xsPJM2kNYDPelWpYdxpoPaq3PNcLs7WpxMtRvwvvz2LMsWhEuUyHpe5yLOvi5swhcGqX1ALxGxfxzV+O229WfuTmV/kGUmcHhdf/VXdJRa+PYS83YK39wC1ZsoXJvPjAvEMgoTaRE8NHPWVD2ookNwdiRQIoLrSrGMP6F+Team2KtCic9ONYnM2wwUj2JCQRkFX2LZXwm9g9uR/Leuyd/IL5+tczwfF+PHfs6TQv+uKVz2qoZQZk4myQ/0JwHluOSXHTwEWkvuwGYO8QMTDOTTdp4Dor3kN7hQZyvWf41V/EHmOoLeFsdpQkWexo1FWHRZYtgG7ZVrgs07bY65gY6c1tZOKFaWhacTuneiLosz79vxn5omsFpjOOiWdSQOPZU8GkGxqJVq16H3VJg== - template: - metadata: - annotations: *a1 - name: contributions - type: "Opaque" diff --git a/.kontinuous/env/preprod/templates/tipimail.sealed-secret.yaml b/.kontinuous/env/preprod/templates/tipimail.sealed-secret.yaml new file mode 100644 index 0000000000..f95fde4d13 --- /dev/null +++ b/.kontinuous/env/preprod/templates/tipimail.sealed-secret.yaml @@ -0,0 +1,17 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" + name: tipimail +spec: + encryptedData: + SMTP_EMAIL_USER: AgDAI12VG9QSMBgYRebNFGvU3jJfLVem//WVoCzL45k6opjndrzmXPmUxHqBByrQh7Rb/X4DJYSyNzTltsWBRq/hnPNlh9YGUobFLYcFhe5vOJEx0dRWuQvzK3Qhe6EF9e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80anTphKb3dOZ+cdsjFXY24hctgdlNvzrbCl8+MCr96Tbot3QoUpN2RYf56liSFv68fe/rWE5+kK9QuL5CYW0XKZjOJP1PPsB5PynQFPcQQBNEQginvlq5UkIS7fOOrvP0HZklIcAhRM5H9qN/qgRpFxBv5oAfpOpxRZ8MbAzin73BJsBycXmvoV3NPS0o7yWfWpB9FVwwtBL0bomxTbEQ/VGkr+CYO88f9Psz4MEwaHMBZiNgmmJkra5/u9uSnnYkLWtcRTPRU46DuoFSIvfUmT3Ot6ZnAYVEqvt+LENe2koRrKr3+Hxt4tnrN0rxVhpaQ== + SMTP_URL: AgAncO7Mw9vbUcv0h0nrzRyhP2AolSJSx+W6M5CXEopETrvL2UiZvyHQ+N8OO0L6QPYDDgnJzDemXDgkUEUHacHAjFs/JSm4bhPCccw7g5tkQS8CYSMzKv/QpbeodN3ERcM6zQkbld5BLfnYTvnNc/v2iAAfrSFjBZfCge1kpKONdkMemv99PzEYXjwqd0DC01vroqt+maf4qYsf3sDgAQRuLyoCmmX1tSfDniwW0ZLhoTNRILpCiXw1Ejam6DZ1jXy77Bb1i1fsLXlrvMYIxnuhXktUphMSfE8o/5lK/YxBFejhxZoaCYrNidP0/ZH/DXNujTjuenGfXkQllasCFCs39HCF2isXLv5E26hmdlMo9qxBNrUE2PeL2V20wpIB3EgWo6eJjTtOix34z44fmRnf4f1TPGXVZayJQ3BDNbZ6QKiXiqkwDLzWUgDGZWASTUIbBosb1qG8G/NaRPs1tU3hUiWdHswjy3quknYOqyU3LtcofMBNkibLApdHmr6L20ILWI84TL+TWHSd3de9woeCLrVDBzbAxQ3tU3HIJ2dbtI69tuooAVoBb0Sr5dEVs+neHqpfXhonp2iNrcQWny3QX5UzsJDv+l1/7PcU50+vo/FXE5UbmJDMKFpv+z7nQT31TAwr8dft/1lg2nnn76ZGD2mS5XA1X/piUz8/KuxDDDsOttvyJQqd/wptKgHj+fkmvWfoUGrcmJTud/QkI/BbJw== + template: + metadata: + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" + name: tipimail + type: Opaque diff --git a/.kontinuous/env/preprod/templates/www.configmap.yaml b/.kontinuous/env/preprod/templates/www.configmap.yaml index c7f8a756d2..f944770dee 100644 --- a/.kontinuous/env/preprod/templates/www.configmap.yaml +++ b/.kontinuous/env/preprod/templates/www.configmap.yaml @@ -6,7 +6,6 @@ data: HASURA_GRAPHQL_ENDPOINT: "http://hasura/v1/graphql" MATOMO_URL: "https://matomo.fabrique.social.gouv.fr/" NODE_ENV: "production" - SMTP_URL: "smtp.tipimail.com" URL_EXPORT: "http://export" BUCKET_PUBLIC_ENDPOINT: "https://cdtn-dev-public.s3.gra.io.cloud.ovh.net" BUCKET_DEFAULT_FOLDER: "default" diff --git a/.kontinuous/env/preprod/templates/www.sealed-secret.yaml b/.kontinuous/env/preprod/templates/www.sealed-secret.yaml index e9beb0e116..a51e1cf56c 100644 --- a/.kontinuous/env/preprod/templates/www.sealed-secret.yaml +++ b/.kontinuous/env/preprod/templates/www.sealed-secret.yaml @@ -1,23 +1,17 @@ ---- -apiVersion: "bitnami.com/v1alpha1" -kind: "SealedSecret" +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret metadata: - annotations: &a1 + annotations: sealedsecrets.bitnami.com/cluster-wide: "true" name: www - namespace: null spec: encryptedData: - ELASTICSEARCH_URL: AgDWMfg5QLe5H8WK5qlEqXNRE1etDhonIg9uqPJGV6/tusJD647Kvw1oULkZKPdjrLqI1sSwKCQxCF7dwQTAiAHajmCmNwE6u6juCOGOwo7toSAMfZuN/+34l97vb5sbajgBXwuFKs+0+kqJHbZkL7zHqyEyscENeHa1BzYdG46DiEIU3EXdkBXd+oNH/GDm4CHbWAyYblddFhYl2Or5hyEPOW+PniKld6e07xtUVz20iG7cr+pyfbtOvaqyH6eOgYJj4p0x6Mh+0IRrPlaxdRk88iD5Nt5GFTFud5D85PMexbtvDIdsrBY1LLz2Fvh7ji+5DWsm43fShQP/2aOWB9SO7uFIlNusv2K5G9qsCVNE4mwh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lG+08CnfJeEWm3UwoLeZZrYFGokRcz53WTmEr3Yinhvckr/YuwiAZ3lHXFq6CNcmg1dZLX00cr4S18gnOkUgIyYiUiKOY5SHmTLbVPxb7D3Rl6BhBhV/GiALar7sF6a6bD4681UhjR7q2So8s1LyksT5V0GPIv+r4NwoB0W1vmimzQTqNiAw0wnte1530xiR24HxF0d+7Yr8y6WRTOjAht0= + NEXTAUTH_SECRET: AgAObcZKrO3zRrVCfoXEAntOXyZlHFJdxUep4iWbQdITqzDw32DhJzynwXmLTlOcJrAf0acuDOK3xMoOH2QZO4EaDOmpL8vJwmvQWIccdO/Gll2cxwCr/Cbu/9RmMixaXtrscoPz7m2geO5u/0dRCFE5IVUGZfaOBY+zHIFaxPFxWu9edjHWS9JJfRqcIoEyCLudmM1N20UGa2fq1tuIbD5ZS9f392l3669wqRB4tNnKxOKIJEQ4GA5PkqYYLoFsGGtAR5Hw9/eweXP0KXZfQjRJUfowdzFsx3wutjd2PVz7t0K5WZc2X4+RsodhEEYZJD013vXSQBHm8u/0VHQwAWotNt2uVoAbvVzup3DvqxUBN5LJIRanmFHTw2JNh+s4eUvd+86PBiTpoPXIg9QpGWy4rhG7gJ614HOD70cLL6jik48Ezbi4OfOBQGKbs0rrkPiAg60jCW4wXgQqpdH+6TEj/z7+/ZU0um5pKTUA6DS8EN5xU1xQdHLMo7WVXQHI26lbWRtLMQA8JYmvq/kXfhcH6kYVERDWYK1QiajGSdDbEGkjxDh0Uk8KRHAtBw2xXgT8lV6wpVIuGrrc1B6CbJOGgEBUwdjbD9v7n4mqAEp7N8d6Gsc0Nbsc2rrAl4rVB7/ihoUXEtQthrXA8UFj8p7f/O7AMKXCU8gt29FeTFNEwydXhXw1EPlfUzr4/Gp3uNXiLSpjK9/3F4jQMAOHz64XOipFPMxncZSXounxVGJT8yBhxYEvpUq/9nufFA== template: metadata: - annotations: *a1 + annotations: + sealedsecrets.bitnami.com/cluster-wide: "true" name: www - type: "Opaque" + type: Opaque diff --git a/.kontinuous/env/preprod/values.yaml b/.kontinuous/env/preprod/values.yaml index 9bb5ab2c57..01128e1e35 100644 --- a/.kontinuous/env/preprod/values.yaml +++ b/.kontinuous/env/preprod/values.yaml @@ -1,6 +1,6 @@ hasura: imagePackage: hasura - ~needs: [post-restore, build-hasura] + ~needs: [build-hasura] ~preDeploy.cleaner: match: kind: Deployment @@ -14,10 +14,12 @@ hasura: name: hasura www: - host: cdtn-admin-preprod.dev.fabrique.social.gouv.fr + host: cdtn-admin-preprod.ovh.fabrique.social.gouv.fr env: - - name: "FRONTEND_HOST" - value: cdtn-admin-preprod.dev.fabrique.social.gouv.fr + - name: NEXTAUTH_URL + value: https://cdtn-admin-preprod.ovh.fabrique.social.gouv.fr + - name: NEXT_PUBLIC_BASE_PATH + value: https://cdtn-admin-preprod.ovh.fabrique.social.gouv.fr pg: ~chart: pg @@ -35,6 +37,7 @@ pg: ~tpl~database: "{{ .Values.global.pgDatabase }}" ~tpl~owner: "{{ .Values.global.pgUser }}" secretName: "pg-db" + # need to specify full barman config because we reload from another bucket (prod) barmanObjectStore: ~tpl~destinationPath: "s3://cdtn-prod-backups/cdtn-admin" s3Credentials: @@ -51,7 +54,7 @@ pg: jobs: runs: post-restore: - ~needs: [pg] + ~needs: [pg, hasura] use: psql with: sqlFile: .kontinuous/sql/post-restore.sql diff --git a/.kontinuous/env/prod/templates/contributions.configmap.yaml b/.kontinuous/env/prod/templates/contributions.configmap.yaml deleted file mode 100644 index c2f191a0f6..0000000000 --- a/.kontinuous/env/prod/templates/contributions.configmap.yaml +++ /dev/null @@ -1,10 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: contributions -data: - CDTN_API_URL: "https://cdtn-api.fabrique.social.gouv.fr" - API_URI: "http://www" - HASURA_GRAPHQL_ENDPOINT: "http://hasura/v1/graphql" - NODE_ENV: "production" - diff --git a/.kontinuous/env/prod/templates/contributions.sealed-secret.yaml b/.kontinuous/env/prod/templates/contributions.sealed-secret.yaml deleted file mode 100644 index 1122df7f08..0000000000 --- a/.kontinuous/env/prod/templates/contributions.sealed-secret.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: "bitnami.com/v1alpha1" -kind: "SealedSecret" -metadata: - name: contributions - namespace: cdtn-admin -spec: - encryptedData: - HASURA_GRAPHQL_ADMIN_SECRET: AgA/oEQJToFMrm/N+uHwfhDnRu7XDNm+Bkioqq1a8cGNuwhNC51dl3rxHw0l4l4ggpcRsHR/gt4h1V/kHjsKtfKSl1opnvAqlHeEiFHMqs3Dv27o+rLR8xYxrbW//3ZXKXeQufIKkrg8eD4ZGzc9KvR/HdOQtJ4oG3hWc+Lq/47C55wfBWjvGRnrlGf4IcnmZ6JEK0mF+AukD6Jd+BFAyeVhzZ52/1W1w55rWNrOf3OkjUEJAwDVakqnkAjK42gGAZh25XvkvV23PUeopL5oX4GqmdQctMU12kX+QwPy+B0biIE9LKCeohAZlDfxY4KrUsXRnWD7W8M9YpmTqdDOpHdJov/0hd8mjfsrxA3HOfVPxVMvieXbICEiUtkcOPxuuuidU89Iz+WFO2NM20IOeCVQWCba1OT4pM5pX4IKUB01Hj7Or57nhZa7DWpVL4HWIFdeRHlZFXpSRj3d4gUo4LlumGgFwtBhr+rU9/KGsdMtaWXuMIZXx7g6UcaaMxi69Qc0tZastY922NA+KQW3/r9I1+NJm+8lcNBndl5YlvYos5eodPnfgAo77+5RV5R2idNf7nDJZ9/hZCp28k8Dh97cMhAclT/Xc7gVloiFZuCuzlmlKyBS3D3mSdAml6P7q55LxP0oPq/U0UAKiq27+lAJt7LCYT8qrqVwUX50O8ODeC6lAwxdPqtn+rncEkt1gkEF+pcv0DGPuZN0YykxI5USza7x9cCc2ol4YxyY0IU= - HASURA_GRAPHQL_JWT_SECRET: AgBk8DBUbfxqEW+0c9Omk5p+fL8ZCpL93AvZ0dKENqZHqPgE5Eou3eqce0Yp1eXhx3zpfhyXUWug/Io5FiIotje9VHoVzCzU40o/AK8E6pJ5lX5frcyH4VSn1iABoBp2zU3351DQNAs9KX7JhPaRqgkGgddjSAWNV+m+RQyBurJncNvP7CpE2e3379VEJJqhBxgYKiN32vtjmEPZHEIl23hkuPH7GyOdP8OO+ZBMG8wkHUuMsl4GHKgJicHydPeP3GVdfvD0GQR5x+zmrEMyGob/2oedsCCeKfURxH+QP/F7c4L8EYDerbHxH7FZdFBqG5ogmc35OUkyLWGTZl/8gJfslt7OyWzH1J1vo+C7n1kthxRh1lCWAyBz0Gv6kkm3uroyXJFfmWbR19zQNP5TsrjqZUD28hmWyE0wxI5/L+h1cdsqCkm5cupe0u1lXFmArMU90LAzrRR6M5jZJpkwOGOIrAwJ6Ohsgue7DIEB/jPiwdCMXBs9PP2iLyqfR6suUgngfYoHMNtiBHX+b05OxhoJDunEFWo9tYfweby/DeGH6KV2/T55rmBNh4eGgHNmAiG4Mx4IVXkGqr22CkHHz36SHliHeF5jXmIfo6UBrEEQBJ4OKBuJSINuDqFQNS8ENME2MgfEd8xttWJxs3An4jYihhGdBnA5IYcxiCzD8No2VIop89CKrCCtfsKnmBKvfbbVfk5Z3k+0DBmAO6NXqMQZ18mgVod6pjueB3YfLCoDH1L3hs31OH3lupzic9OY4MkKGkYn6Yppt/oErAp/Cc02bPm1QeUva2OUekZ9/Ar9EC6vvasohmBWbVEMLXV1xQPOxDHjTpGe6h26Ok3PJohQCxnfLw== - template: - metadata: - name: contributions - namespace: cdtn-admin - type: "Opaque" diff --git a/.kontinuous/env/prod/templates/hasura.sealed-secret.yaml b/.kontinuous/env/prod/templates/hasura.sealed-secret.yaml index 13bdc77949..4e0e446610 100644 --- a/.kontinuous/env/prod/templates/hasura.sealed-secret.yaml +++ b/.kontinuous/env/prod/templates/hasura.sealed-secret.yaml @@ -9,8 +9,8 @@ spec: HASURA_GRAPHQL_JWT_SECRET: AgBsyXBoL2VRo5DZ3mwg7XtRm+HvPMVs8xxcL8OHaHsiAeTkIbLnBShtgOIwOYTWmoGjLQTBnPdrbKOzqzZNZVdZojPqZeFuxo/Y0E72rnEQQWTFCmQ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f2ScCpXHjWSHHjxzAZpa4pxHZfnmkYWgo9g/eAq/W7WK9oBVO4Cla3p+cuH/sHsSIY/2dga/slAyhHzhzJ/xZeQT77a5FxMGNHrk5nv/XvzLWZO12Tnq2GINQsxJr0Xs08Xiqzpp9oypCgJkFKyAQlxlSgcqpo/cFgb2m+5M1YOX6agvZiXnC2izT7PmCvtUiRrCv9Fby0DYY3WayF5kI6lpoLcl1oIeY9jyzlRC760X7A20xk3+g70vWdBGwPV7xFx -template: - metadata: - name: hasura - namespace: cdtn-admin - type: Opaque + template: + metadata: + name: hasura + namespace: cdtn-admin + type: Opaque diff --git a/.kontinuous/env/prod/templates/ingester.sealed-secret.yaml b/.kontinuous/env/prod/templates/ingester.sealed-secret.yaml index 1c3492428c..7bde636053 100644 --- a/.kontinuous/env/prod/templates/ingester.sealed-secret.yaml +++ b/.kontinuous/env/prod/templates/ingester.sealed-secret.yaml @@ -7,8 +7,8 @@ spec: encryptedData: HASURA_GRAPHQL_ADMIN_SECRET: >- AgAtqyc6YAGTgX2qJpRoVNpZL1xfLSQVfidBSgREmSzEpZ1fRXMC5VqaG0sTayGNBHOCIDBww6WOHIKAvlhP3RfdGDTdFVmL5FvNtcfh0o0oyFG8tyMRIPF3v2V73opbltNFCiUOJml4mfMcjcX5hO/i3OrzH+QkYZcxj9SUPA3va7kq0fJZENG2LTnIiqBBGwVgDR35bHj+b/DUAGEl5+u0j7wb5VJbWx8vZMasH4u7FJQvrNTPojEPvXVE7gyawl+gmQZ+6XtxrEwg8uIkY73cyf1nl1+m9AzqjhN4nyfslj4L83lUJb9R+AUt5YmokcADER9YAQyBe4MiQQzMjhgph8J80louTZd+BBxbahVgwlzLtAAfSO6cqHnyGEs8whtQT2CX2VfyvKv1lZjpyRr+5t7GBvWY/NZuyLskqctvB0N3oCV/BuifOtGWmRzCI7f4eTnr1keCwrEkRjVQphEcYUZ/4hUqp+16LPQtLvzegwT+8NWsyGZ/qb/fbqLvJDsDtKlezVIV8jChQ3dLphUu8/p1Jdqdz2MP/XrSp4znJSyrQa4lvc73iluWVcLb00uQ3vXYYst8e7XQdkomnWsXUO2zuegBpJ/dNmjSTu+vWPbDfNTpkX0K/gSYD6QA7+3pYPceWymJcpTYbfB7JDUucP1oDjcB/44NeLv1wM561a0NB5E33CcNen1HI8Z3CStmeDR01a4XIymjzw2GKEQyXvat6Fbjd94/j/irok4= -template: - metadata: - name: ingester - namespace: cdtn-admin - type: Opaque + template: + metadata: + name: ingester + namespace: cdtn-admin + type: Opaque diff --git a/.kontinuous/env/prod/templates/tipimail.sealed-secret.yaml b/.kontinuous/env/prod/templates/tipimail.sealed-secret.yaml new file mode 100644 index 0000000000..d5ad678d2c --- /dev/null +++ b/.kontinuous/env/prod/templates/tipimail.sealed-secret.yaml @@ -0,0 +1,18 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + annotations: + sealedsecrets.bitnami.com/namespace-wide: "true" + name: tipimail + namespace: cdtn-admin +spec: + encryptedData: + SMTP_EMAIL_USER: AgB9T19bkhG0mvCzSxSLfJ+JMFEVLXljG2bU62Cgqe54YFPb7qionTzjS3NXwwv3CVa9US7e9HdDu5nA4kLOmPJD2ui6aYWMB6YFxplQMTwFJQ9p6wEgpfj1AzXaF/6eMjI+c7HvgIBmn66jAI3MB/oHwg5P58wmvEVs3cTEVEx0pWFYZHnC74tMWhUlkVAY+7WkUYRPxdow9CM0Cz7N0rBNZ+yBbN35UJD0gkugMPjuSw2l6Iaw8akDx8NOOCG8tQG7W6KU+usXWXQZ32lniArVpB+P5kFyIppRqXWJMPMypSKELrS7bBjtGYuQsb6Gh/h/0JW6Wwef4Mcrzmny2c2aB0Vf/qkGnENV5/dxz+fGAmVzlihBevN2BUGSAV+nIenuYYPSCUybCqDHCA8JUSXz8ui1jkT8J5za/PXIZlrjyMfqWKx59EgJNcmk3YFsXKU8jRp8ungFMCLZJyhpuMWCmo3gsnXEio+BazGANmJ4Midy0lIOdTaE9vSK5STEtddmrTIzthS7b3tjifWA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qzh2IG1UNvkBsY/dI9yfx6DzsPukPHDF6IbU0tpDAQ816ZXrnqr0wqsVUqx7JVk616EQ9u4EZjen8U/M64F0g42MOMaLXXb9dcs8eBmoJSfWCgwnrbAx1hLzxkinJE+z9j6iq3h2t2xg5K58yDBm1t3M+N+FiluDbpzR3vY5njDdPhg9dllIVSX9ieFE1Y17Pd2J+iJOvIstuZ9EHhh3RDfb3uMU24Zt7w4M32ZTrWmH2W+2IjSndDLr2/0fB0sT8calB8hmJ0js05tE4JTOv8EfvrLOsAlumAHmsKNK87a3uShjlwpKCwxxXIz5K6evrQxMYj0L9oG7ROMmStO8ozoQ5SFkph44c90Ev4SDxeSWU/8nASTkmbJWLV2q7TRozHnVFzV28ZZxZgwYCArt2/JYcKVfLfMYisVKt8Lpot8SIyv2wN8dvz7VHz3lwBOFuYgdFiJNzcFpnAwzcGuuBtx/YmhO0Y7uMtSmtgRrE6KS7eSVgfYSST9PTJYtuiAq/ozl7USaGCWh2/mPkZJPcpH9CeDfeqho4Qb7z/Rp1UaeFyolseZ6zoE6GaKTaleTbdZiP/lFRE4zygHueuOqlHXtYIW/SoZBUkPiAjk2Sw8DAEQrmztBiKPzuM6maCt9R6fXAAUL0+K3y5urULoR10V7M+Q== + template: + metadata: + annotations: + sealedsecrets.bitnami.com/namespace-wide: "true" + name: tipimail + type: Opaque diff --git a/.kontinuous/env/prod/templates/www.configmap.yaml b/.kontinuous/env/prod/templates/www.configmap.yaml index e2b0a241a6..e13dd79316 100644 --- a/.kontinuous/env/prod/templates/www.configmap.yaml +++ b/.kontinuous/env/prod/templates/www.configmap.yaml @@ -8,7 +8,6 @@ data: MATOMO_URL: "https://matomo.fabrique.social.gouv.fr/" NODE_ENV: "production" PRODUCTION: "true" - SMTP_URL: "smtp.tipimail.com" URL_EXPORT: "http://export" BUCKET_PUBLIC_ENDPOINT: "https://cdtn-prod-public.s3.gra.io.cloud.ovh.net" BUCKET_DEFAULT_FOLDER: "default" diff --git a/.kontinuous/env/prod/templates/www.sealed-secret.yaml b/.kontinuous/env/prod/templates/www.sealed-secret.yaml index 66954a27fe..5cc5160188 100644 --- a/.kontinuous/env/prod/templates/www.sealed-secret.yaml +++ b/.kontinuous/env/prod/templates/www.sealed-secret.yaml @@ -1,21 +1,18 @@ -apiVersion: "bitnami.com/v1alpha1" -kind: "SealedSecret" +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret metadata: + annotations: + sealedsecrets.bitnami.com/namespace-wide: "true" name: www namespace: cdtn-admin spec: encryptedData: - ELASTICSEARCH_URL: AgBmkaYd7Wd5Mrgi2DA1AOM5THVx4VSaSK0pGM2a90nLlO9hIQdJLE49UnqTHM3k0xo5JdScOdPvTyXFCl0Egowxlnf3d6k93By2A/LeMVlQqqqJ8AkK7l6LPcVN+cH356I+B9AUIrbTsgjU9rohSf/rONcPA1MXDOkQssHXI/pkfq4C7ZaqXBH1x1hypSMa8pW+Uu8SGgOUCUenBCokwL0H5PlHI/c5sh6LpU+FH5I563Ta8GdKs7NC26CI++D2LOmWJvqye+LGpbfdZg15cLFnUmdDy44CowAbxYdqN1UDrtXH8Nft2iWkFmXeBXLlXvy02pXnOi9DyPB4WdITFjrMV4KTRlOjOBZOGoU2rY/JbPpqk/ctz5CHbtPPKnn56JN31cUeeDQwQl9B+Jpg+COR0mgLzcMIlJTpwJoAj4F4guvGjXGtnBzqPzcETB68owH/6ffmOb/C8SjxXoI0KhzZtnLqUqZ6loOGCvyRGp+o/zYD3y1FppzhpPvnkXNKluM/wSOy1fXR+rnSby1fTivxGJqjMx1jlzSIz99rkIih4L5GLhWn0ZK7Po7W6+9YwHOMnVkr1M8hGJJPNugMl8QDhgA3H7N3aODSfAK4UCQwhIMN1iT7GRBZxnCAGYWE25c1BkWCUQEqTpaVOfG/sPgTfoUAJz3t/UOWXv/XCEXGYiEyZ8MTPYk2ma1npwbPTiWbFhjBmYS7OJQOueL6vXil7IKCbfLaV4MEf3S6Bc5KG4WCTTIbgLxVeQEsqJTd8gaSI4RC0728Gy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BBDGqz2lX13zpCMfL8rjfTnztSjE/LiiYeJ3W6S1blk87o9U5MGQE4csC2gcSO95Bd1x6uecfaBx81AI+btW+5smOvblLY8u50dn/F83151bKoPFZSaL0qCPjJMujYDXHM//Z7cqeer3s6bMxvo7s1epc+5xcsLxJTqYeN8dqQYTz5OiE5JusTteCDA== template: metadata: + annotations: + sealedsecrets.bitnami.com/namespace-wide: "true" name: www - namespace: cdtn-admin - type: "Opaque" + type: Opaque diff --git a/.kontinuous/env/prod/values.yaml b/.kontinuous/env/prod/values.yaml index 4be02f9ac8..1a41ec8fe6 100644 --- a/.kontinuous/env/prod/values.yaml +++ b/.kontinuous/env/prod/values.yaml @@ -4,8 +4,10 @@ www: annotations: nginx.ingress.kubernetes.io/whitelist-source-range: 185.24.184.196,185.24.185.196,185.24.186.196,185.24.187.196,185.24.187.254,164.131.160.1,164.131.160.2,164.131.160.3,164.131.160.4,164.131.160.5,164.131.160.6,164.131.160.17,164.131.160.18,164.131.160.19,164.131.160.20,164.131.160.21,164.131.160.22,164.131.160.33,164.131.160.34,164.131.160.35,164.131.160.36,164.131.160.37,164.131.160.38,164.131.160.49,164.131.160.50,164.131.160.51,164.131.160.52,164.131.160.53,164.131.160.54,45.80.34.219 env: - - name: "FRONTEND_HOST" - value: cdtn-admin.fabrique.social.gouv.fr + - name: NEXTAUTH_URL + value: https://cdtn-admin.fabrique.social.gouv.fr + - name: NEXT_PUBLIC_BASE_PATH + value: https://cdtn-admin.fabrique.social.gouv.fr resources: limits: cpu: "200m" @@ -14,23 +16,6 @@ www: cpu: "100m" memory: "256Mi" -contributions: - autoscale: - enabled: true - minReplicas: 2 - maxReplicas: 3 - host: cdtn-contributions.fabrique.social.gouv.fr - ingress: - annotations: - nginx.ingress.kubernetes.io/whitelist-source-range: 185.24.184.196,185.24.185.196,185.24.186.196,185.24.187.196,185.24.187.254,164.131.160.1,164.131.160.2,164.131.160.3,164.131.160.4,164.131.160.5,164.131.160.6,164.131.160.17,164.131.160.18,164.131.160.19,164.131.160.20,164.131.160.21,164.131.160.22,164.131.160.33,164.131.160.34,164.131.160.35,164.131.160.36,164.131.160.37,164.131.160.38,164.131.160.49,164.131.160.50,164.131.160.51,164.131.160.52,164.131.160.53,164.131.160.54,45.80.34.219 - resources: - limits: - cpu: "100m" - memory: "256Mi" - requests: - cpu: "100m" - memory: "256Mi" - export: replicas: 1 resources: @@ -59,6 +44,8 @@ hasura: name: hasura pg: + backup: + name: 2024-03-26-12-33 cnpg-cluster: resources: requests: diff --git a/.kontinuous/sql/post-restore.sql b/.kontinuous/sql/post-restore.sql index cb4acf291d..751fe8a44d 100644 --- a/.kontinuous/sql/post-restore.sql +++ b/.kontinuous/sql/post-restore.sql @@ -1,87 +1,35 @@ -with user_ids as ( - select distinct id - from auth.users -) -update "auth"."users" -set password = '$argon2i$v=19$m=4096,t=3,p=1$n9eoWSv+5sCgc7SjB5hLig$iBQ7NzrHHLkJSku/dCetNs+n/JI1CMdkWaoZsUekLU8', - email = u.id || '@travail.gouv.fr' -from user_ids u -where u.id = users.id; --- --- DISABLE TRIGGERS --- +-- Anonymize users +UPDATE auth.users as u +SET + password = '$argon2i$v=19$m=4096,t=3,p=1$n9eoWSv+5sCgc7SjB5hLig$iBQ7NzrHHLkJSku/dCetNs+n/JI1CMdkWaoZsUekLU8', + email = u.id || '@travail.gouv.fr', + name = CONCAT( + UPPER(SUBSTRING(name FROM 1 FOR 1)), + CASE + WHEN POSITION(' ' IN name) > 0 THEN UPPER(SUBSTRING(name FROM POSITION(' ' IN name)+1 FOR 1)) + ELSE '' + END + ); -ALTER TABLE auth.users DISABLE TRIGGER USER; -WITH admin_row AS ( - INSERT INTO auth.users (email, PASSWORD, name, default_role, active, id) - VALUES ( - 'codedutravailnumerique@travail.gouv.fr', - '$argon2i$v=19$m=4096,t=3,p=1$n9eoWSv+5sCgc7SjB5hLig$iBQ7NzrHHLkJSku/dCetNs+n/JI1CMdkWaoZsUekLU8', - 'Administrateur', - 'super', - TRUE, - 'd8b11bd2-dd16-4632-b5de-0e7021faadeb' - ) - RETURNING id, - default_role -) -INSERT INTO auth.user_roles (ROLE, user_id) -SELECT default_role, - id -FROM admin_row; -WITH admin_row AS ( - INSERT INTO auth.users (email, PASSWORD, name, default_role, active, id) - VALUES ( - 'utilisateur@travail.gouv.fr', - '$argon2i$v=19$m=4096,t=3,p=1$PqKPf9cxunVLLtEcINHhWQ$CwHKhk71fc8LGp6BWbcFPzQ2ftOiHa7vUkp1eAqVHSM', - 'Utilisateur', - 'user', - TRUE, - '3d6dddc4-e117-4772-9288-cd8a608693e4' - ) - RETURNING id, - default_role -) -INSERT INTO auth.user_roles (ROLE, user_id) -SELECT default_role, - id -FROM admin_row; --- --- create empty audit logs table --- +-- Add a fake user +INSERT INTO auth.users (email, password, name, role, is_active, id) +VALUES ( + 'codedutravailnumerique@travail.gouv.fr', + '$argon2i$v=19$m=4096,t=3,p=1$n9eoWSv+5sCgc7SjB5hLig$iBQ7NzrHHLkJSku/dCetNs+n/JI1CMdkWaoZsUekLU8', + 'Administrateur', + 'super', + TRUE, + 'd8b11bd2-dd16-4632-b5de-0e7021faadeb' + ); -CREATE TABLE IF NOT EXISTS audit.logged_actions ( - event_id bigserial primary key, - schema_name text not null, - table_name text not null, - relid oid not null, - session_user_name text, - hasura_user jsonb, - action_tstamp_tx TIMESTAMP WITH TIME ZONE NOT NULL, - action_tstamp_stm TIMESTAMP WITH TIME ZONE NOT NULL, - action_tstamp_clock TIMESTAMP WITH TIME ZONE NOT NULL, - transaction_id bigint, - application_name text, - client_addr inet, - client_port integer, - client_query text, - action TEXT NOT NULL CHECK (action IN ('I', 'D', 'U', 'T')), - row_data jsonb, - changed_fields jsonb, - statement_only boolean not null -); --- --- ENABLE TRIGGERS --- +-- Remove all data from audit tables +TRUNCATE audit.logged_actions; -ALTER TABLE auth.users ENABLE TRIGGER USER; --- -- Kill all connections ! -- Make all connected services restart ! -- Hasura migration will be re-applyed. --- - SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = '${PGDATABASE}'; + diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index 1902e708c3..0a5f1033a1 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -29,14 +29,6 @@ jobs: with: imagePackage: export dockerfile: targets/export-elasticsearch/Dockerfile - build-contributions: - use: build - with: - imagePackage: contributions - dockerfile: targets/contributions/Dockerfile - buildArgs: - NODE_ENV: production - CDTN_API_URL: https://cdtn-api.fabrique.social.gouv.fr build-hasura: use: build with: @@ -58,33 +50,15 @@ www: name: www - secretRef: name: s3 - env: - - name: "FRONTEND_HOST" - value: "{{.Values.global.host}}" - resources: - limits: - cpu: "100m" - memory: "256Mi" - requests: - cpu: "50m" - memory: "128Mi" - replicas: 1 - securityContext: - fsGroup: 1000 - runAsUser: 1000 - runAsGroup: 1000 - -contributions: - ~chart: app - ~needs: [build-contributions] - probesPath: / - imagePackage: contributions - containerPort: 3200 - envFrom: - - configMapRef: - name: contributions - secretRef: - name: contributions + name: tipimail + - secretRef: + name: hasura + env: + - name: NEXTAUTH_URL + value: https://www-{{.Values.global.host}} + - name: NEXT_PUBLIC_BASE_PATH + value: https://www-{{.Values.global.host}} resources: limits: cpu: "100m" @@ -128,7 +102,7 @@ export: hasura: ~chart: hasura - ~needs: [build-hasura] + ~needs: [build-hasura, pg] imagePackage: hasura ingress: enabled: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 5242788b70..362385e00a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,123 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.41.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.3...v2.41.4) (2024-04-09) + +### Bug Fixes + +- **credentials:** set special secret for tipimail ([#1359](https://github.com/SocialGouv/cdtn-admin/issues/1359)) ([e972086](https://github.com/SocialGouv/cdtn-admin/commit/e972086da29feebb189def1799151e427bec4a03)) + +## [2.41.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.2...v2.41.3) (2024-04-09) + +### Bug Fixes + +- **credentials:** reset secret for www ([065ab80](https://github.com/SocialGouv/cdtn-admin/commit/065ab8025f98e258e46444ae96d2a9e2cf09a214)) + +## [2.41.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.1...v2.41.2) (2024-04-09) + +**Note:** Version bump only for package cdtn-admin + +## [2.41.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.0...v2.41.1) (2024-04-05) + +### Bug Fixes + +- **alert:** passer directement le token dans l'URL pour contacter le site MT ([#1357](https://github.com/SocialGouv/cdtn-admin/issues/1357)) ([4486e8f](https://github.com/SocialGouv/cdtn-admin/commit/4486e8ff6fb226c97500698734345bac81c1de97)) + +# [2.41.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.2...v2.41.0) (2024-04-04) + +### Features + +- desinstaller les anciennes contributions de l'admin ([#1326](https://github.com/SocialGouv/cdtn-admin/issues/1326)) ([917574c](https://github.com/SocialGouv/cdtn-admin/commit/917574c135f3f74ae445d2b10ca5eb21375787b7)) + +## [2.40.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.1...v2.40.2) (2024-04-04) + +### Bug Fixes + +- **export:** ajout des éléments liés aux outils sur les préqualifiés ([#1352](https://github.com/SocialGouv/cdtn-admin/issues/1352)) ([1fedf81](https://github.com/SocialGouv/cdtn-admin/commit/1fedf816282c29ff8ea09254a1f5eb91419c9c2b)) + +## [2.40.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.0...v2.40.1) (2024-04-03) + +### Bug Fixes + +- **contribution:** ne pas placer dans une alerte un tableau à la copie ([#1338](https://github.com/SocialGouv/cdtn-admin/issues/1338)) ([09d04fd](https://github.com/SocialGouv/cdtn-admin/commit/09d04fd864ff4e5bbf735ea84f0851561fb769ce)) +- **export:** correctif rapide pour la mise en prod des données ([#1349](https://github.com/SocialGouv/cdtn-admin/issues/1349)) ([a9c6ee9](https://github.com/SocialGouv/cdtn-admin/commit/a9c6ee9dc3c791f39e732f21ffd119026630128a)) + +# [2.40.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.7...v2.40.0) (2024-04-02) + +### Features + +- 1308 admin extraction des prqualifis ([#1315](https://github.com/SocialGouv/cdtn-admin/issues/1315)) ([cef0ceb](https://github.com/SocialGouv/cdtn-admin/commit/cef0cebe84919b58045bb369a5d49b72c211ea7f)) +- **export:** ajout de contexte sur l'erreur quand on récupère les docs ([#1347](https://github.com/SocialGouv/cdtn-admin/issues/1347)) ([45a81c0](https://github.com/SocialGouv/cdtn-admin/commit/45a81c045d4147c3fab979ace03aa73e14398e04)) + +## [2.39.7](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.6...v2.39.7) (2024-03-28) + +### Bug Fixes + +- **glossary:** gère le cas de multiple strong dans un summary ([#1343](https://github.com/SocialGouv/cdtn-admin/issues/1343)) ([022d313](https://github.com/SocialGouv/cdtn-admin/commit/022d313aa06b7f270de1e55deabb9529dab69681)) +- reload latest timeline db data in dev ([#1337](https://github.com/SocialGouv/cdtn-admin/issues/1337)) ([934e526](https://github.com/SocialGouv/cdtn-admin/commit/934e5264cc668ca9830f999da5e9591b9105216b)) + +## [2.39.6](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.5...v2.39.6) (2024-03-27) + +### Features + +- add lot 5 (linked) ([#1336](https://github.com/SocialGouv/cdtn-admin/issues/1336)) ([e6bcc00](https://github.com/SocialGouv/cdtn-admin/commit/e6bcc002fe89b124f01fcb13b90670dca9e1a94c)) + +## [2.39.5](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.4...v2.39.5) (2024-03-26) + +### Bug Fixes + +- up ([0185d77](https://github.com/SocialGouv/cdtn-admin/commit/0185d77a22dc80d5168abcc9705d409d95d97516)) + +## [2.39.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.3...v2.39.4) (2024-03-26) + +### Bug Fixes + +- add missing hasura dependency to pg ([3ebc0b7](https://github.com/SocialGouv/cdtn-admin/commit/3ebc0b718d59ea48b426e456ec66d3dcb022bcfb)) +- recovery name ([6bca263](https://github.com/SocialGouv/cdtn-admin/commit/6bca2634b83aaf4474cd71b587cead06ef09f032)) + +## [2.39.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.2...v2.39.3) (2024-03-25) + +### Bug Fixes + +- sealedsecret spec ([1597b26](https://github.com/SocialGouv/cdtn-admin/commit/1597b26cb98bbf3add35793bf97392767ffd67e1)) + +## [2.39.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.1...v2.39.2) (2024-03-25) + +### Bug Fixes + +- ovh ([39ef3a8](https://github.com/SocialGouv/cdtn-admin/commit/39ef3a8d677a7e02de7fcbb6d493666944d20b49)) +- ovh ([f272f45](https://github.com/SocialGouv/cdtn-admin/commit/f272f45b861a77ccefdeebe9ab91a181aed1a0a7)) +- ovh preprod ([324ee96](https://github.com/SocialGouv/cdtn-admin/commit/324ee96a3d9a09602ba89ddb75cf98f27cd262fe)) +- ovh preprod ([b57eec7](https://github.com/SocialGouv/cdtn-admin/commit/b57eec7a6883eb1e2ff567c1224d8305449fb26e)) + +## [2.39.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.0...v2.39.1) (2024-03-25) + +### Bug Fixes + +- backup incr ([5e12069](https://github.com/SocialGouv/cdtn-admin/commit/5e1206954804dc804130e0528a43b8475801a9ee)) +- Revert fix: contribution description null ([#1303](https://github.com/SocialGouv/cdtn-admin/issues/1303)) ([#1328](https://github.com/SocialGouv/cdtn-admin/issues/1328)) ([21d8022](https://github.com/SocialGouv/cdtn-admin/commit/21d8022b791d1c46551af52a49efe910bfd74339)) + +# [2.39.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.38.0...v2.39.0) (2024-03-25) + +### Bug Fixes + +- contribution description null ([#1303](https://github.com/SocialGouv/cdtn-admin/issues/1303)) ([4df3e07](https://github.com/SocialGouv/cdtn-admin/commit/4df3e07b53c877f7f305fb19ed260d9626ee6dfb)) +- **migration ovh:** mise à jour des urls en dev de serving ml ([#1324](https://github.com/SocialGouv/cdtn-admin/issues/1324)) ([b54d17c](https://github.com/SocialGouv/cdtn-admin/commit/b54d17c704f6c02ec0f09de13ee0a46d72d56cf6)) + +### Features + +- **information:** optimisation du chargement des contenus `relatedDocuments` pendant l'export ([#1319](https://github.com/SocialGouv/cdtn-admin/issues/1319)) ([b367d24](https://github.com/SocialGouv/cdtn-admin/commit/b367d24b8a1b5ee90f10b415348c0ab2473208f9)) + +# [2.38.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.1...v2.38.0) (2024-03-18) + +### Bug Fixes + +- **glossary:** exclure les titres et sous-titres provenant des contribs ([#1316](https://github.com/SocialGouv/cdtn-admin/issues/1316)) ([8f3e62d](https://github.com/SocialGouv/cdtn-admin/commit/8f3e62d9b3e57e9d699552bcce583fca8eaecd47)) + +### Features + +- **menu:** réorganisation du menu ([#1298](https://github.com/SocialGouv/cdtn-admin/issues/1298)) ([2cf535d](https://github.com/SocialGouv/cdtn-admin/commit/2cf535dd33e62cc9404741f6a7e8e15b246f2861)) + ## [2.37.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.0...v2.37.1) (2024-03-13) ### Bug Fixes diff --git a/README.md b/README.md index 9b58f52e18..02fc9df089 100644 --- a/README.md +++ b/README.md @@ -80,22 +80,15 @@ An administration website is available to configure and inject custom data. This step starts the frontend project (based on `next.js`). User and admin accounts are automatically created by the Hasura step. -| Type | Username | Password | -| ----- | -------------------------------------- | -------- | -| Admin | codedutravailnumerique@travail.gouv.fr | admin | -| User | utilisateur@travail.gouv.fr | user | +| Type | Username | Password | Role | +| ----- | -------------------------------------- | -------- | ----- | +| Admin | codedutravailnumerique@travail.gouv.fr | admin | super | Frontend is reachable at the address > Run the frontend (it starts Hasura as dependency): > > ```sh -> docker compose up www -> ``` -> -> or via npm -> -> ```sh > yarn workspace frontend dev > ``` @@ -155,7 +148,7 @@ docker-compose up -d hasura minio elasticsearch createbuckets #### 5. Run ingester in development mode ```sh -GLOSSARY_PREPROD_DISABLE=true DISABLE_LIMIT_EXPORT=true DISABLE_AGREEMENTS=true DISABLE_SITEMAP=true NLP_URL=https://serving-ml-preprod.dev.fabrique.social.gouv.fr HASURA_GRAPHQL_ENDPOINT="http://localhost:8080/v1/graphql" HASURA_GRAPHQL_ADMIN_SECRET="admin1" ELASTICSEARCH_URL_PREPROD="http://localhost:9200" ELASTICSEARCH_URL_PROD="http://localhost:9200" SITEMAP_DESTINATION_FOLDER="sitemap" SITEMAP_NAME="sitemap.xml" SITEMAP_ENDPOINT="http://localhost:3001/api/sitemap" AGREEMENTS_DESTINATION_FOLDER="agreements" AGREEMENTS_DESTINATION_NAME="index.json" BUCKET_DEFAULT_FOLDER="default" BUCKET_DRAFT_FOLDER="draft" BUCKET_PUBLISHED_FOLDER= BUCKET_PREVIEW_FOLDER="preview" BUCKET_ACCESS_KEY="MINIO_ACCESS_KEY" BUCKET_ENDPOINT=http://localhost:9000 BUCKET_NAME="cdtn" BUCKET_SECRET_KEY="MINIO_SECRET_KEY" BUCKET_REGION="us-east-1" CDTN_ADMIN_ENDPOINT="http://localhost:8080/v1/graphql" DESTINATION_CONTAINER_COPY="testcopy" ELASTICSEARCH_INDEX_PREPROD="cdtn-v2" ELASTICSEARCH_INDEX_PROD="cdtn-v2" FETCH_PAGE_SIZE=1000 FETCH_JOB_CONCURRENCY=5 yarn workspace export-elasticsearch dev +GLOSSARY_PREPROD_DISABLE=true DISABLE_LIMIT_EXPORT=true DISABLE_AGREEMENTS=true DISABLE_SITEMAP=true NLP_URL=https://serving-ml-preprod.ovh.fabrique.social.gouv.fr HASURA_GRAPHQL_ENDPOINT="http://localhost:8080/v1/graphql" HASURA_GRAPHQL_ADMIN_SECRET="admin1" ELASTICSEARCH_URL_PREPROD="http://localhost:9200" ELASTICSEARCH_URL_PROD="http://localhost:9200" SITEMAP_DESTINATION_FOLDER="sitemap" SITEMAP_NAME="sitemap.xml" SITEMAP_ENDPOINT="http://localhost:3001/api/sitemap" AGREEMENTS_DESTINATION_FOLDER="agreements" AGREEMENTS_DESTINATION_NAME="index.json" BUCKET_DEFAULT_FOLDER="default" BUCKET_DRAFT_FOLDER="draft" BUCKET_PUBLISHED_FOLDER= BUCKET_PREVIEW_FOLDER="preview" BUCKET_ACCESS_KEY="MINIO_ACCESS_KEY" BUCKET_ENDPOINT=http://localhost:9000 BUCKET_NAME="cdtn" BUCKET_SECRET_KEY="MINIO_SECRET_KEY" BUCKET_REGION="us-east-1" CDTN_ADMIN_ENDPOINT="http://localhost:8080/v1/graphql" ELASTICSEARCH_INDEX_PREPROD="cdtn-v2" ELASTICSEARCH_INDEX_PROD="cdtn-v2" FETCH_PAGE_SIZE=1000 FETCH_JOB_CONCURRENCY=5 yarn workspace export-elasticsearch dev ``` - `DISABLE_LIMIT_EXPORT` is used to disable the limit to run two export in less than one hour @@ -184,7 +177,7 @@ yarn workspace frontend dev #### On client ```sh -NLP_URL=https://serving-ml-preprod.dev.fabrique.social.gouv.fr yarn workspace @cdt/frontend dev +NLP_URL=https://serving-ml-preprod.ovh.fabrique.social.gouv.fr yarn workspace @cdt/frontend dev ``` 1. Go to `http://localhost:3001/` diff --git a/docker-compose.yml b/docker-compose.yml index 9516bbdee1..8007d13d0a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,21 +49,6 @@ services: environment: HASURA_GRAPHQL_ENDPOINT: "http://hasura:8080/v1/graphql" - contributions: - build: - context: . - dockerfile: targets/contributions/Dockerfile - shm_size: 512m - depends_on: - - hasura - - www - ports: - - "3200:3200" - environment: - API_URI: http://www - env_file: - - .env - ingester: build: context: . @@ -138,7 +123,7 @@ services: DISABLE_COPY: "true" DISABLE_SITEMAP: "true" DISABLE_AGREEMENTS: "true" - NLP_URL: "https://serving-ml-preprod.dev.fabrique.social.gouv.fr" + NLP_URL: "https://serving-ml-preprod.ovh.fabrique.social.gouv.fr" ELASTICSEARCH_INDEX_PREPROD: "cdtn-preprod-v1" ELASTICSEARCH_INDEX_PROD: "cdtn-v1" ELASTICSEARCH_URL_PREPROD: "http://elasticsearch:9200" diff --git a/lerna.json b/lerna.json index 2da130cb4b..fd4daf3514 100644 --- a/lerna.json +++ b/lerna.json @@ -7,6 +7,6 @@ } }, "npmClient": "yarn", - "version": "2.37.1", + "version": "2.41.4", "useWorkspaces": true } diff --git a/package-scripts.yml b/package-scripts.yml index 09db3d45ee..faa406eedd 100644 --- a/package-scripts.yml +++ b/package-scripts.yml @@ -1,6 +1,6 @@ scripts: build: - default: lerna run --stream build --ignore @socialgouv/contibutions + default: lerna run --stream build internals: lerna run --stream --scope shared* build targets: lerna run --stream --scope frontend --scope alert-cli build diff --git a/package.json b/package.json index e8e317d0f2..a8ec5b1fbd 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "private": true, "scripts": { "build": "nps build", - "build:watch": "lerna run --stream build:watch --ignore @socialgouv/contibutions", + "build:watch": "lerna run --stream build:watch", "dev": "nps dev", "lint": "nps lint", "start": "nps", diff --git a/shared/elasticsearch/.eslintignore b/shared/elasticsearch/.eslintignore index 3c3629e647..8170577a9c 100644 --- a/shared/elasticsearch/.eslintignore +++ b/shared/elasticsearch/.eslintignore @@ -1 +1,2 @@ node_modules +*.d.ts diff --git a/shared/elasticsearch/CHANGELOG.md b/shared/elasticsearch/CHANGELOG.md index 079d479b07..3c35471dcd 100644 --- a/shared/elasticsearch/CHANGELOG.md +++ b/shared/elasticsearch/CHANGELOG.md @@ -3,6 +3,74 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.41.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.3...v2.41.4) (2024-04-09) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.41.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.2...v2.41.3) (2024-04-09) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.41.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.1...v2.41.2) (2024-04-09) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.41.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.0...v2.41.1) (2024-04-05) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +# [2.41.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.2...v2.41.0) (2024-04-04) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.40.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.1...v2.40.2) (2024-04-04) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.40.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.0...v2.40.1) (2024-04-03) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +# [2.40.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.7...v2.40.0) (2024-04-02) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.39.7](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.6...v2.39.7) (2024-03-28) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.39.6](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.5...v2.39.6) (2024-03-27) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.39.5](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.4...v2.39.5) (2024-03-26) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.39.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.3...v2.39.4) (2024-03-26) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.39.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.2...v2.39.3) (2024-03-25) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.39.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.1...v2.39.2) (2024-03-25) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +## [2.39.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.0...v2.39.1) (2024-03-25) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +# [2.39.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.38.0...v2.39.0) (2024-03-25) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + +# [2.38.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.1...v2.38.0) (2024-03-18) + +**Note:** Version bump only for package @socialgouv/cdtn-elasticsearch + ## [2.37.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.0...v2.37.1) (2024-03-13) **Note:** Version bump only for package @socialgouv/cdtn-elasticsearch diff --git a/shared/elasticsearch/package.json b/shared/elasticsearch/package.json index 84af2e8bd8..056cfbaadd 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.37.1", + "version": "2.41.4", "babel": { "plugins": [ "@babel/plugin-transform-modules-commonjs" @@ -43,5 +43,5 @@ ] }, "sideEffects": false, - "typings": "src/index.d.ts" + "types": "src/index.d.ts" } diff --git a/shared/elasticsearch/src/index.d.ts b/shared/elasticsearch/src/index.d.ts new file mode 100644 index 0000000000..a625fdad61 --- /dev/null +++ b/shared/elasticsearch/src/index.d.ts @@ -0,0 +1,9 @@ +export const createIndex: any; +export const deleteOldIndex: any; +export const documentMapping: any; +export const DOCUMENTS: string; +export const indexDocumentsBatched: any; +export const SUGGESTIONS: string; +export const vectorizeDocument: any; +export const version: any; +export const suggestionMapping: any; diff --git a/shared/eslint-config/CHANGELOG.md b/shared/eslint-config/CHANGELOG.md index a14abe4088..452f4126f7 100644 --- a/shared/eslint-config/CHANGELOG.md +++ b/shared/eslint-config/CHANGELOG.md @@ -3,6 +3,74 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.41.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.3...v2.41.4) (2024-04-09) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.41.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.2...v2.41.3) (2024-04-09) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.41.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.1...v2.41.2) (2024-04-09) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.41.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.0...v2.41.1) (2024-04-05) + +**Note:** Version bump only for package @shared/eslint-config + +# [2.41.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.2...v2.41.0) (2024-04-04) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.40.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.1...v2.40.2) (2024-04-04) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.40.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.0...v2.40.1) (2024-04-03) + +**Note:** Version bump only for package @shared/eslint-config + +# [2.40.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.7...v2.40.0) (2024-04-02) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.39.7](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.6...v2.39.7) (2024-03-28) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.39.6](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.5...v2.39.6) (2024-03-27) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.39.5](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.4...v2.39.5) (2024-03-26) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.39.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.3...v2.39.4) (2024-03-26) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.39.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.2...v2.39.3) (2024-03-25) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.39.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.1...v2.39.2) (2024-03-25) + +**Note:** Version bump only for package @shared/eslint-config + +## [2.39.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.0...v2.39.1) (2024-03-25) + +**Note:** Version bump only for package @shared/eslint-config + +# [2.39.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.38.0...v2.39.0) (2024-03-25) + +**Note:** Version bump only for package @shared/eslint-config + +# [2.38.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.1...v2.38.0) (2024-03-18) + +**Note:** Version bump only for package @shared/eslint-config + ## [2.37.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.0...v2.37.1) (2024-03-13) **Note:** Version bump only for package @shared/eslint-config diff --git a/shared/eslint-config/package.json b/shared/eslint-config/package.json index 525817c6de..c0206a3b1e 100644 --- a/shared/eslint-config/package.json +++ b/shared/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@shared/eslint-config", - "version": "2.37.1", + "version": "2.41.4", "main": "index.js", "private": true, "dependencies": { diff --git a/shared/types/CHANGELOG.md b/shared/types/CHANGELOG.md index edf6820200..a190ab45ac 100644 --- a/shared/types/CHANGELOG.md +++ b/shared/types/CHANGELOG.md @@ -3,6 +3,78 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.41.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.3...v2.41.4) (2024-04-09) + +**Note:** Version bump only for package @shared/types + +## [2.41.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.2...v2.41.3) (2024-04-09) + +**Note:** Version bump only for package @shared/types + +## [2.41.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.1...v2.41.2) (2024-04-09) + +**Note:** Version bump only for package @shared/types + +## [2.41.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.0...v2.41.1) (2024-04-05) + +**Note:** Version bump only for package @shared/types + +# [2.41.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.2...v2.41.0) (2024-04-04) + +**Note:** Version bump only for package @shared/types + +## [2.40.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.1...v2.40.2) (2024-04-04) + +**Note:** Version bump only for package @shared/types + +## [2.40.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.0...v2.40.1) (2024-04-03) + +**Note:** Version bump only for package @shared/types + +# [2.40.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.7...v2.40.0) (2024-04-02) + +### Features + +- 1308 admin extraction des prqualifis ([#1315](https://github.com/SocialGouv/cdtn-admin/issues/1315)) ([cef0ceb](https://github.com/SocialGouv/cdtn-admin/commit/cef0cebe84919b58045bb369a5d49b72c211ea7f)) + +## [2.39.7](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.6...v2.39.7) (2024-03-28) + +**Note:** Version bump only for package @shared/types + +## [2.39.6](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.5...v2.39.6) (2024-03-27) + +**Note:** Version bump only for package @shared/types + +## [2.39.5](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.4...v2.39.5) (2024-03-26) + +**Note:** Version bump only for package @shared/types + +## [2.39.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.3...v2.39.4) (2024-03-26) + +**Note:** Version bump only for package @shared/types + +## [2.39.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.2...v2.39.3) (2024-03-25) + +**Note:** Version bump only for package @shared/types + +## [2.39.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.1...v2.39.2) (2024-03-25) + +**Note:** Version bump only for package @shared/types + +## [2.39.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.0...v2.39.1) (2024-03-25) + +**Note:** Version bump only for package @shared/types + +# [2.39.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.38.0...v2.39.0) (2024-03-25) + +### Features + +- **information:** optimisation du chargement des contenus `relatedDocuments` pendant l'export ([#1319](https://github.com/SocialGouv/cdtn-admin/issues/1319)) ([b367d24](https://github.com/SocialGouv/cdtn-admin/commit/b367d24b8a1b5ee90f10b415348c0ab2473208f9)) + +# [2.38.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.1...v2.38.0) (2024-03-18) + +**Note:** Version bump only for package @shared/types + ## [2.37.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.0...v2.37.1) (2024-03-13) **Note:** Version bump only for package @shared/types diff --git a/shared/types/export/global.ts b/shared/types/export/global.ts index cc76f2bead..ef197c5670 100644 --- a/shared/types/export/global.ts +++ b/shared/types/export/global.ts @@ -29,3 +29,15 @@ export type DocumentElastic = { metaDescription: string; refs: DocumentRef[]; }; + +export type RelatedDocument = { + id: string; + cdtnId: string; + breadcrumbs: Breadcrumbs[]; + title: string; + slug: string; + source: string; + description: string; + icon?: string; // Pour afficher l'icon du simulateur dans la tuile + action?: string; // Pour afficher le texte du bouton pour le simulateur dans la tuile +}; diff --git a/shared/types/export/index.ts b/shared/types/export/index.ts index 76b56cb216..22c4262e24 100644 --- a/shared/types/export/index.ts +++ b/shared/types/export/index.ts @@ -1,3 +1,4 @@ export * from "./agreements"; export * from "./contributions"; export * from "./global"; +export * from "./prequalified"; diff --git a/shared/types/export/prequalified.ts b/shared/types/export/prequalified.ts new file mode 100644 index 0000000000..204d428ab2 --- /dev/null +++ b/shared/types/export/prequalified.ts @@ -0,0 +1,11 @@ +import { DocumentElasticWithSource } from "./global"; + +type Prequalified = { + source: "prequalified"; + variants: string[]; +}; + +export type PrequalifiedElasticDocument = Omit< + DocumentElasticWithSource, + "slug" +>; diff --git a/shared/types/index.ts b/shared/types/index.ts index a7177d8f61..c3283a8df7 100644 --- a/shared/types/index.ts +++ b/shared/types/index.ts @@ -435,7 +435,6 @@ export interface User { id: string; name: string; email: string; - created_at: Date; } export interface ExportEsStatus { diff --git a/shared/types/package.json b/shared/types/package.json index 60457bebd9..7eed31f5d5 100644 --- a/shared/types/package.json +++ b/shared/types/package.json @@ -1,6 +1,6 @@ { "name": "@shared/types", - "version": "2.37.1", + "version": "2.41.4", "private": true, "main": "build/index.js", "module": "build/index.js", @@ -12,6 +12,6 @@ "devDependencies": { "@socialgouv/kali-data-types": "^2.127.0", "@socialgouv/legi-data-types": "^2.73.1", - "typescript": "^4.9.5" + "typescript": "^5.4.3" } } diff --git a/shared/utils/CHANGELOG.md b/shared/utils/CHANGELOG.md index 5f43422a14..a3b1b5b8fc 100644 --- a/shared/utils/CHANGELOG.md +++ b/shared/utils/CHANGELOG.md @@ -3,6 +3,74 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.41.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.3...v2.41.4) (2024-04-09) + +**Note:** Version bump only for package @shared/utils + +## [2.41.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.2...v2.41.3) (2024-04-09) + +**Note:** Version bump only for package @shared/utils + +## [2.41.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.1...v2.41.2) (2024-04-09) + +**Note:** Version bump only for package @shared/utils + +## [2.41.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.0...v2.41.1) (2024-04-05) + +**Note:** Version bump only for package @shared/utils + +# [2.41.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.2...v2.41.0) (2024-04-04) + +**Note:** Version bump only for package @shared/utils + +## [2.40.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.1...v2.40.2) (2024-04-04) + +**Note:** Version bump only for package @shared/utils + +## [2.40.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.0...v2.40.1) (2024-04-03) + +**Note:** Version bump only for package @shared/utils + +# [2.40.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.7...v2.40.0) (2024-04-02) + +**Note:** Version bump only for package @shared/utils + +## [2.39.7](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.6...v2.39.7) (2024-03-28) + +**Note:** Version bump only for package @shared/utils + +## [2.39.6](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.5...v2.39.6) (2024-03-27) + +**Note:** Version bump only for package @shared/utils + +## [2.39.5](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.4...v2.39.5) (2024-03-26) + +**Note:** Version bump only for package @shared/utils + +## [2.39.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.3...v2.39.4) (2024-03-26) + +**Note:** Version bump only for package @shared/utils + +## [2.39.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.2...v2.39.3) (2024-03-25) + +**Note:** Version bump only for package @shared/utils + +## [2.39.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.1...v2.39.2) (2024-03-25) + +**Note:** Version bump only for package @shared/utils + +## [2.39.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.0...v2.39.1) (2024-03-25) + +**Note:** Version bump only for package @shared/utils + +# [2.39.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.38.0...v2.39.0) (2024-03-25) + +**Note:** Version bump only for package @shared/utils + +# [2.38.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.1...v2.38.0) (2024-03-18) + +**Note:** Version bump only for package @shared/utils + ## [2.37.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.0...v2.37.1) (2024-03-13) **Note:** Version bump only for package @shared/utils diff --git a/shared/utils/package.json b/shared/utils/package.json index a5817d6de4..39b78af2ae 100644 --- a/shared/utils/package.json +++ b/shared/utils/package.json @@ -1,13 +1,13 @@ { "name": "@shared/utils", - "version": "2.37.1", + "version": "2.41.4", "dependencies": { "@socialgouv/cdtn-sources": "^4.91.1", "@socialgouv/cdtn-utils": "^4.109.0", "@socialgouv/dila-api-client": "^1.2.4", - "@urql/core": "^2.4.3", - "graphql": "^16.3.0", - "isomorphic-unfetch": "^3.1.0", + "@urql/core": "^4.3.0", + "graphql": "^16.8.1", + "isomorphic-unfetch": "^4.0.2", "uuid": "^9.0.1", "winston": "3.3.3", "xxhashjs": "^0.2.2" @@ -27,6 +27,6 @@ "@types/uuid": "^9.0.5", "@types/xxhashjs": "^0.2.2", "jest": "^29.7.0", - "typescript": "^5.3.3" + "typescript": "^5.4.3" } } diff --git a/shared/utils/src/gql-client.ts b/shared/utils/src/gql-client.ts index ef7dd0b77b..ab9c47b927 100644 --- a/shared/utils/src/gql-client.ts +++ b/shared/utils/src/gql-client.ts @@ -1,12 +1,17 @@ -import { createClient } from "@urql/core"; +import { + cacheExchange, + createClient, + fetchExchange, + gql as gqlHelper, +} from "@urql/core"; import fetch from "isomorphic-unfetch"; -type GqlClient = { +type GqlClientParameter = { graphqlEndpoint: string; adminSecret: string; }; -const defaultProps: GqlClient = { +const defaultProps: GqlClientParameter = { graphqlEndpoint: process.env.HASURA_GRAPHQL_ENDPOINT ?? "http://localhost:8080/v1/graphql", adminSecret: process.env.HASURA_GRAPHQL_ADMIN_SECRET ?? "admin1", @@ -24,4 +29,9 @@ export const gqlClient = (props = defaultProps) => maskTypename: true, requestPolicy: "network-only", url: props.graphqlEndpoint, + exchanges: [cacheExchange, fetchExchange], }); + +export type GqlClient = ReturnType; + +export const gql = gqlHelper; diff --git a/targets/alert-cli/CHANGELOG.md b/targets/alert-cli/CHANGELOG.md index 59d9f787d9..ec16ce860d 100644 --- a/targets/alert-cli/CHANGELOG.md +++ b/targets/alert-cli/CHANGELOG.md @@ -3,6 +3,80 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.41.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.3...v2.41.4) (2024-04-09) + +**Note:** Version bump only for package alert-cli + +## [2.41.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.2...v2.41.3) (2024-04-09) + +**Note:** Version bump only for package alert-cli + +## [2.41.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.1...v2.41.2) (2024-04-09) + +**Note:** Version bump only for package alert-cli + +## [2.41.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.41.0...v2.41.1) (2024-04-05) + +### Bug Fixes + +- **alert:** passer directement le token dans l'URL pour contacter le site MT ([#1357](https://github.com/SocialGouv/cdtn-admin/issues/1357)) ([4486e8f](https://github.com/SocialGouv/cdtn-admin/commit/4486e8ff6fb226c97500698734345bac81c1de97)) + +# [2.41.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.2...v2.41.0) (2024-04-04) + +### Features + +- desinstaller les anciennes contributions de l'admin ([#1326](https://github.com/SocialGouv/cdtn-admin/issues/1326)) ([917574c](https://github.com/SocialGouv/cdtn-admin/commit/917574c135f3f74ae445d2b10ca5eb21375787b7)) + +## [2.40.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.1...v2.40.2) (2024-04-04) + +**Note:** Version bump only for package alert-cli + +## [2.40.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.40.0...v2.40.1) (2024-04-03) + +**Note:** Version bump only for package alert-cli + +# [2.40.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.7...v2.40.0) (2024-04-02) + +### Features + +- 1308 admin extraction des prqualifis ([#1315](https://github.com/SocialGouv/cdtn-admin/issues/1315)) ([cef0ceb](https://github.com/SocialGouv/cdtn-admin/commit/cef0cebe84919b58045bb369a5d49b72c211ea7f)) + +## [2.39.7](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.6...v2.39.7) (2024-03-28) + +**Note:** Version bump only for package alert-cli + +## [2.39.6](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.5...v2.39.6) (2024-03-27) + +**Note:** Version bump only for package alert-cli + +## [2.39.5](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.4...v2.39.5) (2024-03-26) + +**Note:** Version bump only for package alert-cli + +## [2.39.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.3...v2.39.4) (2024-03-26) + +**Note:** Version bump only for package alert-cli + +## [2.39.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.2...v2.39.3) (2024-03-25) + +**Note:** Version bump only for package alert-cli + +## [2.39.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.1...v2.39.2) (2024-03-25) + +**Note:** Version bump only for package alert-cli + +## [2.39.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.39.0...v2.39.1) (2024-03-25) + +**Note:** Version bump only for package alert-cli + +# [2.39.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.38.0...v2.39.0) (2024-03-25) + +**Note:** Version bump only for package alert-cli + +# [2.38.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.1...v2.38.0) (2024-03-18) + +**Note:** Version bump only for package alert-cli + ## [2.37.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.0...v2.37.1) (2024-03-13) **Note:** Version bump only for package alert-cli diff --git a/targets/alert-cli/package.json b/targets/alert-cli/package.json index a55eab4ad5..14aa22f017 100644 --- a/targets/alert-cli/package.json +++ b/targets/alert-cli/package.json @@ -1,6 +1,6 @@ { "name": "alert-cli", - "version": "2.37.1", + "version": "2.41.4", "engines": { "node": ">=20.0.2" }, @@ -32,18 +32,18 @@ "@socialgouv/kali-data-types": "2.127.0", "@socialgouv/legi-data-types": "2.73.1", "@types/diff": "^5.0.3", - "@types/jest": "27.4.0", + "@types/jest": "^29.5.12", "@types/memoizee": "0.4.6", "@types/node": "16.11.11", "@types/semver": "7.3.8", "@types/unist": "2.0.6", "@vercel/ncc": "0.34.0", "builtin-modules": "3.2.0", - "jest": "27.0.6", + "jest": "^29.7.0", "lint-staged": "12.0.0", - "ts-jest": "27.0.5", + "ts-jest": "^29.1.2", "ts-node": "10.8.0", - "typescript": "4.7.2" + "typescript": "^5.4.3" }, "scripts": { "build": "ncc build ./src/index.ts -o ./dist -e nodegit -s", diff --git a/targets/alert-cli/src/dares/scrapping.ts b/targets/alert-cli/src/dares/scrapping.ts index 75553e1a68..aaa1f2d810 100644 --- a/targets/alert-cli/src/dares/scrapping.ts +++ b/targets/alert-cli/src/dares/scrapping.ts @@ -2,11 +2,9 @@ import axios from "axios"; import { URL_SCRAPING } from "./config"; export const extractDaresXlsxFromMT = async () => { - const response = await axios.get(URL_SCRAPING, { - headers: { - Cookie: `cgtoken=${process.env.TOKEN_MT};`, - }, - }); + const response = await axios.get( + `${URL_SCRAPING}?cgtoken=${process.env.TOKEN_MT}` + ); const html = response.data; const regex = /href="([^"]*\.xlsx)"/g; const match = regex.exec(html); diff --git a/targets/alert-cli/src/diff/dila/extractReferences/__tests__/editorialContents.test.ts b/targets/alert-cli/src/diff/dila/extractReferences/__tests__/editorialContents.test.ts index 269d1d0374..17e85a4861 100644 --- a/targets/alert-cli/src/diff/dila/extractReferences/__tests__/editorialContents.test.ts +++ b/targets/alert-cli/src/diff/dila/extractReferences/__tests__/editorialContents.test.ts @@ -26,51 +26,51 @@ test("extractMailTemplateRef", async () => { payload as EditorialContentSubset[] ); expect(references).toMatchInlineSnapshot(` -Array [ - Object { - "document": Object { - "id": "be3ba4c0-4540-4c38-9203-65bc732486a0", - "source": "information", - "title": "Intéressement et participation : nouveautés Covid-19", - }, - "references": Array [ - Object { - "dila_cid": "LEGIARTI000041747466", - "dila_container_id": "cdtn", - "dila_id": "LEGIARTI000041747466", - "title": "article LEGIARTI000041747466", - "url": "", + [ + { + "document": { + "id": "be3ba4c0-4540-4c38-9203-65bc732486a0", + "source": "information", + "title": "Intéressement et participation : nouveautés Covid-19", + }, + "references": [ + { + "dila_cid": "LEGIARTI000041747466", + "dila_container_id": "cdtn", + "dila_id": "LEGIARTI000041747466", + "title": "article LEGIARTI000041747466", + "url": "", + }, + { + "dila_cid": "LEGIARTI000041979663", + "dila_container_id": "cdtn", + "dila_id": "LEGIARTI000041979663", + "title": "article LEGIARTI000041979663", + "url": "", + }, + { + "dila_cid": "LEGIARTI000038613233", + "dila_container_id": "cdtn", + "dila_id": "LEGIARTI000038613233", + "title": "article LEGIARTI000038613233", + "url": "", + }, + { + "dila_cid": "LEGIARTI000041973737", + "dila_container_id": "cdtn", + "dila_id": "LEGIARTI000041973737", + "title": "article LEGIARTI000041973737", + "url": "", + }, + { + "dila_cid": "LEGIARTI000042012392", + "dila_container_id": "cdtn", + "dila_id": "LEGIARTI000042012392", + "title": "article LEGIARTI000042012392", + "url": "", + }, + ], }, - Object { - "dila_cid": "LEGIARTI000041979663", - "dila_container_id": "cdtn", - "dila_id": "LEGIARTI000041979663", - "title": "article LEGIARTI000041979663", - "url": "", - }, - Object { - "dila_cid": "LEGIARTI000038613233", - "dila_container_id": "cdtn", - "dila_id": "LEGIARTI000038613233", - "title": "article LEGIARTI000038613233", - "url": "", - }, - Object { - "dila_cid": "LEGIARTI000041973737", - "dila_container_id": "cdtn", - "dila_id": "LEGIARTI000041973737", - "title": "article LEGIARTI000041973737", - "url": "", - }, - Object { - "dila_cid": "LEGIARTI000042012392", - "dila_container_id": "cdtn", - "dila_id": "LEGIARTI000042012392", - "title": "article LEGIARTI000042012392", - "url": "", - }, - ], - }, -] -`); + ] + `); }); diff --git a/targets/alert-cli/src/diff/dila/extractReferences/__tests__/mailTemplates.test.ts b/targets/alert-cli/src/diff/dila/extractReferences/__tests__/mailTemplates.test.ts index aa44fa0b9c..093bc58e5d 100644 --- a/targets/alert-cli/src/diff/dila/extractReferences/__tests__/mailTemplates.test.ts +++ b/targets/alert-cli/src/diff/dila/extractReferences/__tests__/mailTemplates.test.ts @@ -26,23 +26,23 @@ test("extractMailTemplateRef", async () => { payload as MailTemplateSubset[] ); expect(references).toMatchInlineSnapshot(` -Array [ - Object { - "document": Object { - "id": "576b0a92-16de-449e-a9d0-199e89d674cd", - "source": "modeles_de_courriers", - "title": "document de test", - }, - "references": Array [ - Object { - "dila_cid": "LEGIARTI000035643605", - "dila_container_id": "cdtn", - "dila_id": "LEGIARTI000035643605", - "title": "article LEGIARTI000035643605", - "url": "", + [ + { + "document": { + "id": "576b0a92-16de-449e-a9d0-199e89d674cd", + "source": "modeles_de_courriers", + "title": "document de test", + }, + "references": [ + { + "dila_cid": "LEGIARTI000035643605", + "dila_container_id": "cdtn", + "dila_id": "LEGIARTI000035643605", + "title": "article LEGIARTI000035643605", + "url": "", + }, + ], }, - ], - }, -] -`); + ] + `); }); diff --git a/targets/alert-cli/src/diff/dila/extractReferences/contribution/__tests__/getOldContrib.test.ts b/targets/alert-cli/src/diff/dila/extractReferences/contribution/__tests__/getOldContrib.test.ts deleted file mode 100644 index ef48778f04..0000000000 --- a/targets/alert-cli/src/diff/dila/extractReferences/contribution/__tests__/getOldContrib.test.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { expect, test } from "@jest/globals"; - -import type { Contrib } from "../getOldContribRef"; -import { extractContributionsRef, getOldContribRef } from "../getOldContribRef"; - -jest.mock("../../../../shared/getAllDocumentsBySource", () => { - return { - getAllDocumentsBySource: () => mockContributions, - }; -}); - -//using name starting with mock allow jest to hoist variable and then mock -const mockContributions: Contrib[] = [ - { - cdtnId: "contrib-1", - document: { - answers: { - conventions: [ - { - id: "id-answer-123", - idcc: "123", - markdown: "## markdown answer", - references: [ - { - category: "agreement", - dila_cid: "c123", - dila_container_id: "kalicont123", - dila_id: "125", - title: "accord c123", - url: "url/c123", - }, - { - category: "agreement", - dila_cid: "ext", - dila_container_id: "kalicont123", - dila_id: "ext125", - title: "accord c125", - url: "url/c125", - }, - { - category: "agreement", - dila_cid: "4", - dila_container_id: "kalicont42", - dila_id: "4", - title: "accord 42", - url: "url/42", - }, - ], - }, - ], - generic: { - description: "desc", - id: "id-generic", - markdown: "##markdown", - references: [ - { - category: "agreement", - dila_cid: "c1", - dila_container_id: "kalicont123", - dila_id: "1", - title: "Accord du 4 juin", - url: "legifrance.url/kalicont123", - }, - { - category: "agreement", - dila_cid: "3", - dila_container_id: "kalicont42", - dila_id: "3", - title: "Accord du 3 novembre", - url: "legifrance.url/kalicont42", - }, - ], - text: "text", - }, - }, - description: "description contrib", - index: 1, - split: false, - }, - initialId: "answer1", - source: "contributions", - title: "question1", - }, -]; - -const expected = [ - { - document: { - id: "answer1", - source: "contributions", - title: "question1", - }, - references: [ - { - dila_cid: "c1", - dila_container_id: "kalicont123", - dila_id: "1", - title: "Accord du 4 juin", - url: "legifrance.url/kalicont123", - }, - { - dila_cid: "3", - dila_container_id: "kalicont42", - dila_id: "3", - title: "Accord du 3 novembre", - url: "legifrance.url/kalicont42", - }, - ], - }, - { - document: { - id: "id-answer-123", - source: "contributions", - title: "question1", - }, - references: [ - { - dila_cid: "c123", - dila_container_id: "kalicont123", - dila_id: "125", - title: "accord c123", - url: "url/c123", - }, - { - dila_cid: "ext", - dila_container_id: "kalicont123", - dila_id: "ext125", - title: "accord c125", - url: "url/c125", - }, - { - dila_cid: "4", - dila_container_id: "kalicont42", - dila_id: "4", - title: "accord 42", - url: "url/42", - }, - ], - }, -]; - -test("extractContributionRef should return an array of references", () => { - expect(extractContributionsRef(mockContributions)).toEqual(expected); -}); - -test("default export should return an array of references", async () => { - expect(await getOldContribRef()).toEqual(expected); -}); diff --git a/targets/alert-cli/src/diff/dila/extractReferences/contribution/getOldContribRef.ts b/targets/alert-cli/src/diff/dila/extractReferences/contribution/getOldContribRef.ts deleted file mode 100644 index 96bd8d49b6..0000000000 --- a/targets/alert-cli/src/diff/dila/extractReferences/contribution/getOldContribRef.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { - ContributionComplete, - ContributionFiltered, - DocumentReferences, -} from "@shared/types"; -import { SOURCES } from "@socialgouv/cdtn-sources"; - -import { getAllDocumentsBySource } from "../../../shared/getAllDocumentsBySource"; - -export type Contrib = Pick< - ContributionComplete | ContributionFiltered, - "document" | "source" | "title" -> & { - initialId: string; - cdtnId: string; -}; - -export function extractContributionsRef( - questions: Contrib[] -): DocumentReferences[] { - const refs: DocumentReferences[] = []; - - for (const question of questions) { - if ("answers" in question.document) { - refs.push({ - document: { - id: question.initialId, - source: SOURCES.CONTRIBUTIONS, - title: question.title, - }, - references: question.document.answers.generic.references.flatMap( - (ref) => { - if (ref.category === null) { - return []; - } - return [ - { - dila_cid: ref.dila_cid, - dila_container_id: ref.dila_container_id, - dila_id: ref.dila_id, - title: ref.title, - url: ref.url, - }, - ]; - } - ), - }); - if ("conventionAnswer" in question.document.answers) { - continue; - } - if (question.document.split) { - continue; - } - question.document.answers.conventions.forEach((answer) => - refs.push({ - document: { - id: answer.id, - source: SOURCES.CONTRIBUTIONS, - title: question.title, - }, - references: answer.references.flatMap((ref) => { - if (ref.category === null) return []; - return [ - { - dila_cid: ref.dila_cid, - dila_container_id: ref.dila_container_id, - dila_id: ref.dila_id, - title: ref.title, - url: ref.url, - }, - ]; - }), - }) - ); - } - } - return refs; -} - -export async function getOldContribRef() { - const contributions = (await getAllDocumentsBySource([ - SOURCES.CONTRIBUTIONS, - ])) as Contrib[]; - return extractContributionsRef(contributions); -} diff --git a/targets/alert-cli/src/diff/dila/extractReferences/contribution/index.ts b/targets/alert-cli/src/diff/dila/extractReferences/contribution/index.ts index 1fb27ba83b..dc2fd38671 100644 --- a/targets/alert-cli/src/diff/dila/extractReferences/contribution/index.ts +++ b/targets/alert-cli/src/diff/dila/extractReferences/contribution/index.ts @@ -1,13 +1,11 @@ import type { DocumentReferences } from "@shared/types"; import memoizee from "memoizee"; import { getContributionsReferences } from "./getContributionsReferences"; -import { getOldContribRef } from "./getOldContribRef"; async function getContributionReferences(): Promise { const references = await getContributionsReferences(); - const oldReferences = await getOldContribRef(); - return [...references, ...oldReferences]; + return [...references]; } export default memoizee(getContributionReferences, { promise: true }); diff --git a/targets/alert-cli/src/diff/shared/__tests__/getDocumentsWithRelations.test.ts b/targets/alert-cli/src/diff/shared/__tests__/getDocumentsWithRelations.test.ts index 71b190d764..d7ee7502e9 100644 --- a/targets/alert-cli/src/diff/shared/__tests__/getDocumentsWithRelations.test.ts +++ b/targets/alert-cli/src/diff/shared/__tests__/getDocumentsWithRelations.test.ts @@ -3,23 +3,45 @@ import { describe, expect, it } from "@jest/globals"; import { getDocumentsWithRelations } from "../getDocumentsWithRelations"; import { SOURCES } from "@socialgouv/cdtn-sources"; -jest.mock("../getAllDocumentsBySource", () => ({ - getDocumentsWithRelationsBySource: async () => +jest.mock("../createDocumentsFetcher", () => ({ + createDocumentsFetcher: () => async () => Promise.resolve([ { - cdtnId: "1", - contentRelations: [ - { - document: { - initialId: "F2839", - }, + status: "fulfilled", + value: { + data: { + documents: [ + { + cdtnId: "1", + isPublished: true, + contentRelations: [ + { + position: 1, + document: { + initialId: "F2839", + slug: "slug1", + source: "contributions", + title: "contribution1", + }, + }, + ], + source: "themes", + title: "Handicap", + }, + ], }, - ], - source: "themes", - title: "Handicap", + }, }, + ]), +})); + +jest.mock("../fetchPrequalified", () => ({ + fetchPrequalified: async () => + Promise.resolve([ { cdtnId: "2", + isPublished: true, + source: "prequalified", contentRelations: [ { document: { @@ -32,11 +54,12 @@ jest.mock("../getAllDocumentsBySource", () => ({ }, }, ], - source: "prequalified", title: "procédure licenciement pour inaptitude", }, { cdtnId: "3", + isPublished: true, + source: "prequalified", contentRelations: [ { document: { @@ -44,7 +67,6 @@ jest.mock("../getAllDocumentsBySource", () => ({ }, }, ], - source: "prequalified", title: "complement-salaire pole emploi", }, ]), diff --git a/targets/alert-cli/src/diff/shared/createDocumentsFetcher.ts b/targets/alert-cli/src/diff/shared/createDocumentsFetcher.ts new file mode 100644 index 0000000000..bdcc52383e --- /dev/null +++ b/targets/alert-cli/src/diff/shared/createDocumentsFetcher.ts @@ -0,0 +1,54 @@ +import { SourceValues } from "@socialgouv/cdtn-sources"; +import { + AllDocumentsBySourceResult, + AllDocumentsWithRelationBySourceResult, + CountDocumentsBySourceResult, + countDocumentsBySourceQuery, + getAllDocumentsBySourceQuery, +} from "./getDocumentQuery.gql"; +import { gqlClient } from "@shared/utils"; +import { batchPromises } from "../../utils/batch-promises"; + +const PAGE_SIZE = 100; +const JOB_CONCURENCY = 3; + +export const createDocumentsFetcher = + < + T extends + | AllDocumentsBySourceResult + | AllDocumentsWithRelationBySourceResult + >( + gqlRequest = getAllDocumentsBySourceQuery + ) => + async (source: SourceValues[]) => { + const countResult = await gqlClient() + .query(countDocumentsBySourceQuery, { + source, + }) + .toPromise(); + + if (countResult.error || !countResult.data) { + console.error(countResult.error && "no data received"); + throw new Error("getSources"); + } + + const { count } = countResult.data.documents_aggregate.aggregate; + + const pages = Array.from( + { length: Math.ceil(count / PAGE_SIZE) }, + (_, i) => i + ); + const documentResults = await batchPromises( + pages, + async (page) => + gqlClient() + .query(gqlRequest, { + limit: PAGE_SIZE, + offset: page * PAGE_SIZE, + source, + }) + .toPromise(), + JOB_CONCURENCY + ); + return documentResults; + }; diff --git a/targets/alert-cli/src/diff/shared/fetchPrequalified.ts b/targets/alert-cli/src/diff/shared/fetchPrequalified.ts new file mode 100644 index 0000000000..3338b2f678 --- /dev/null +++ b/targets/alert-cli/src/diff/shared/fetchPrequalified.ts @@ -0,0 +1,41 @@ +import { gqlClient } from "@shared/utils"; +import { HasuraDocumentWithRelations } from "./getDocumentQuery.gql"; + +const fetchPrequalifiedQuery = ` +query fetch_prequalified { + search_prequalified { + cdtnId: id + title + contentRelations: documents(order_by: {order: asc}) { + position: order + document { + initialId: initial_id + slug + source + title + } + } + } +} +`; + +interface HasuraReturn { + search_prequalified: HasuraDocumentWithRelations[] | undefined; +} + +export async function fetchPrequalified(): Promise< + HasuraDocumentWithRelations[] | undefined +> { + const res = await gqlClient() + .query(fetchPrequalifiedQuery, {}) + .toPromise(); + if (res.error) { + throw res.error; + } + + return res.data?.search_prequalified?.map((prequalif) => ({ + ...prequalif, + isPublished: true, + source: "prequalified", + })); +} diff --git a/targets/alert-cli/src/diff/shared/getAllDocumentsBySource.ts b/targets/alert-cli/src/diff/shared/getAllDocumentsBySource.ts index 4a6d7e91ca..c8a98992e4 100644 --- a/targets/alert-cli/src/diff/shared/getAllDocumentsBySource.ts +++ b/targets/alert-cli/src/diff/shared/getAllDocumentsBySource.ts @@ -1,64 +1,18 @@ -import { gqlClient } from "@shared/utils"; -import type { SourceValues } from "@socialgouv/cdtn-sources"; +import { SOURCES, type SourceValues } from "@socialgouv/cdtn-sources"; import memoizee from "memoizee"; -import { batchPromises } from "../../utils/batch-promises"; import type { AllDocumentsBySourceResult, AllDocumentsWithRelationBySourceResult, - CountDocumentsBySourceResult, HasuraDocumentForAlert, HasuraDocumentWithRelations, } from "./getDocumentQuery.gql"; import { - countDocumentsBySourceQuery, getAllDocumentsBySourceQuery, getAllDocumentsWithRelationsBySourceQuery, } from "./getDocumentQuery.gql"; - -const PAGE_SIZE = 100; -const JOB_CONCURENCY = 3; - -const createDocumentsFetcher = - < - T extends - | AllDocumentsBySourceResult - | AllDocumentsWithRelationBySourceResult - >( - gqlRequest = getAllDocumentsBySourceQuery - ) => - async (source: SourceValues[]) => { - const countResult = await gqlClient() - .query(countDocumentsBySourceQuery, { - source, - }) - .toPromise(); - - if (countResult.error || !countResult.data) { - console.error(countResult.error && "no data received"); - throw new Error("getSources"); - } - - const { count } = countResult.data.documents_aggregate.aggregate; - - const pages = Array.from( - { length: Math.ceil(count / PAGE_SIZE) }, - (_, i) => i - ); - const documentResults = await batchPromises( - pages, - async (page) => - gqlClient() - .query(gqlRequest, { - limit: PAGE_SIZE, - offset: page * PAGE_SIZE, - source, - }) - .toPromise(), - JOB_CONCURENCY - ); - return documentResults; - }; +import { fetchPrequalified } from "./fetchPrequalified"; +import { createDocumentsFetcher } from "./createDocumentsFetcher"; export async function _getDocumentsBySource( source: SourceValues[] @@ -87,12 +41,18 @@ export async function _getDocumentsWithRelationsBySource( getAllDocumentsWithRelationsBySourceQuery ); const documentResults = await fetchDocuments(source); - const documents = documentResults.flatMap((result) => { + let documents = documentResults.flatMap((result) => { if (result.status === "fulfilled" && result.value.data) { return result.value.data.documents; } return []; }); + if (source.includes(SOURCES.PREQUALIFIED)) { + const fetchedPrequalified = await fetchPrequalified(); + if (fetchedPrequalified) { + documents = documents.concat(fetchedPrequalified); + } + } return documents; } diff --git a/targets/alert-cli/src/diff/shared/getDocumentQuery.gql.ts b/targets/alert-cli/src/diff/shared/getDocumentQuery.gql.ts index ff122d4884..ae4b2a89de 100644 --- a/targets/alert-cli/src/diff/shared/getDocumentQuery.gql.ts +++ b/targets/alert-cli/src/diff/shared/getDocumentQuery.gql.ts @@ -24,9 +24,9 @@ export type HasuraDocumentForAlert = Pick< cdtnId: string; }; -export type AllDocumentsBySourceResult = { +export interface AllDocumentsBySourceResult { documents: HasuraDocumentForAlert[]; -}; +} export const countDocumentsBySourceQuery = ` query coundDocumentsBySource($source:[String!]){ @@ -37,13 +37,13 @@ query coundDocumentsBySource($source:[String!]){ } }`; -export type CountDocumentsBySourceResult = { +export interface CountDocumentsBySourceResult { documents_aggregate: { aggregate: { count: number; }; }; -}; +} export const getAllDocumentsWithRelationsBySourceQuery = ` query($source: [String!], $limit:Int=10,$offset:Int=0 ) { @@ -70,6 +70,7 @@ query($source: [String!], $limit:Int=10,$offset:Int=0 ) { } } `; + export type HasuraDocumentWithRelations = Pick< HasuraDocument, "source" | "title" @@ -83,6 +84,7 @@ export type HasuraDocumentWithRelations = Pick< }; }[]; }; -export type AllDocumentsWithRelationBySourceResult = { + +export interface AllDocumentsWithRelationBySourceResult { documents: HasuraDocumentWithRelations[]; -}; +} diff --git a/targets/alert-cli/src/diff/shared/getSupportedAgreements.ts b/targets/alert-cli/src/diff/shared/getSupportedAgreements.ts index a7c8503c01..f11e8da6d5 100644 --- a/targets/alert-cli/src/diff/shared/getSupportedAgreements.ts +++ b/targets/alert-cli/src/diff/shared/getSupportedAgreements.ts @@ -16,7 +16,7 @@ interface HasuraReturn { export async function getSupportedAgreements(): Promise { const res = await gqlClient() - .query(fetchSupportedAgreements) + .query(fetchSupportedAgreements, {}) .toPromise(); if (res.error || !res.data) { throw new Error( diff --git a/targets/alert-cli/src/repositories/AlertRepository.ts b/targets/alert-cli/src/repositories/AlertRepository.ts index ee2ca57090..68b27f98ed 100644 --- a/targets/alert-cli/src/repositories/AlertRepository.ts +++ b/targets/alert-cli/src/repositories/AlertRepository.ts @@ -1,7 +1,7 @@ -import { Client } from "@urql/core/dist/types/client"; import { AlertChanges, AlertInfo, HasuraAlert } from "@shared/types"; import { batchPromises } from "../utils/batch-promises"; import { DaresAlertInsert } from "../dares/types"; +import { GqlClient } from "@shared/utils"; const insertAlertsMutation = ` mutation insert_alert($alert: alerts_insert_input!) { @@ -25,9 +25,9 @@ interface InsertAlertData { } export class AlertRepository { - private client: Client; + private client: GqlClient; - constructor(client: Client) { + constructor(client: GqlClient) { this.client = client; } diff --git a/targets/alert-cli/src/repositories/FicheSPRepository.ts b/targets/alert-cli/src/repositories/FicheSPRepository.ts index f9d61b5808..a4c98efa28 100644 --- a/targets/alert-cli/src/repositories/FicheSPRepository.ts +++ b/targets/alert-cli/src/repositories/FicheSPRepository.ts @@ -1,4 +1,4 @@ -import { Client } from "@urql/core/dist/types/client"; +import { GqlClient } from "@shared/utils"; const query = ` query vdd { @@ -14,15 +14,15 @@ export interface FicheServicePublicIdsResult { } export class FicheSPRepository { - client: Client; + client: GqlClient; - constructor(client: Client) { + constructor(client: GqlClient) { this.client = client; } async getFicheServicePublicIds(): Promise { const result = await this.client - .query(query) + .query(query, {}) .toPromise(); if (result.error || !result.data) { console.error(result.error); diff --git a/targets/alert-cli/src/repositories/SourcesRepository.ts b/targets/alert-cli/src/repositories/SourcesRepository.ts index da2c101dbe..185e6a6f00 100644 --- a/targets/alert-cli/src/repositories/SourcesRepository.ts +++ b/targets/alert-cli/src/repositories/SourcesRepository.ts @@ -1,4 +1,4 @@ -import { Client } from "@urql/core/dist/types/client"; +import { GqlClient } from "@shared/utils"; import { Source } from "../types"; const sourcesQuery = ` @@ -40,15 +40,15 @@ interface UpdateSourceResult { } export class SourcesRepository { - private client: Client; + private client: GqlClient; - constructor(client: Client) { + constructor(client: GqlClient) { this.client = client; } async load() { const result = await this.client - .query(sourcesQuery) + .query(sourcesQuery, {}) .toPromise(); if (result.error || !result.data) { console.error(result.error); diff --git a/targets/alert-cli/src/repositories/WarningRepository.ts b/targets/alert-cli/src/repositories/WarningRepository.ts index 4214194a20..b118e0ac8c 100644 --- a/targets/alert-cli/src/repositories/WarningRepository.ts +++ b/targets/alert-cli/src/repositories/WarningRepository.ts @@ -1,4 +1,4 @@ -import { Client } from "@urql/core/dist/types/client"; +import { GqlClient } from "@shared/utils"; const insertAlertsMutation = ` mutation insertAlertWarning($article: String!, $document: String!, $source: String!) { @@ -15,9 +15,9 @@ interface InsertWarning { } export class WarningRepository { - private client: Client; + private client: GqlClient; - constructor(client: Client) { + constructor(client: GqlClient) { this.client = client; } diff --git a/targets/contributions/.babelrc b/targets/contributions/.babelrc deleted file mode 100644 index c0e09b2e0e..0000000000 --- a/targets/contributions/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["next/babel"], - "plugins": [["@emotion"]] -} diff --git a/targets/contributions/.browserslistrc b/targets/contributions/.browserslistrc deleted file mode 100644 index 49dac83297..0000000000 --- a/targets/contributions/.browserslistrc +++ /dev/null @@ -1,3 +0,0 @@ -last 2 Chrome versions -last 2 Edge versions -last 2 Firefox versions diff --git a/targets/contributions/.dockerignore b/targets/contributions/.dockerignore deleted file mode 100644 index aab51031a2..0000000000 --- a/targets/contributions/.dockerignore +++ /dev/null @@ -1,11 +0,0 @@ -.next/ -__tests__/ -node_modules/ -tests/ - -*.d.ts -*.md - -jest.config.js -LICENSE - diff --git a/targets/contributions/.gitignore b/targets/contributions/.gitignore deleted file mode 100644 index 991dcb7e9e..0000000000 --- a/targets/contributions/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.env.production -.eslintcache -.next -*.DS_Store -data/* -node_modules diff --git a/targets/contributions/CHANGELOG.md b/targets/contributions/CHANGELOG.md deleted file mode 100644 index accbfd5f65..0000000000 --- a/targets/contributions/CHANGELOG.md +++ /dev/null @@ -1,494 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [2.37.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.37.0...v2.37.1) (2024-03-13) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.37.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.36.0...v2.37.0) (2024-03-13) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.36.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.35.1...v2.36.0) (2024-03-08) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.35.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.35.0...v2.35.1) (2024-03-05) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.35.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.34.4...v2.35.0) (2024-03-04) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.34.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.34.3...v2.34.4) (2024-02-19) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.34.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.34.2...v2.34.3) (2024-02-19) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.34.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.34.1...v2.34.2) (2024-02-16) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.34.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.34.0...v2.34.1) (2024-02-14) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.34.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.33.0...v2.34.0) (2024-02-14) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.33.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.32.1...v2.33.0) (2024-02-06) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.32.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.32.0...v2.32.1) (2024-01-26) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.32.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.31.1...v2.32.0) (2024-01-23) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.31.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.31.0...v2.31.1) (2024-01-19) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.31.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.30.3...v2.31.0) (2024-01-18) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.30.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.30.2...v2.30.3) (2024-01-11) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.30.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.30.1...v2.30.2) (2024-01-10) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.30.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.30.0...v2.30.1) (2024-01-10) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.30.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.29.1...v2.30.0) (2024-01-10) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.29.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.29.0...v2.29.1) (2023-12-28) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.29.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.28.4...v2.29.0) (2023-12-27) - -### Features - -- **export:** ajout du code du `@shared/elastic-document-adapter` dans le code de l'`export-elasticsearch` ([#1183](https://github.com/SocialGouv/cdtn-admin/issues/1183)) ([f6919b4](https://github.com/SocialGouv/cdtn-admin/commit/f6919b427befcc3a298aec3ac4182b2d392b8e34)) - -## [2.28.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.28.3...v2.28.4) (2023-12-21) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.28.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.28.2...v2.28.3) (2023-12-20) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.28.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.28.1...v2.28.2) (2023-12-19) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.28.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.28.0...v2.28.1) (2023-12-18) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.28.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.27.2...v2.28.0) (2023-12-18) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.27.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.27.1...v2.27.2) (2023-12-08) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.27.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.27.0...v2.27.1) (2023-12-08) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.27.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.26.2...v2.27.0) (2023-12-07) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.26.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.26.1...v2.26.2) (2023-12-05) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.26.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.26.0...v2.26.1) (2023-12-05) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.26.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.25.1...v2.26.0) (2023-12-04) - -### Features - -- **contributions:** ajout des contributions à l'api publish ([#1110](https://github.com/SocialGouv/cdtn-admin/issues/1110)) ([2ed595c](https://github.com/SocialGouv/cdtn-admin/commit/2ed595cf98720e960dc7d74f28da1a8c3a1b3bd4)), closes [#1113](https://github.com/SocialGouv/cdtn-admin/issues/1113) - -## [2.25.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.25.0...v2.25.1) (2023-11-29) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.25.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.24.2...v2.25.0) (2023-11-24) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.24.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.24.1...v2.24.2) (2023-11-20) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.24.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.24.0...v2.24.1) (2023-11-20) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.24.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.23.0...v2.24.0) (2023-11-15) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.23.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.22.0...v2.23.0) (2023-11-10) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.22.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.21.0...v2.22.0) (2023-11-08) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.21.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.20.1...v2.21.0) (2023-10-27) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.20.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.20.0...v2.20.1) (2023-10-23) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.20.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.19.1...v2.20.0) (2023-10-19) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.19.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.19.0...v2.19.1) (2023-10-10) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.19.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.18.0...v2.19.0) (2023-10-09) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.18.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.9...v2.18.0) (2023-10-09) - -### Bug Fixes - -- **dependencies:** remove un-used dependencies ([#1034](https://github.com/SocialGouv/cdtn-admin/issues/1034)) ([529ffb4](https://github.com/SocialGouv/cdtn-admin/commit/529ffb40bcf79738494d745b0bb756ebd43ab3a4)) - -## [2.17.9](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.8...v2.17.9) (2023-09-29) - -### Bug Fixes - -- **dev:** correction du probleme de socket en phase de dev en HMR + suppression de sentry ([#1045](https://github.com/SocialGouv/cdtn-admin/issues/1045)) ([d371ec1](https://github.com/SocialGouv/cdtn-admin/commit/d371ec1e7e15b3bd4a017f021099ca0edc9c7911)) - -## [2.17.8](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.7...v2.17.8) (2023-09-28) - -### Bug Fixes - -- **export:** add missing cdtn-elasticsearch to Dockerfile ([#1038](https://github.com/SocialGouv/cdtn-admin/issues/1038)) ([390e646](https://github.com/SocialGouv/cdtn-admin/commit/390e64660fcb8a7143970a20928e98d6da05c22f)) - -## [2.17.7](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.6...v2.17.7) (2023-09-27) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.17.6](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.5...v2.17.6) (2023-09-27) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.17.5](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.4...v2.17.5) (2023-09-27) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.17.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.3...v2.17.4) (2023-09-27) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.17.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.2...v2.17.3) (2023-09-27) - -### Bug Fixes - -- yarn berry + fetch + docker opti + sec ([#1012](https://github.com/SocialGouv/cdtn-admin/issues/1012)) ([81bce48](https://github.com/SocialGouv/cdtn-admin/commit/81bce4838781e60c05a084769a35cf0d2a26609c)) - -## [2.17.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.1...v2.17.2) (2023-09-25) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.17.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.17.0...v2.17.1) (2023-09-25) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.17.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.16.1...v2.17.0) (2023-09-25) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.16.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.16.0...v2.16.1) (2023-09-20) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.16.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.15.1...v2.16.0) (2023-09-18) - -### Features - -- **contribs:** add global stats on contrib page ([#1017](https://github.com/SocialGouv/cdtn-admin/issues/1017)) ([a522361](https://github.com/SocialGouv/cdtn-admin/commit/a522361b83b6dc0f31914289b78ac62336db7cfd)) - -## [2.15.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.15.0...v2.15.1) (2023-09-18) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.15.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.14.0...v2.15.0) (2023-09-15) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.14.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.13.0...v2.14.0) (2023-09-05) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.13.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.12.1...v2.13.0) (2023-08-25) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.12.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.12.0...v2.12.1) (2023-08-04) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.12.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.11.4...v2.12.0) (2023-08-02) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.11.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.11.3...v2.11.4) (2023-07-31) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.11.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.11.2...v2.11.3) (2023-07-28) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.11.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.11.1...v2.11.2) (2023-07-25) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.11.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.11.0...v2.11.1) (2023-07-18) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.11.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.10.2...v2.11.0) (2023-07-12) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.10.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.10.1...v2.10.2) (2023-07-04) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.10.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.10.0...v2.10.1) (2023-07-03) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.10.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.9.1...v2.10.0) (2023-07-03) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.9.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.9.0...v2.9.1) (2023-06-26) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.9.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.8.0...v2.9.0) (2023-06-26) - -### Bug Fixes - -- **lerna:** modify internals dependencies ([c39b77d](https://github.com/SocialGouv/cdtn-admin/commit/c39b77d65692619463f96b3f5eb51e7b1ea976ef)) - -### Features - -- **dep:** update package.json ([69c69ac](https://github.com/SocialGouv/cdtn-admin/commit/69c69ac26b7ac857d1a06c8bbb80e73811460038)) - -# [2.8.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.7.1...v2.8.0) (2023-06-26) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.7.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.7.0...v2.7.1) (2023-06-01) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.7.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.6.1...v2.7.0) (2023-05-30) - -### Bug Fixes - -- **ingester:** clean-up ingester always download packages and add feature to force update ([#910](https://github.com/SocialGouv/cdtn-admin/issues/910)) ([639784a](https://github.com/SocialGouv/cdtn-admin/commit/639784ae72d9f5924d3ec9499945b0c7bc96699b)) - -### Features - -- implementation contribution list ([#897](https://github.com/SocialGouv/cdtn-admin/issues/897)) ([1643d85](https://github.com/SocialGouv/cdtn-admin/commit/1643d853ab9cfbb61bde03394aaf60adade968d4)), closes [#912](https://github.com/SocialGouv/cdtn-admin/issues/912) [#907](https://github.com/SocialGouv/cdtn-admin/issues/907) [#913](https://github.com/SocialGouv/cdtn-admin/issues/913) [#915](https://github.com/SocialGouv/cdtn-admin/issues/915) [#916](https://github.com/SocialGouv/cdtn-admin/issues/916) - -## [2.6.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.6.0...v2.6.1) (2023-05-04) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.6.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.5.4...v2.6.0) (2023-05-04) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.5.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.5.3...v2.5.4) (2023-03-23) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.5.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.5.2...v2.5.3) (2023-03-02) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.5.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.5.1...v2.5.2) (2023-02-23) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.5.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.5.0...v2.5.1) (2023-02-10) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.5.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.4.5...v2.5.0) (2023-02-10) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.4.5](https://github.com/SocialGouv/cdtn-admin/compare/v2.4.4...v2.4.5) (2022-12-28) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.4.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.4.3...v2.4.4) (2022-12-16) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.4.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.4.2...v2.4.3) (2022-12-16) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.4.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.4.1...v2.4.2) (2022-12-15) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.4.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.4.0...v2.4.1) (2022-12-15) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.4.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.3.8...v2.4.0) (2022-12-15) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.3.8](https://github.com/SocialGouv/cdtn-admin/compare/v2.3.7...v2.3.8) (2022-12-07) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.3.7](https://github.com/SocialGouv/cdtn-admin/compare/v2.3.6...v2.3.7) (2022-12-06) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.3.6](https://github.com/SocialGouv/cdtn-admin/compare/v2.3.5...v2.3.6) (2022-12-06) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.3.5](https://github.com/SocialGouv/cdtn-admin/compare/v2.3.4...v2.3.5) (2022-11-08) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.3.4](https://github.com/SocialGouv/cdtn-admin/compare/v2.3.3...v2.3.4) (2022-10-13) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.3.3](https://github.com/SocialGouv/cdtn-admin/compare/v2.3.2...v2.3.3) (2022-10-12) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.3.2](https://github.com/SocialGouv/cdtn-admin/compare/v2.3.1...v2.3.2) (2022-10-12) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [2.3.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.3.0...v2.3.1) (2022-10-10) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.3.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.2.0...v2.3.0) (2022-10-06) - -### Bug Fixes - -- **contrib:** bug sur l'ajout d'un commentaire et suppression d'une réf ([#818](https://github.com/SocialGouv/cdtn-admin/issues/818)) ([971cf8f](https://github.com/SocialGouv/cdtn-admin/commit/971cf8f9244f8d30977a2f49bf6e5c6847ad5332)) - -### Features - -- use super user instead of hasura admin role ([#812](https://github.com/SocialGouv/cdtn-admin/issues/812)) ([5c9ba5b](https://github.com/SocialGouv/cdtn-admin/commit/5c9ba5bbff245d832a6e3bffbd3afce6278d82d0)) - -# [2.2.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.1.0...v2.2.0) (2022-09-05) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.1.0](https://github.com/SocialGouv/cdtn-admin/compare/v2.0.1...v2.1.0) (2022-09-02) - -### Features - -- **headers:** add security headers to frontend and contributions ([#802](https://github.com/SocialGouv/cdtn-admin/issues/802)) ([11381f2](https://github.com/SocialGouv/cdtn-admin/commit/11381f23b30f341b3c665ad6be68c2edf5c45cb1)) - -## [2.0.1](https://github.com/SocialGouv/cdtn-admin/compare/v2.0.0...v2.0.1) (2022-08-29) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [2.0.0](https://github.com/SocialGouv/cdtn-admin/compare/v1.20.0...v2.0.0) (2022-08-17) - -- feat(contribution)!: the generic answer has a null agreement id (#778) ([9776b8c](https://github.com/SocialGouv/cdtn-admin/commit/9776b8ca541d3a79ef0b714d598e2cb32414490e)), closes [#778](https://github.com/SocialGouv/cdtn-admin/issues/778) - -### BREAKING CHANGES - -- database schema - -# [1.20.0](https://github.com/SocialGouv/cdtn-admin/compare/v1.19.2...v1.20.0) (2022-08-17) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [1.19.2](https://github.com/SocialGouv/cdtn-admin/compare/v1.19.1...v1.19.2) (2022-07-21) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [1.19.1](https://github.com/SocialGouv/cdtn-admin/compare/v1.19.0...v1.19.1) (2022-07-21) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [1.19.0](https://github.com/SocialGouv/cdtn-admin/compare/v1.18.2...v1.19.0) (2022-07-08) - -### Bug Fixes - -- **contribution:** correction sur les échecs d'authentification ([#782](https://github.com/SocialGouv/cdtn-admin/issues/782)) ([6e714ae](https://github.com/SocialGouv/cdtn-admin/commit/6e714aed9db6ad633edbf8b862c302ca093d9740)) - -## [1.18.2](https://github.com/SocialGouv/cdtn-admin/compare/v1.18.1...v1.18.2) (2022-06-16) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [1.18.1](https://github.com/SocialGouv/cdtn-admin/compare/v1.18.0...v1.18.1) (2022-06-09) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [1.18.0](https://github.com/SocialGouv/cdtn-admin/compare/v1.17.2...v1.18.0) (2022-06-07) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [1.17.2](https://github.com/SocialGouv/cdtn-admin/compare/v1.17.1...v1.17.2) (2022-06-06) - -**Note:** Version bump only for package @socialgouv/contibutions - -## [1.17.1](https://github.com/SocialGouv/cdtn-admin/compare/v1.17.0...v1.17.1) (2022-06-02) - -**Note:** Version bump only for package @socialgouv/contibutions - -# [1.17.0](https://github.com/SocialGouv/cdtn-admin/compare/v1.16.8...v1.17.0) (2022-06-01) - -### Features - -- migration de l'outil de contrib ([#766](https://github.com/SocialGouv/cdtn-admin/issues/766)) ([3fe04a7](https://github.com/SocialGouv/cdtn-admin/commit/3fe04a7bfb7f58b3a0227a18a1999aebabe109c5)) diff --git a/targets/contributions/Dockerfile b/targets/contributions/Dockerfile deleted file mode 100644 index 146d2280fb..0000000000 --- a/targets/contributions/Dockerfile +++ /dev/null @@ -1,54 +0,0 @@ -ARG NODE_VERSION=14.21.3 - -FROM node:$NODE_VERSION AS deps - -WORKDIR /app - -COPY yarn.lock .yarnrc.yml ./ -COPY .yarn .yarn - -# hadolint ignore=SC2046 -RUN yarn fetch workspaces focus @socialgouv/contibutions - -FROM deps AS build-types -COPY shared/types ./shared/types/ -RUN yarn workspace @shared/types build - -FROM deps AS build-utils -COPY --from=build-types /app/shared/types /app/shared/types -COPY shared/utils ./shared/utils -RUN yarn workspace @shared/utils build - -FROM deps as dist - -COPY --from=build-utils /app/shared/utils /app/shared/utils -COPY targets/contributions ./targets/contributions - -ARG CDTN_API_URL -ENV CDTN_API_URL=$CDTN_API_URL -RUN yarn workspace @socialgouv/contibutions build - -RUN yarn workspaces focus --production @socialgouv/contibutions && yarn cache clean -RUN mkdir -p /app/targets/contributions/node_modules - -FROM node:$NODE_VERSION - -WORKDIR /app - -COPY --from=dist /app/shared/utils/build /app/shared/utils/build -COPY --from=dist /app/shared/utils/package.json /app/shared/utils/package.json -COPY --from=dist /app/targets/contributions/package.json /app/targets/contributions/package.json -COPY --from=dist /app/targets/contributions/next.config.js /app/targets/contributions/next.config.js -COPY --from=dist /app/targets/contributions/public /app/targets/contributions/public -COPY --from=dist /app/targets/contributions/server /app/targets/contributions/server -COPY --from=dist /app/targets/contributions/.next /app/targets/contributions/.next -COPY --from=dist /app/targets/contributions/node_modules /app/targets/contributions/node_modules -COPY --from=dist /app/node_modules /app/node_modules - -USER 1000 - -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 - -WORKDIR /app/targets/contributions -CMD ["yarn","start"] diff --git a/targets/contributions/LICENSE b/targets/contributions/LICENSE deleted file mode 100644 index 32700c5b20..0000000000 --- a/targets/contributions/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2019-present, Fabrique numérique des Ministères Sociaux. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/targets/contributions/jest.config.js b/targets/contributions/jest.config.js deleted file mode 100644 index a8d0c6f41e..0000000000 --- a/targets/contributions/jest.config.js +++ /dev/null @@ -1,18 +0,0 @@ -const pack = require("./package"); - -module.exports = { - bail: 1, - clearMocks: true, - displayName: pack.name, - moduleNameMapper: { - "\\.(jpg|jpeg|png|gif|eot|svg|ttf|woff|woff2)$": - "/packages/app/tests/mappers/fileTransformer.js", - "\\.css$": "identity-obj-proxy", - }, - rootDir: "../..", - roots: [`/packages/app`], - // https://github.com/facebook/create-react-app/issues/2007#issuecomment-296694661 - setupFilesAfterEnv: ["/packages/app/tests/jest.setup.js"], - snapshotSerializers: ["@emotion/jest"], - watchPathIgnorePatterns: ["/packages/app/.next/"], -}; diff --git a/targets/contributions/next.config.js b/targets/contributions/next.config.js deleted file mode 100644 index a64f4f4dc1..0000000000 --- a/targets/contributions/next.config.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports = { - publicRuntimeConfig: { - // Will be available on both server and client - CDTN_API_URL: - process.env.CDTN_API_URL || "https://cdtn-api.fabrique.social.gouv.fr", - API_URL: process.env.API_URL || "http://localhost:8080", - }, - async headers() { - return [ - { - // Apply these headers to all routes in your application. - source: "/:path*", - headers: [ - { - key: "X-Frame-Options", - value: "deny" - }, - { key: "X-XSS-Protection", value: "1; mode=block" }, - { key: "X-Content-Type-Options", value: "nosniff" } - ], - }, - ]; - }, -}; diff --git a/targets/contributions/package.json b/targets/contributions/package.json deleted file mode 100644 index ccd49afbe7..0000000000 --- a/targets/contributions/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "name": "@socialgouv/contibutions", - "description": "Application de contributions aux données du code du travail numérique.", - "version": "2.37.1", - "license": "Apache-2.0", - "private": true, - "scripts": { - "build": "next build", - "build:docker": "node --max-old-space-size=1024 ./node_modules/.bin/next build", - "clean": "rimraf ./.next", - "dev": "nodemon --exec \"node --inspect -r dotenv/config ./server dotenv_config_path=../../.env\" --watch ./server", - "start": "node ./server", - "start:docker": "yarn build:docker && yarn start" - }, - "dependencies": { - "@emotion/babel-plugin": "11.1.2", - "@emotion/react": "11.1.4", - "@emotion/styled": "11.0.0", - "@fortawesome/fontawesome-svg-core": "1.2.32", - "@fortawesome/free-solid-svg-icons": "5.15.1", - "@fortawesome/react-fontawesome": "0.1.14", - "@koa/router": "10.0.0", - "@shared/utils": "workspace:^", - "@urql/core": "^2.4.4", - "axios": "^0.24.0", - "colors": "1.4.0", - "diff": "5.0.0", - "emotion": "11.0.0", - "emotion-server": "11.0.0", - "http-proxy-middleware": "2.0.6", - "isomorphic-unfetch": "3.1.0", - "js-cookie": "3.0.1", - "jsonwebtoken": "8.5.1", - "koa": "2.13.1", - "koa-body": "^5.0.0", - "koa-proxies": "^0.12.2", - "lodash.debounce": "4.0.8", - "moment-timezone": "0.5.35", - "next": "11.1.2", - "next-cookies": "2.0.3", - "next-redux-saga": "4.1.2", - "next-redux-wrapper": "7.0.5", - "numeral": "2.0.6", - "password-generator": "2.3.2", - "pg": "8.5.1", - "postgrester": "1.5.0", - "prop-types": "15.7.2", - "quill": "1.3.7", - "ramda": "0.27.1", - "react": "17.0.2", - "react-diff-viewer": "3.1.1", - "react-dom": "17.0.2", - "react-form": "4.0.1", - "react-medixtor": "0.1.0-alpha.16", - "react-onclickoutside": "6.9.0", - "react-redux": "7.2.2", - "react-select": "3.1.1", - "react-table": "6.11.5", - "react-tag-autocomplete": "6.1.0", - "react-toastify": "6.2.0", - "react-tooltip": "4.2.11", - "rebass": "4.0.7", - "redux": "4.0.5", - "redux-devtools-extension": "2.13.8", - "redux-saga": "1.1.3", - "rehype-parse": "7.0.1", - "rehype-remark": "8.0.0", - "rehype-sanitize": "4.0.0", - "rehype-stringify": "8.0.0", - "remark-parse": "9.0.0", - "remark-rehype": "8.0.0", - "remark-stringify": "9.0.1", - "ua-parser-js": "0.7.33", - "unified": "9.2.0", - "unist-util-find": "1.0.2", - "unist-util-parents": "1.0.3", - "unist-util-remove": "3.0.0" - }, - "devDependencies": { - "@emotion/jest": "11.1.0", - "@socialgouv/kali-data": "2.30.0", - "@socialgouv/legi-data": "2.24.0", - "@testing-library/jest-dom": "5.11.8", - "@testing-library/react": "12.1.2", - "@types/hast": "2.3.1", - "@types/node": "17.0.0", - "@types/ramda": "0.27.34", - "@types/react": "17.0.37", - "@types/react-test-renderer": "17.0.0", - "dotenv": "10.0.0", - "identity-obj-proxy": "3.0.0", - "mutationobserver-shim": "0.3.7", - "nodemon": "2.0.7", - "react-test-renderer": "17.0.1", - "rimraf": "3.0.2", - "waait": "1.0.5", - "zxcvbn": "4.4.2" - } -} diff --git a/targets/contributions/pages/404.js b/targets/contributions/pages/404.js deleted file mode 100644 index 8b69db72d6..0000000000 --- a/targets/contributions/pages/404.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react"; -import css from "styled-jsx/css"; - -import Main from "../src/layouts/Main"; - -const styles = css` - .Container { - align-items: center; - display: flex; - flex-grow: 1; - justify-content: center; - } -`; - -export default function NotFound() { - return ( -
- -
{`Cette page n'existe pas ou plus.`}
-
- ); -} diff --git a/targets/contributions/pages/_app.js b/targets/contributions/pages/_app.js deleted file mode 100644 index 4429dedae0..0000000000 --- a/targets/contributions/pages/_app.js +++ /dev/null @@ -1,48 +0,0 @@ -import App from "next/app"; -import React from "react"; - -import Login from "../src/blocks/Login"; -import cache from "../src/cache"; -import getMe from "../src/libs/getMe"; -import { wrapper } from "../src/store"; - -// https://github.com/zeit/next.js/blob/canary/examples/with-redux-saga/pages/_app.js -class MainApp extends App { - static async getInitialProps({ Component, ctx }) { - const pageProps = Component.getInitialProps ? await Component.getInitialProps({ ctx }) : {}; - pageProps.id = ctx.query.id; - pageProps.me = await getMe(ctx); - - return { pageProps }; - } - - constructor(props) { - super(props); - - const { - pageProps: { me }, - } = props; - - cache.set("me", me); - } - - async login() { - window.location.reload(); - } - - render() { - const me = cache.get("me"); - const { Component, pageProps } = this.props; - const { statusCode } = pageProps; - - const hasError = statusCode !== undefined && statusCode >= 400; - - if (hasError || me.isAuthenticated) { - return ; - } - - return ; - } -} - -export default wrapper.withRedux(MainApp); diff --git a/targets/contributions/pages/_document.js b/targets/contributions/pages/_document.js deleted file mode 100644 index 9bad4669fd..0000000000 --- a/targets/contributions/pages/_document.js +++ /dev/null @@ -1,30 +0,0 @@ -import Document, { Head, Html, Main, NextScript } from "next/document"; -import React from "react"; - -class MyDocument extends Document { - render() { - return ( - - - - {/* - We use this meta to block this website from being referenced in search engines: - DO NOT ADD A "robot.txt"! - https://support.google.com/webmasters/answer/6062608 - */} - - - - - - - -
- - - - ); - } -} - -export default MyDocument; diff --git a/targets/contributions/pages/_error.js b/targets/contributions/pages/_error.js deleted file mode 100644 index 6ffef617be..0000000000 --- a/targets/contributions/pages/_error.js +++ /dev/null @@ -1,45 +0,0 @@ -import React from "react"; -import css from "styled-jsx/css"; - -import Main from "../src/layouts/Main"; - -const styles = css` - .Container { - align-items: center; - display: flex; - flex-grow: 1; - justify-content: center; - } -`; - -function Error({ statusCode }) { - let message; - switch (true) { - case statusCode >= 500: - message = "Une erreur serveur s'est produite."; - break; - - case statusCode === 404: - message = "Cette page n'existe pas ou plus."; - break; - - default: - message = "Une erreur inattendue s'est produite."; - break; - } - - return ( -
- -
{message}
-
- ); -} - -Error.getInitialProps = ({ res, err }) => { - const statusCode = res ? res.statusCode : err ? err.statusCode : 404; - - return { statusCode }; -}; - -export default Error; diff --git a/targets/contributions/pages/admin/agreements/edit.js b/targets/contributions/pages/admin/agreements/edit.js deleted file mode 100644 index 8a183156c6..0000000000 --- a/targets/contributions/pages/admin/agreements/edit.js +++ /dev/null @@ -1,45 +0,0 @@ -import withAdminEdit from "../../../src/templates/withAdminEdit"; - -const componentDidMount = async (api, id) => { - const agreements = await api.fetchAll("/agreements", { id }); - const allAgreements = await api.fetchAll("/agreements"); - - const fields = [ - { - label: "Nom", - name: "name", - type: "input", - }, - { - label: "IDCC", - name: "idcc", - type: "input", - }, - { - label: "Convention parente", - name: "parent_id", - options: allAgreements.map(({ id, idcc, name }) => ({ - label: `${idcc} - ${name}`, - value: id, - })), - type: "select", - }, - ]; - - return { - defaultData: agreements[0], - fields, - }; -}; - -const AdminAgreementsEditPage = withAdminEdit( - { - apiPath: "/agreements", - i18nIsFeminine: true, - i18nSubject: "convention", - indexPath: "/agreements", - }, - componentDidMount -); - -export default AdminAgreementsEditPage; diff --git a/targets/contributions/pages/admin/agreements/index.js b/targets/contributions/pages/admin/agreements/index.js deleted file mode 100644 index a823afb419..0000000000 --- a/targets/contributions/pages/admin/agreements/index.js +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react"; - -import AdminIndex from "../../../src/components/AdminIndex"; -import shortenAgreementName from "../../../src/helpers/shortenAgreementName"; - -const COLUMNS = [ - { - Header: "Nom", - accessor: ({ name }) => shortenAgreementName(name), - id: "name", - }, - { - Header: "IDCC", - accessor: "idcc", - style: { textAlign: "center" }, - width: 64, - }, -]; - -const AdminAgreementIndexPage = () => ( - -); - -export default AdminAgreementIndexPage; diff --git a/targets/contributions/pages/admin/agreements/new.jsx b/targets/contributions/pages/admin/agreements/new.jsx deleted file mode 100644 index 495565f5fd..0000000000 --- a/targets/contributions/pages/admin/agreements/new.jsx +++ /dev/null @@ -1,72 +0,0 @@ -import { useRouter } from "next/router"; -import React from "react"; - -import { addAgreement } from "../../../src/api"; -import AdminForm from "../../../src/components/AdminForm"; -import AdminMain from "../../../src/layouts/AdminMain"; -import toast from "../../../src/libs/toast"; -import { GraphQLApi } from "../../../src/libs/GraphQLApi"; - -export default function AdminNew() { - const [isLoading, setIsLoading] = React.useState(true); - const [fields, setFields] = React.useState([]); - const { back } = useRouter(); - - React.useEffect(() => { - async function init() { - const api = new GraphQLApi(); - const agreements = await api.fetchAll("/agreements"); - const fields = [ - { - label: "Nom", - name: "name", - type: "input", - }, - { - label: "IDCC", - name: "idcc", - type: "input", - }, - { - label: "Convention parente", - name: "parent_id", - options: agreements.map(({ id, idcc, name }) => ({ - label: `${idcc} - ${name}`, - value: id, - })), - type: "select", - }, - ]; - setFields(fields); - setIsLoading(false); - } - - init(); - }, []); - - const onSubmit = async (data) => { - try { - await addAgreement(data.name, data.idcc, data.parent_id); - back(); - } catch (e) { - toast.error(e.message); - } - }; - - return ( - <> - {isLoading ? ( - - ) : ( - - )} - - ); -} diff --git a/targets/contributions/pages/admin/answers-references/index.js b/targets/contributions/pages/admin/answers-references/index.js deleted file mode 100644 index 2af9e1e968..0000000000 --- a/targets/contributions/pages/admin/answers-references/index.js +++ /dev/null @@ -1,217 +0,0 @@ -import styled from "@emotion/styled"; -import debounce from "lodash.debounce"; -import React from "react"; -import { connect } from "react-redux"; -import { Flex } from "rebass"; - -import * as actions from "../../../src/actions"; -import LegalReferenceTag from "../../../src/components/LegalReferences/Tag"; -import Pagination from "../../../src/components/Pagination"; -import * as C from "../../../src/constants"; -import Button from "../../../src/elements/Button"; -import Idcc from "../../../src/elements/Idcc"; -import Input from "../../../src/elements/Input"; -import LoadingSpinner from "../../../src/elements/LoadingSpinner"; -import Select from "../../../src/elements/Select"; -import Title from "../../../src/elements/Title"; -import AdminMainLayout from "../../../src/layouts/AdminMain"; -import customNumeral from "../../../src/libs/customNumeral"; -import T from "../../../src/texts"; - -const Container = styled(Flex)` - flex-grow: 1; - margin: 0 1rem 1rem; -`; - -const FiltersContainer = styled(Flex)` - border-bottom: solid 1px var(--color-border); - padding: 0.5rem 0; - - > * { - flex-grow: 0.25; - } -`; -const InfoContainer = styled(Flex)` - background-color: var(--color-alice-blue); - border-bottom: solid 1px var(--color-border); - padding: 0.5rem 1rem; -`; - -const List = styled(Flex)` - flex-grow: 1; - padding-right: 0.5rem; - min-height: 0; - overflow-y: auto; -`; -const ListRow = styled(Flex)` - background-color: white; - border: solid 1px var(--color-border); - border-radius: 0.4rem; - margin-top: 0.5rem; - padding: 0 0.75rem 0.5rem; -`; -export const OpenButton = styled(Button)` - font-size: 0.875rem; - - padding: 0.325rem 0.375rem 0.375rem 0.5rem; -`; - -export class AdminAnswersReferencesIndexPage extends React.Component { - get queryFilter() { - return this.$queryFilter !== undefined && this.$queryFilter !== null - ? this.$queryFilter.value - : ""; - } - - constructor(props) { - super(props); - - this.setCategoryFilter = this.setCategoryFilter.bind(this); - this.setPageIndex = this.setPageIndex.bind(this); - this.setQueryFilter = debounce(this.setQueryFilter, 250).bind(this); - this.setStatesFilter = this.setStatesFilter.bind(this); - } - - componentDidMount() { - this.props.dispatch(actions.answersReferences.setFilter("pageLength", 10)); - } - - open(answerId) { - window.open(`/admin/answers/${answerId}`, "_blank"); - } - - setPageIndex(pageIndex) { - const { answersReferences, dispatch } = this.props; - if (answersReferences.isLoading) return; - - dispatch(actions.answersReferences.load(pageIndex)); - } - - setQueryFilter() { - this.props.dispatch(actions.answersReferences.setFilter("query", this.queryFilter)); - } - - setCategoryFilter(selectedOption) { - this.props.dispatch(actions.answersReferences.setFilter("category", selectedOption.value)); - } - - setStatesFilter(_selectedOptions) { - const selectedOptions = _selectedOptions ?? []; - const nextStates = selectedOptions.map(({ value }) => value); - - this.props.dispatch(actions.answersReferences.setFilter("states", nextStates)); - } - - getSelectedCategoryOption() { - const { - answersReferences: { - filters: { category }, - }, - } = this.props; - - return C.ANSWER_REFERENCE_CATEGORY_OPTIONS.find(({ value }) => category.includes(value)); - } - - getSelectedStatesOptions() { - const { - answersReferences: { - filters: { states }, - }, - } = this.props; - - return C.ANSWER_REFERENCE_STATE_OPTIONS.filter(({ value }) => states.includes(value)); - } - - renderAnswerReferencesList() { - const { answers, list, isLoading } = this.props.answersReferences; - - if (list.length === 0) { - return ( - - {isLoading ? : T.ADMIN_ANSWERS_INFO_NO_DATA} - - ); - } - - return ( - - {list.map(answerReference => { - const answer = answers.find(({ id }) => id === answerReference.answer_id); - - return ( - - {answer.agreement !== undefined ? ( - - ) : ( - - )} - - - this.open(answerReference.answer_id)} - /> - - ); - })} - - ); - } - - render() { - const { answersReferences } = this.props; - - return ( - - - - Références légales - - - - (this.$queryFilter = node)} - /> - - - - - {`${customNumeral(answersReferences.length).format("0,0")} résultats.`} - - - {this.renderAnswerReferencesList()} - - - - - ); - } -} - -export default connect(({ answersReferences }) => ({ - answersReferences, -}))(AdminAnswersReferencesIndexPage); diff --git a/targets/contributions/pages/admin/answers/edit.js b/targets/contributions/pages/admin/answers/edit.js deleted file mode 100644 index 998a1721b9..0000000000 --- a/targets/contributions/pages/admin/answers/edit.js +++ /dev/null @@ -1,741 +0,0 @@ -import styled from "@emotion/styled"; -import debounce from "lodash.debounce"; -import React from "react"; -import { connect } from "react-redux"; -import { Flex } from "rebass"; - -import * as actions from "../../../src/actions"; -import Comment from "../../../src/components/Comment"; -import LegalReferences from "../../../src/components/LegalReferences"; -import * as C from "../../../src/constants"; -import Button from "../../../src/elements/Button"; -import Hr from "../../../src/elements/Hr"; -import Icon from "../../../src/elements/Icon"; -import Idcc from "../../../src/elements/Idcc"; -import Input from "../../../src/elements/Input"; -import LoadingSpinner from "../../../src/elements/LoadingSpinner"; -import MarkdownEditor from "../../../src/elements/MarkdownEditor"; -import Radio from "../../../src/elements/Radio"; -import Select from "../../../src/elements/Select"; -import Subtitle from "../../../src/elements/Subtitle"; -import Textarea from "../../../src/elements/Textarea"; -import AdminMainLayout from "../../../src/layouts/AdminMain"; -import { api } from "../../../src/libs/GraphQLApi"; -import T from "../../../src/texts"; -import { - createAnswerReference, - deleteAnswerReference, - updateAnswersStates, -} from "../../../src/libs/graphql"; - -const Container = styled(Flex)` - height: 100%; -`; -const Content = styled(Flex)` - flex-grow: 1; - overflow-y: scroll; - padding: 1rem; -`; -const Sidebar = styled(Flex)` - display: ${({ isHidden }) => (isHidden ? "none" : "flex")}; - padding: 1rem; - position: relative; - right: 0; - min-width: 23rem; -`; - -const Question = styled(Subtitle)` - margin: 0; - user-select: text; -`; - -const Loaditor = styled(Flex)` - min-height: 30rem; -`; -const Preditor = styled(MarkdownEditor)` - border-right: 0 !important; - min-height: 30rem; - - .editor { - background-color: rgba(0, 0, 0, 0.025); - border: 0 !important; - cursor: text; - } - .editor-status { - display: none; - } - - .preview { - background-color: rgba(0, 0, 0, 0.025); - } -`; -const Editor = styled(MarkdownEditor)` - min-height: 30rem; - - .editor { - border: 0 !important; - } -`; -const Strong = styled.p` - font-weight: 600; - margin: ${(props) => (props.isFirst ? "0 0 0.5rem" : "1rem 0 0.5rem")}; -`; -const Form = styled.form` - display: flex; - flex-direction: column; -`; -const FormHiddenSubmit = styled.button` - height: 1px; - visibility: hidden; - width: 1px; -`; - -const Comments = styled(Flex)` - flex-grow: 1; - margin-top: 0.5rem; - max-height: 100%; - overflow-y: auto; -`; -const CommentEditor = styled(Textarea)` - background: ${({ isPrivate }) => - !isPrivate - ? "white" - : `repeating-linear-gradient( - 45deg, - #f4f4f4, - #f4f4f4 10px, - #ffffff 10px, - #ffffff 20px - )`}; - border-radius: 0.25rem; - font-size: 0.75rem; - opacity: ${(props) => (props.disabled ? 0.25 : 1)}; - margin-top: 1rem; - max-height: 10rem; - padding: 0.5rem; - width: 100%; -`; -const CommentEditorIcon = styled(Icon)` - align-self: flex-end; - cursor: pointer; - margin-top: 0.25rem; - opacity: 0.25; - - :hover { - opacity: 0.5; - } -`; - -export class AdminAnwsersEditPage extends React.Component { - constructor(props) { - super(props); - - this.state = { - agreementReferenceValueInputKey: 0, - isFirstLoad: true, - isSidebarHidden: true, - otherReferenceUrlInputKey: 0, - otherReferenceValueInputKey: 2, - selectedAgreementIdcc: null, - }; - - this.isGeneric = Boolean(props.isGeneric); - this.originalPrevalue = ""; - this.originalValue = ""; - - this.updateAnswerValue = debounce(this._updateAnswerValue.bind(this), 500); - this.loadLegalReferences = debounce( - this.loadLegalReferences.bind(this), - 250 - ); - } - - componentDidMount() { - const { dispatch, id: answerId } = this.props; - - dispatch(actions.answers.loadOne(answerId)); - dispatch(actions.comments.load(answerId)); - } - - componentDidUpdate() { - const { answers, comments } = this.props; - const { isFirstLoad } = this.state; - - if (isFirstLoad && !answers.isLoading) { - const { prevalue, value } = answers.data; - this.originalPrevalue = prevalue; - this.originalValue = value; - - this.setState({ - isFirstLoad: false, - selectedAgreementIdcc: !this.isGeneric - ? answers.data.agreement.idcc - : null, - }); - } - - if (!answers.isLoading && !comments.isLoading) { - this.$commentsContainer.scrollTo(0, this.$commentsContainer.scrollHeight); - } - } - - load() { - const { dispatch, id: answerId } = this.props; - - dispatch(actions.answers.loadOne(answerId)); - dispatch(actions.comments.load(answerId)); - } - - getReferences(category) { - const { answers } = this.props; - - if (answers.isLoading) { - return []; - } - - return answers.data.references.filter( - (reference) => reference.category === category - ); - } - - async _updateAnswerValue({ source }) { - try { - const value = source.trim(); - const { state } = this.props.answers.data; - const data = { value }; - - // An answer can't have a "to do" state with a non-empty value: - if (state === C.ANSWER_STATE.TO_DO && value.length > 0) { - data.state = C.ANSWER_STATE.UNDER_REVIEW; - } - - await api.update(updateAnswersStates, { data, ids: [this.props.id] }); - } catch (err) { - console.warn(err); - } - } - - updateAnswerState({ value }) { - const { id } = this.props; - - this.props.dispatch( - actions.answers.updateState([id], value, () => window.location.reload()) - ); - } - - updateGenericReference(generic_reference) { - const { dispatch, id } = this.props; - - dispatch( - actions.answers.updateGenericReference( - [id], - generic_reference, - this.load.bind(this) - ) - ); - } - - async createReference(reference) { - try { - const { state } = this.props.answers.data; - - // An answer can't have a reference and be generic at the same time: - const answersData = { - generic_reference: null, - }; - - // An answer can't have a "to do" state with a reference: - if (state === C.ANSWER_STATE.TO_DO) { - answersData.state = C.ANSWER_STATE.UNDER_REVIEW; - } - - const answersReferencesData = { - answer_id: this.props.id, - ...reference, - }; - - await api.update(updateAnswersStates, { - data: answersData, - ids: [this.props.id], - }); - await api.create(createAnswerReference, answersReferencesData); - } catch (err) { - console.warn(err); - } - - await this.load(); - } - - async deleteReference(id) { - try { - await api.delete(deleteAnswerReference, { ids: [id] }); - } catch (err) { - console.warn(err); - } - - await this.load(); - } - - submitReference(event, category = null) { - event.preventDefault(); - - let reference; - if (category === "agreement") { - reference = { - category, - value: this.$agreementReferenceValueInput.value.trim(), - }; - } else { - const url = this.$otherReferenceUrlInput.value.trim(); - reference = { - category, - url: url.length !== 0 ? url : null, - value: this.$otherReferenceValueInput.value.trim(), - }; - - this.setState({ - otherReferenceUrlInputKey: this.state.otherReferenceUrlInputKey + 1, - otherReferenceValueInputKey: this.state.otherReferenceValueInputKey + 1, - }); - } - - this.createReference(reference); - } - - toggleSidebar() { - this.setState({ isSidebarHidden: !this.state.isSidebarHidden }); - } - - handleCommentField(event) { - if (event.which !== 13) return; - - if (event.shiftKey) { - event.preventDefault(); - this.props.dispatch(actions.comments.toggleOnePrivacy()); - - return; - } - - const value = this.$commentTextarea.value.trim(); - if (value.length === 0) return; - - if (event.ctrlKey) { - this.props.dispatch( - actions.comments.addOne( - value, - this.props.comments.currentIsPrivate, - this.props.id - ) - ); - } - } - - removeComment(id) { - this.props.dispatch(actions.comments._delete([id], this.props.id)); - } - - loadLegalReferences(category, query) { - const { dispatch, legalReferences } = this.props; - const { selectedAgreementIdcc } = this.state; - if (legalReferences.isLoading) return; - - if (category === C.LEGAL_REFERENCE_CATEGORY.AGREEMENT) { - dispatch( - actions.legalReferences.load(category, query, selectedAgreementIdcc) - ); - - return; - } - - dispatch(actions.legalReferences.load(category, query)); - } - - async addReference(category, legalReference) { - const { dispatch, id: answer_id } = this.props; - - const answerReference = { - answer_id, - category, - dila_cid: legalReference.cid, - dila_container_id: legalReference.containerId, - dila_id: legalReference.id, - value: legalReference.name, - }; - - dispatch( - actions.answers.addReferences([answerReference], this.load.bind(this)) - ); - } - - updateReference(data) { - const { dispatch } = this.props; - - dispatch(actions.answers.updateReferences([data], this.load.bind(this))); - } - - removeReference(answerReferenceId) { - const { dispatch } = this.props; - - dispatch( - actions.answers.removeReferences( - [answerReferenceId], - this.load.bind(this) - ) - ); - } - - renderTop() { - const { answers, comments } = this.props; - const { isFirstLoad } = this.state; - - const stateActionDefaultValue = !isFirstLoad - ? C.ANSWER_STATE_OPTIONS.find(({ value }) => value === answers.data.state) - : undefined; - - return ( - - (this.$otherReferenceValueInput = node)} - /> - (this.$otherReferenceUrlInput = node)} - style={{ marginTop: "0.5rem" }} - /> - - - )} - this.addReference(null, data)} - onChange={this.updateReference.bind(this)} - onRemove={this.removeReference.bind(this)} - references={this.getReferences(null)} - /> - - - ); - } - - renderGenericReference() { - const { answers } = this.props; - const { isFirstLoad } = this.state; - - if (isFirstLoad) { - return null; - } - - const { data, isLoading } = answers; - const { state, generic_reference } = data; - - if ( - [C.ANSWER_STATE.VALIDATED, C.ANSWER_STATE.PUBLISHED].includes(state) && - generic_reference === null - ) { - return null; - } - - return ( -
-
- Renvoi - {![C.ANSWER_STATE.VALIDATED, C.ANSWER_STATE.PUBLISHED].includes( - state - ) && ( - - )} -
- ); - } - - renderSidebar() { - const { comments } = this.props; - - const { isSidebarHidden } = this.state; - - return ( - - Commentaires - (this.$commentsContainer = node)} - > - {this.renderComments()} - - - (this.$commentTextarea = node)} - rows={10} - /> - - this.props.dispatch(actions.comments.toggleOnePrivacy()) - } - /> - - - ); - } - - renderComments() { - const { comments } = this.props; - - return comments.list.map(({ id, is_private, value }, index) => ( - this.removeComment(id)} - value={value} - /> - )); - } - - render() { - return ( - - - - {this.renderTop()} -
- {this.renderHead()} -
- - {this.renderEditor()} -
- - {this.renderReferences()} - - {this.renderGenericReference()} -
- - {this.renderSidebar()} -
-
- ); - } -} - -export default connect(({ answers, comments, legalReferences }) => ({ - answers, - comments, - legalReferences, -}))(AdminAnwsersEditPage); diff --git a/targets/contributions/pages/admin/answers/index.js b/targets/contributions/pages/admin/answers/index.js deleted file mode 100644 index 415ee6ae6f..0000000000 --- a/targets/contributions/pages/admin/answers/index.js +++ /dev/null @@ -1,287 +0,0 @@ -import styled from "@emotion/styled"; -import debounce from "lodash.debounce"; -import Router from "next/router"; -import React from "react"; -import { connect } from "react-redux"; -import { Flex } from "rebass"; - -import * as actions from "../../../src/actions"; -import Answer from "../../../src/components/Answer"; -import Pagination from "../../../src/components/Pagination"; -import * as C from "../../../src/constants"; -import Button from "../../../src/elements/Button"; -import Checkbox from "../../../src/elements/Checkbox"; -import Input from "../../../src/elements/Input"; -import LoadingSpinner from "../../../src/elements/LoadingSpinner"; -import Select from "../../../src/elements/Select"; -import Title from "../../../src/elements/Title"; -import AdminMainLayout from "../../../src/layouts/AdminMain"; -import T from "../../../src/texts"; - -const Container = styled(Flex)` - flex-grow: 1; - margin: 0 1rem 1rem; -`; - -const List = styled(Flex)` - flex-grow: 1; - padding-right: 1rem; - min-height: 0; - overflow-y: auto; -`; - -const FiltersContainer = styled(Flex)` - border-bottom: solid 1px var(--color-border); - padding: 0.5rem 0; - - > * { - flex-grow: 0.25; - } -`; - -const ActionsContainer = styled(Flex)` - background-color: var(--color-alice-blue); - border-bottom: solid 1px var(--color-border); - padding: 0.5rem 0.5rem 0.5rem 1rem; -`; - -export class AdminAnswersIndexPage extends React.Component { - get queryFilter() { - return this.$queryFilter !== undefined && this.$queryFilter !== null - ? this.$queryFilter.value - : ""; - } - - constructor(props) { - super(props); - - this.setPageIndex = this.setPageIndex.bind(this); - this.setQueryFilter = debounce(this.setQueryFilter, 250).bind(this); - } - - componentDidMount() { - const { isGeneric } = this.props; - - this.props.dispatch(actions.agreements.load()); - this.props.dispatch(actions.questions.load()); - this.props.dispatch( - actions.answers.setFilters({ - isGeneric, - }), - ); - } - - getCheckableAnswerIds() { - const { answers } = this.props; - - return answers.list.map(({ id }) => id).filter(id => !answers.checked.includes(id)); - } - - setAgreeementsFilter(selected) { - const agreements = selected !== null ? selected : []; - this.props.dispatch(actions.answers.setFilter("agreements", agreements)); - } - - setPageIndex(pageIndex) { - const { answers, dispatch } = this.props; - if (answers.isLoading) return; - - dispatch(actions.answers.load(pageIndex)); - } - - setQuestionsFilter(selected) { - const questions = selected !== null ? selected : []; - this.props.dispatch(actions.answers.setFilter("questions", questions)); - } - - setQueryFilter() { - this.props.dispatch(actions.answers.setFilter("query", this.queryFilter)); - } - - setStatesFilter(selected) { - const states = selected !== null ? selected : []; - this.props.dispatch(actions.answers.setFilter("states", states)); - } - - check(id) { - this.props.dispatch(actions.answers.toggleCheck([id])); - } - - checkAll() { - const { dispatch } = this.props; - const ids = this.getCheckableAnswerIds(); - - dispatch(actions.answers.toggleCheck(ids)); - } - - uncheckAll() { - const { dispatch, answers } = this.props; - - dispatch(actions.answers.toggleCheck(answers.checked)); - } - - setCheckedAnswersState() { - const { checked } = this.props.answers; - const { value } = this.$newState.state.value; - - this.props.dispatch( - actions.answers.updateState(checked, value, () => - this.props.dispatch(actions.answers.load()), - ), - ); - } - - printAnswers() { - const { isGeneric } = this.props; - const path = isGeneric ? "generic-answers" : "answers"; - - window.open(`/admin/${path}/print`, "_blank"); - } - - editAnswer(id) { - const path = this.props.isGeneric ? "generic-answers" : "answers"; - - if (process.env.NODE_ENV !== "development") { - window.open(`/admin/${path}/${id}`, "_blank"); - - return; - } - - Router.push(`/admin/${path}/${id}`); - } - - renderAnswersList() { - const { checked, list, isLoading } = this.props.answers; - - if (list.length === 0) { - return ( - - {isLoading ? : T.ADMIN_ANSWERS_INFO_NO_DATA} - - ); - } - - return ( - - {list.map(answer => ( - - ))} - - ); - } - - render() { - const { agreements, answers, isGeneric, questions } = this.props; - - const isLoading = isGeneric - ? answers.isLoading - : agreements.isLoading || answers.isLoading || questions.isLoading; - const stateFilterAgreements = agreements.list.map(({ id, idcc, name }) => ({ - label: `[${idcc}] ${name}`, - value: id, - })); - const stateFilterQuestions = questions.list.map(({ id, index, value }) => ({ - label: `${index}) ${value}`, - value: id, - })); - - return ( - - - - {`Réponses${isGeneric ? " génériques" : ""}`} - - - - - {/* Filters */} - {!isGeneric && ( - - (this.$queryFilter = node)} - /> - - (this.$newState = node)} - /> - - - - - {this.renderAnswersList()} - - - - - ); - } -} - -export default connect(({ agreements, answers, questions }) => ({ - agreements, - answers, - isGeneric: false, - questions, -}))(AdminAnswersIndexPage); diff --git a/targets/contributions/pages/admin/answers/print.js b/targets/contributions/pages/admin/answers/print.js deleted file mode 100644 index 835bc57eff..0000000000 --- a/targets/contributions/pages/admin/answers/print.js +++ /dev/null @@ -1,95 +0,0 @@ -import styled from "@emotion/styled"; -import React from "react"; -import { connect } from "react-redux"; - -import * as actions from "../../../src/actions"; -import markdown from "../../../src/libs/markdown"; - -const Container = styled.div` - height: 100vh; - overflow-y: auto; - padding: 1rem; - - @media print { - height: auto; - padding: 0; - } -`; - -const Answer = styled.div` - @media print { - page-break-inside: avoid; - } -`; -const Content = styled.p` - font-size: 1.1rem; - margin-bottom: 1rem; - white-space: normal; -`; -const List = styled.ul` - font-size: 0.875rem; - list-style-type: square; - padding-inline-start: 0; - padding-left: 1.5rem; -`; - -export class AdminAnswersPrintPage extends React.Component { - componentDidMount() { - const { isGeneric } = this.props; - - this.props.dispatch( - actions.answers.setFilters({ - isGeneric, - pageLength: 100, - }), - ); - } - - componentDidUpdate() { - const { isLoading } = this.props.answers; - - if (!isLoading) window.print(); - } - - renderValue(value) { - return { __html: markdown.toHtml(value) }; - } - - renderAnswers() { - const { list } = this.props.answers; - - return list.map(({ agreement_idcc, id, question_index, question_value, references, value }) => ( - -

{`[IDCC: ${agreement_idcc}] ${question_index}) ${question_value}`}

-

Réponse corrigée:

- - {references.length !== 0 && ( -
-

Références:

- - {references.map(({ id, value }) => ( -
  • {value}
  • - ))} -
    -
    - )} -
    -
    - )); - } - - render() { - const { isLoading } = this.props.answers; - - if (isLoading) { - return Chargement…; - } - - return {this.renderAnswers()}; - } -} - -export default connect(({ answers }) => ({ - answers, - isGeneric: false, -}))(AdminAnswersPrintPage); diff --git a/targets/contributions/pages/admin/generic-answers/edit.js b/targets/contributions/pages/admin/generic-answers/edit.js deleted file mode 100644 index e4914b4d5b..0000000000 --- a/targets/contributions/pages/admin/generic-answers/edit.js +++ /dev/null @@ -1,12 +0,0 @@ -import { connect } from "react-redux"; - -import { AdminAnwsersEditPage } from "../answers/edit"; - -class AdminGenericAnwsersEditPage extends AdminAnwsersEditPage {} - -export default connect(({ answers, comments, legalReferences }) => ({ - answers, - comments, - isGeneric: true, - legalReferences, -}))(AdminGenericAnwsersEditPage); diff --git a/targets/contributions/pages/admin/generic-answers/index.js b/targets/contributions/pages/admin/generic-answers/index.js deleted file mode 100644 index 66cb14ef1a..0000000000 --- a/targets/contributions/pages/admin/generic-answers/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import { connect } from "react-redux"; - -import { AdminAnswersIndexPage } from "../answers/index"; - -class AdminGenericAnswersIndexPage extends AdminAnswersIndexPage {} - -export default connect(({ agreements, answers, questions }) => ({ - agreements, - answers, - isGeneric: true, - questions, -}))(AdminGenericAnswersIndexPage); diff --git a/targets/contributions/pages/admin/generic-answers/print.js b/targets/contributions/pages/admin/generic-answers/print.js deleted file mode 100644 index 4ea82f75fd..0000000000 --- a/targets/contributions/pages/admin/generic-answers/print.js +++ /dev/null @@ -1,10 +0,0 @@ -import { connect } from "react-redux"; - -import { AdminAnswersPrintPage } from "../answers/print"; - -class AdminGenericAnswersPrintPage extends AdminAnswersPrintPage {} - -export default connect(({ answers }) => ({ - answers, - isGeneric: true, -}))(AdminGenericAnswersPrintPage); diff --git a/targets/contributions/pages/admin/index.js b/targets/contributions/pages/admin/index.js deleted file mode 100644 index cc44b3a748..0000000000 --- a/targets/contributions/pages/admin/index.js +++ /dev/null @@ -1,354 +0,0 @@ -import styled from "@emotion/styled"; -import React from "react"; -import { Flex } from "rebass"; - -import { ANSWER_STATE } from "../../src/constants"; -import Button from "../../src/elements/Button"; -import ContentTitle from "../../src/elements/ContentTitle"; -import Subtitle from "../../src/elements/Subtitle"; -import _Table from "../../src/elements/Table"; -import Title from "../../src/elements/Title"; -import shortenAgreementName from "../../src/helpers/shortenAgreementName"; -import AdminMainLayout from "../../src/layouts/AdminMain"; -import numeral from "../../src/libs/customNumeral"; -import { GraphQLApi } from "../../src/libs/GraphQLApi"; -import { getAnswerStats, getLocationStats } from "../../src/libs/graphql"; - -// TODO Clean these columns. -/* eslint-disable react/display-name */ -const COLUMNS = [ - { - Cell: ({ value }) => {value}, - Header: "Nom", - accessor: "name", - }, - { - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0,0")), - Header: "À rédiger", - accessor: "todo", - }, - { - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0,0")), - Header: "En cours de rédaction", - accessor: "draft", - }, - { - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0,0")), - Header: "À valider", - accessor: "pendingReview", - }, - { - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0,0")), - Header: "En cours de validation", - accessor: "underReview", - }, - { - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0,0")), - Header: "Validées", - accessor: "validated", - }, - { - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0,0")), - Header: "Publiées", - accessor: "published", - }, -]; -const PERCENTAGE_COLUMNS = [ - { ...COLUMNS[0] }, - { - ...COLUMNS[1], - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0.00%")), - }, - { - ...COLUMNS[2], - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0.00%")), - }, - { - ...COLUMNS[3], - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0.00%")), - }, - { - ...COLUMNS[4], - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0.00%")), - }, - { - ...COLUMNS[5], - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0.00%")), - }, - { - ...COLUMNS[6], - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0.00%")), - }, -]; -/* eslint-enable react/display-name */ - -const Container = styled(Flex)` - margin: 0 1rem 1rem; -`; -const Table = styled(_Table)` - font-size: 0.875rem; - - .rt-tr > .rt-th, - .rt-tr > .rt-td { - :first-of-type { - width: 30% !important; - } - :not(:first-of-type) { - width: 10% !important; - } - } - - .rt-tr > .rt-td { - :first-of-type { - cursor: help; - } - :not(:first-of-type) { - text-align: right; - } - } -`; - -const REFRESH_DELAY = 30000; - -const StatsTable = ({ data, isPercentage, ...props }) => ( - -); - -export default class AdminIndexPage extends React.Component { - constructor(props) { - super(props); - - this.state = { - agreementsStats: [], - globalStats: [], - isCalculating: true, - isLoading: true, - isPercentage: true, - }; - } - - async componentDidMount() { - this.isUmounted = false; - this.api = new GraphQLApi(); - - await this.initializeStats(); - await this.updateStats(); - } - - componentWillUnmount() { - this.isUmounted = true; - - if (this.timeout === undefined) { - return; - } - - clearTimeout(this.timeout); - } - - async fetchLocations() { - const data = await this.api.fetch(getLocationStats); - return data.map((item) => ({ - ...item, - agreements: item.agreements.map((element) => ({ ...element.agreement })), - })); - } - - async fetchAnswersForAgreement(agreementId) { - const answers = await this.api.fetch(getAnswerStats, { - agreement_id: agreementId, - }); - return answers; - } - - async initializeStats() { - const locations = await this.fetchLocations(); - - const agreementsStats = locations - .reduce((prev, { agreements }) => [...prev, ...agreements], []) - .map(({ id, idcc, name, parent_id }) => ({ - id, - isNational: parent_id === null, - name: `[${idcc}] ${shortenAgreementName(name)}`, - totals: [0, 0, 0, 0, 0, 0, 0], - })); - - this.setState({ - agreementsStats, - isLoading: false, - }); - } - - async updateStats() { - const { agreementsStats } = this.state; - - const nextAgreementsStats = []; - for (const agreementStatsEntry of agreementsStats) { - if (this.isUmounted) { - break; - } - - const { id: agreementId } = agreementStatsEntry; - const answers = await this.fetchAnswersForAgreement(agreementId); - - const totals = answers.reduce( - (totals, { state }) => { - switch (state) { - case ANSWER_STATE.TO_DO: - totals[0] += 1; - break; - - case ANSWER_STATE.DRAFT: - totals[1] += 1; - break; - - case ANSWER_STATE.PENDING_REVIEW: - totals[2] += 1; - break; - - case ANSWER_STATE.UNDER_REVIEW: - totals[3] += 1; - break; - - case ANSWER_STATE.VALIDATED: - totals[4] += 1; - break; - - case ANSWER_STATE.PUBLISHED: - totals[5] += 1; - break; - } - - totals[6] += 1; - - return totals; - }, - [0, 0, 0, 0, 0, 0, 0] - ); - - nextAgreementsStats.push({ - ...agreementStatsEntry, - totals, - }); - } - - const nextGlobalStats = nextAgreementsStats.reduce( - (globalTotals, { totals }) => [ - globalTotals[0] + totals[0], - globalTotals[1] + totals[1], - globalTotals[2] + totals[2], - globalTotals[3] + totals[3], - globalTotals[4] + totals[4], - globalTotals[5] + totals[5], - globalTotals[6] + totals[6], - ], - [0, 0, 0, 0, 0, 0, 0] - ); - - if (this.isUmounted) { - return; - } - - this.setState({ - agreementsStats: nextAgreementsStats, - globalStats: nextGlobalStats, - isCalculating: false, - }); - - this.timeout = setTimeout(this.updateStats.bind(this), REFRESH_DELAY); - } - - generateDataRow(name, stats, isCalculating) { - const { isPercentage } = this.state; - - if (isCalculating) { - return { - draft: -1, - name, - pendingReview: -1, - published: -1, - todo: -1, - underReview: -1, - validated: -1, - }; - } - - return { - draft: isPercentage ? stats[1] / stats[6] : stats[1], - name, - pendingReview: isPercentage ? stats[2] / stats[6] : stats[2], - published: isPercentage ? stats[5] / stats[6] : stats[5], - todo: isPercentage ? stats[0] / stats[6] : stats[0], - underReview: isPercentage ? stats[3] / stats[6] : stats[3], - validated: isPercentage ? stats[4] / stats[6] : stats[4], - }; - } - - renderGlobalStats() { - const { globalStats, isCalculating, isPercentage } = this.state; - const data = [this.generateDataRow("Total", globalStats, isCalculating)]; - - return ( - - ); - } - - renderAgreementsStats(isNational = false) { - const { agreementsStats, isCalculating, isPercentage } = this.state; - const data = agreementsStats - .filter((agreement) => agreement.isNational === isNational) - .map(({ name, totals }) => - this.generateDataRow(name, totals, isCalculating) - ); - - return ( - - ); - } - - render() { - const { isLoading, isPercentage } = this.state; - - return ( - - - - Tableau de bord - - - - Global - {isLoading ?

    Calcul en cours…

    : this.renderGlobalStats()} - - Par convention collective - Conventions nationales - {isLoading ? ( -

    Calcul en cours…

    - ) : ( - this.renderAgreementsStats(true) - )} - Conventions locales - {isLoading ?

    Calcul en cours…

    : this.renderAgreementsStats()} -
    -
    - ); - } -} diff --git a/targets/contributions/pages/admin/legacy-tracker/agreement.js b/targets/contributions/pages/admin/legacy-tracker/agreement.js deleted file mode 100644 index dc0b330438..0000000000 --- a/targets/contributions/pages/admin/legacy-tracker/agreement.js +++ /dev/null @@ -1,174 +0,0 @@ -import styled from "@emotion/styled"; -import React from "react"; -import { Flex } from "rebass"; - -import LegalReferenceTag from "../../../src/components/LegalReferences/Tag"; -import * as C from "../../../src/constants"; -import Button from "../../../src/elements/Button"; -import Idcc from "../../../src/elements/Idcc"; -import LoadingSpinner from "../../../src/elements/LoadingSpinner"; -import Title from "../../../src/elements/Title"; -import shortenAgreementName from "../../../src/helpers/shortenAgreementName"; -import AdminMainLayout from "../../../src/layouts/AdminMain"; -import cdtnApi from "../../../src/libs/cdtnApi"; -import customPostgrester from "../../../src/libs/customPostgrester"; -import T from "../../../src/texts"; - -const Container = styled(Flex)` - margin: 0 1rem 1rem; -`; - -const List = styled(Flex)` - flex-grow: 1; - padding-right: 0.5rem; - min-height: 0; - overflow-y: auto; -`; -const ListRow = styled(Flex)` - background-color: white; - border: solid 1px var(--color-border); - border-radius: 0.4rem; - margin-top: 0.5rem; - padding: 0 0.75rem 0.5rem; -`; -export const OpenButton = styled(Button)` - font-size: 0.875rem; - - padding: 0.325rem 0.375rem 0.375rem 0.5rem; -`; - -class AdminTrackerAgreementIdPage extends React.Component { - constructor(props) { - super(props); - - this.state = { - agreement: null, - answers: [], - answersReferences: [], - isLoading: true, - }; - } - - async componentDidMount() { - this.postgrest = customPostgrester(); - - const { id: agreementId } = this.props; - const { data: agreements } = await this.postgrest.eq("id", agreementId).get("/agreements"); - const agreement = agreements[0]; - - this.setState({ agreement }); - - const { data: answers } = await this.postgrest - .select("*") - .select("question(index)") - .eq("agreement_id", agreementId) - .orderBy("question.index") - .get("/answers"); - - this.setState({ answers }); - - const answerIds = answers.map(({ id }) => id); - - const { data: answersReferences } = await this.postgrest - .in("answer_id", answerIds) - .get("/answers_references"); - - this.setState({ - answersReferences, - isLoading: false, - }); - } - - async fetchAnswersForAgreement(agreementId) { - const { data: answers } = await this.postgrest.eq("agreement_id", agreementId).get("/answers"); - - return answers; - } - - async findObsoleteAnswersReferences(answersReferences) { - // TODO Remove `dila_cid !== null` check once all the references are cleaned. - const localAgreementAnswersReferences = answersReferences.filter( - ({ category, dila_cid }) => - category === C.ANSWER_REFERENCE_CATEGORY.AGREEMENT && dila_cid !== null, - ); - - const obsoleteAgreementAnswersReference = []; - for (const localAgreementAnswerReference of localAgreementAnswersReferences) { - try { - const { dila_id } = localAgreementAnswerReference; - await cdtnApi.get(`/agreement/articles?articleIdsOrCids=${dila_id}`); - } catch (err) { - obsoleteAgreementAnswersReference.push(localAgreementAnswerReference); - } - } - - return [...obsoleteAgreementAnswersReference]; - } - - open(answerId) { - window.open(`/admin/answers/${answerId}`, "_blank"); - } - - renderAnswerReferences() { - const { answers, answersReferences, isLoading } = this.state; - - if (isLoading) { - return ( - - - - ); - } - - if (answersReferences.length === 0) { - return ( - - {T.ADMIN_TRACKER_INFO_NO_DATA} - - ); - } - - return ( - - {answersReferences.map(answerReference => { - const answer = answers.find(({ id }) => id === answerReference.answer_id); - - return ( - - - - this.open(answerReference.answer_id)} - /> - - ); - })} - - ); - } - - render() { - const { agreement } = this.state; - - return ( - - - - {agreement === null && Tableau de veille » …} - {agreement !== null && ( - {`Tableau de veille » [${agreement.idcc}] ${shortenAgreementName( - agreement.name, - )}`} - )} - - - {this.renderAnswerReferences()} - - - ); - } -} - -export default AdminTrackerAgreementIdPage; diff --git a/targets/contributions/pages/admin/legacy-tracker/index.js b/targets/contributions/pages/admin/legacy-tracker/index.js deleted file mode 100644 index d30d3e7f64..0000000000 --- a/targets/contributions/pages/admin/legacy-tracker/index.js +++ /dev/null @@ -1,239 +0,0 @@ -import styled from "@emotion/styled"; -import React from "react"; -import { Flex } from "rebass"; - -import * as C from "../../../src/constants"; -import LoadingSpinner from "../../../src/elements/LoadingSpinner"; -import _Table from "../../../src/elements/Table"; -import Title from "../../../src/elements/Title"; -import shortenAgreementName from "../../../src/helpers/shortenAgreementName"; -import AdminMainLayout from "../../../src/layouts/AdminMain"; -import cdtnApi from "../../../src/libs/cdtnApi"; -import numeral from "../../../src/libs/customNumeral"; -import customPostgrester from "../../../src/libs/customPostgrester"; - -const Container = styled(Flex)` - margin: 0 1rem 1rem; -`; - -const Table = styled(_Table)` - display: fles; - flex-grow: 1; - font-size: 0.875rem; - margin-top: 0.5rem; - overflow-y: auto; - - .rt-tr > .rt-th, - .rt-tr > .rt-td { - :first-of-type { - width: 50% !important; - } - :not(:first-of-type) { - width: 50% !important; - } - } - - .rt-tr > .rt-td { - :first-of-type { - cursor: pointer; - } - :not(:first-of-type) { - text-align: right; - } - } -`; - -// TODO Clean these columns. -/* eslint-disable react/display-name */ -const DASHBOARD_TABLE_COLUMNS = [ - { - Cell: ({ row, value }) => { - return ( - window.open(`/admin/tracker/${row._original.id}`)} - onKeyPress={() => window.open(`/admin/tracker/${row._original.id}`)} - role="link" - tabIndex="0" - title={value} - > - {value} - - ); - }, - Header: "Convention", - accessor: "name", - }, - { - Cell: ({ value }) => (value === -1 ? "…" : numeral(value).format("0,0")), - Header: "Nombre de références obsolètes", - accessor: "total", - }, -]; -/* eslint-enable react/display-name */ - -class AdminTrackerPage extends React.Component { - constructor(props) { - super(props); - - this.state = { - answersReferencesStats: [], - isLoading: true, - selectedAgreementOption: null, - }; - } - - async componentDidMount() { - this.isUmounted = false; - this.postgrest = customPostgrester(); - - await this.initializeStats(); - await this.updateStats(); - } - - componentWillUnmount() { - this.isUmounted = true; - } - - async initializeStats() { - const { data: locations } = await this.postgrest - .select("*") - .select("agreements(id,idcc,name,parent_id)") - .get("/locations"); - - const answersReferencesStats = locations - .reduce((prev, { agreements }) => [...prev, ...agreements], []) - .filter(({ parent_id }) => parent_id === null) - .map(({ id, idcc, name }) => ({ - id, - name: `[${idcc}] ${shortenAgreementName(name)}`, - total: -1, - })); - - this.setState({ - answersReferencesStats: [ - { - id: null, - name: `[Code du travail] Réponses génériques`, - total: -1, - }, - ...answersReferencesStats, - ], - isLoading: false, - }); - } - - async fetchAnswersForAgreement(agreementId) { - const { data: answers } = await this.postgrest.eq("agreement_id", agreementId).get("/answers"); - - return answers; - } - - async findObsoleteAnswersReferences(answersReferences) { - // TODO Remove `dila_cid !== null` check once all the references are cleaned. - const localAgreementAnswersReferences = answersReferences.filter( - ({ category, dila_cid }) => - category === C.ANSWER_REFERENCE_CATEGORY.AGREEMENT && dila_cid !== null, - ); - const localCodeAnswersReferences = answersReferences.filter( - ({ category, dila_cid }) => - category === C.ANSWER_REFERENCE_CATEGORY.LABOR_CODE && dila_cid !== null, - ); - - const obsoleteAgreementAnswersReference = []; - for (const localAgreementAnswerReference of localAgreementAnswersReferences) { - try { - const { dila_id } = localAgreementAnswerReference; - await cdtnApi.get(`/agreement/articles?articleIdsOrCids=${dila_id}`); - } catch (err) { - obsoleteAgreementAnswersReference.push(localAgreementAnswerReference); - } - } - const obsoleteCodeAnswersReference = []; - for (const localCodeAnswerReference of localCodeAnswersReferences) { - try { - const { dila_id } = localCodeAnswerReference; - await cdtnApi.get(`/code/articles?articleIdsOrCids=${dila_id}`); - } catch (err) { - obsoleteAgreementAnswersReference.push(localCodeAnswerReference); - } - } - - return [...obsoleteAgreementAnswersReference, ...obsoleteCodeAnswersReference]; - } - - async updateStats() { - const { answersReferencesStats } = this.state; - - const { length } = answersReferencesStats; - let index = -1; - while (++index < length) { - if (this.isUmounted) { - break; - } - - const { answersReferencesStats } = this.state; - const nextAnswersReferencesStats = [...answersReferencesStats]; - const { id: agreementId } = answersReferencesStats[index]; - - const { data: answers } = - agreementId !== null - ? await this.postgrest.eq("agreement_id", agreementId).get("/answers") - : await this.postgrest.is("agreement_id", null).get("/answers"); - - const answerIds = answers.map(({ id }) => id); - const { data: answersReferences } = await this.postgrest - .in("answer_id", answerIds) - .get("/answers_references"); - - const obsoleteAnswersReferences = await this.findObsoleteAnswersReferences(answersReferences); - - nextAnswersReferencesStats[index].total = obsoleteAnswersReferences.length; - - if (this.isUmounted) { - return; - } - - this.setState({ - answersReferencesStats: nextAnswersReferencesStats, - }); - } - } - - renderDashboard() { - const { answersReferencesStats, isLoading } = this.state; - - if (isLoading) { - return ( - - - - ); - } - - return ( -
    - ); - } - - render() { - return ( - - - Tableau de veille - {this.renderDashboard()} - - - ); - } -} - -export default AdminTrackerPage; diff --git a/targets/contributions/pages/admin/locations/edit.js b/targets/contributions/pages/admin/locations/edit.js deleted file mode 100644 index fc208c03da..0000000000 --- a/targets/contributions/pages/admin/locations/edit.js +++ /dev/null @@ -1,48 +0,0 @@ -import withAdminEdit from "../../../src/templates/withAdminEdit"; -import { FIELDS } from "./new"; - -const componentDidMount = async (api, id) => { - const { data: locations } = await api - .eq("id", id) - .select("*") - .select("agreements(*)") - .get("/locations"); - const { data: agreements } = await api.get("/agreements"); - - const defaultData = { - ...locations[0], - agreements: locations[0].agreements.map(agreement => ({ - id: agreement.id, - value: `${agreement.idcc} - ${agreement.name}`, - })), - }; - - const fields = [ - ...FIELDS, - { - apiPath: "/locations_agreements", - label: "Conventions", - name: "agreements", - tags: agreements.map(({ id, idcc, name }) => ({ - label: `${idcc} - ${name}`, - value: id, - })), - type: "tags", - }, - ]; - - return { defaultData, fields }; -}; - -const AdminLocationsEditPage = withAdminEdit( - { - apiPath: "/locations", - i18nIsFeminine: true, - i18nSubject: "unité", - indexPath: "/locations", - name: "locations", - }, - componentDidMount, -); - -export default AdminLocationsEditPage; diff --git a/targets/contributions/pages/admin/locations/index.js b/targets/contributions/pages/admin/locations/index.js deleted file mode 100644 index a423b5fb9e..0000000000 --- a/targets/contributions/pages/admin/locations/index.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from "react"; - -import AdminIndex from "../../../src/components/AdminIndex"; - -const COLUMNS = [ - { - Header: "Nom", - accessor: "name", - }, -]; - -const AdminLocationsIndexPage = () => ( - -); - -export default AdminLocationsIndexPage; diff --git a/targets/contributions/pages/admin/locations/new.js b/targets/contributions/pages/admin/locations/new.js deleted file mode 100644 index cda82fbf3f..0000000000 --- a/targets/contributions/pages/admin/locations/new.js +++ /dev/null @@ -1,43 +0,0 @@ -import withAdminNew from "../../../src/templates/withAdminNew"; - -export const FIELDS = [ - { - label: "Nom", - name: "name", - type: "input", - }, -]; - -const componentDidMount = async api => { - const { data: agreements } = await api.get("/agreements"); - - const fields = [ - ...FIELDS, - { - apiPath: "/locations_agreements", - ariaName: "la convention", - label: "Conventions", - name: "agreements", - tags: agreements.map(({ id, idcc, name }) => ({ - label: `${idcc} - ${name}`, - value: id, - })), - type: "tags", - }, - ]; - - return { fields }; -}; - -const AdminLocationsNewPage = withAdminNew( - { - apiPath: "/locations", - i18nIsFeminine: true, - i18nSubject: "unité", - indexPath: "/locations", - name: "locations", - }, - componentDidMount, -); - -export default AdminLocationsNewPage; diff --git a/targets/contributions/pages/admin/logs/index.js b/targets/contributions/pages/admin/logs/index.js deleted file mode 100644 index 12e2c3da86..0000000000 --- a/targets/contributions/pages/admin/logs/index.js +++ /dev/null @@ -1,97 +0,0 @@ -import React from "react"; -import { connect } from "react-redux"; - -import * as actions from "../../../src/actions"; -import { Container, Head } from "../../../src/components/AdminIndex/styles"; -import Button from "../../../src/elements/Button"; -import Table from "../../../src/elements/Table"; -import Title from "../../../src/elements/Title"; -import capitalize from "../../../src/helpers/capitalize"; -import humanizeLogAction from "../../../src/helpers/humanizeLogAction"; -import AdminMainLayout from "../../../src/layouts/AdminMain"; -import moment from "../../../src/libs/customMoment"; - -// TODO Clean these columns. -/* eslint-disable react/display-name */ -const COLUMNS = [ - { - Cell: ({ value }) => (value !== null ? value.name : "N/A"), - Header: "Nom", - accessor: "user", - }, - { - Cell: ({ value }) => (value !== null ? capitalize(value.role) : "N/A"), - Header: "Role", - accessor: "user", - }, - { - Header: "IP", - accessor: "ip", - }, - { - Cell: ({ original: { method, path } }) => humanizeLogAction(method, path), - Header: "Action", - accessor: "method", - }, - { - Header: "Chemin", - accessor: "path", - }, - { - Cell: ({ value }) => (value !== null ? {value} : "N/A"), - Header: "Corps", - accessor: "body", - }, - { - Cell: ({ value }) => moment(value).format("L HH:mm:ss"), - Header: "Date", - accessor: "created_at", - }, -]; -/* eslint-enable react/display-name */ - -class AdminLogsIndexPage extends React.Component { - componentDidMount() { - this.props.dispatch(actions.logs.load({ pageIndex: -1 })); - } - - deleteOlderThanOneWeek() { - this.props.dispatch(actions.logs.deleteOlderThanOneWeek()); - } - - render() { - const { logs } = this.props; - - return ( - - - - Logs - - -
    - - - ); - } -} - -export default connect(({ logs }) => ({ - logs, -}))(AdminLogsIndexPage); diff --git a/targets/contributions/pages/admin/migrations/edit.js b/targets/contributions/pages/admin/migrations/edit.js deleted file mode 100644 index b132e7d362..0000000000 --- a/targets/contributions/pages/admin/migrations/edit.js +++ /dev/null @@ -1,55 +0,0 @@ -import React from "react"; - -import AdminForm from "../../../src/components/AdminForm"; -import AdminMainLayout from "../../../src/layouts/AdminMain"; -import api from "../../../src/libs/api"; - -const FIELDS = [ - { - label: "Nom", - name: "name", - type: "input", - }, -]; - -export default class AdminQuestionsEditPage extends React.Component { - constructor(props) { - super(props); - - this.state = { - isLoading: true, - }; - } - - async componentDidMount() { - try { - const uri = `/administrator_migrations?id=eq.${this.props.id}`; - - const migrations = await api.get(uri); - - this.setState({ - data: migrations[0], - isLoading: false, - }); - } catch (err) { - if (err !== undefined) console.warn(err); - } - } - - render() { - if (this.state.isLoading) return ; - - return ( - - ); - } -} diff --git a/targets/contributions/pages/admin/migrations/index.js b/targets/contributions/pages/admin/migrations/index.js deleted file mode 100644 index 2532216bf9..0000000000 --- a/targets/contributions/pages/admin/migrations/index.js +++ /dev/null @@ -1,38 +0,0 @@ -import moment from "moment-timezone"; -import React from "react"; - -import AdminIndex from "../../../src/components/AdminIndex"; - -const COLUMNS = [ - { - Header: "Index", - accessor: "id", - }, - { - Header: "Nom", - accessor: "name", - }, - { - Header: "Créé le", - accessor: data => moment(data.migration_time).tz("Europe/Paris").format("YYYY-MM-DD HH:mm"), - filterable: false, - id: "createdAt", - style: { textAlign: "center" }, - width: 160, - }, -]; - -const AdminMigrationsIndexPage = () => ( - -); - -export default AdminMigrationsIndexPage; diff --git a/targets/contributions/pages/admin/questions/edit.js b/targets/contributions/pages/admin/questions/edit.js deleted file mode 100644 index 3b22062826..0000000000 --- a/targets/contributions/pages/admin/questions/edit.js +++ /dev/null @@ -1,36 +0,0 @@ -import withAdminEdit from "../../../src/templates/withAdminEdit"; - -const FIELDS = [ - { - inputType: "number", - label: "Index", - name: "index", - type: "input", - }, - { - label: "Intitulé", - name: "value", - type: "text", - }, -]; - -const componentDidMount = async (api, id) => { - const questions = await api.fetchAll("/questions", { id }); - - return { - defaultData: questions[0], - fields: FIELDS, - }; -}; - -const AdminDefinitionsEditPage = withAdminEdit( - { - apiPath: "/questions", - i18nIsFeminine: true, - i18nSubject: "question", - indexPath: "/questions", - }, - componentDidMount, -); - -export default AdminDefinitionsEditPage; diff --git a/targets/contributions/pages/admin/questions/index.js b/targets/contributions/pages/admin/questions/index.js deleted file mode 100644 index 0d19e95cb3..0000000000 --- a/targets/contributions/pages/admin/questions/index.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react"; - -import AdminIndex from "../../../src/components/AdminIndex"; - -const COLUMNS = [ - { - Header: "Index", - accessor: "index", - style: { textAlign: "right" }, - width: 80, - }, - { - Header: "Intitulé", - accessor: "value", - }, -]; - -const QuestionsIndexPage = () => ( - -); - -export default QuestionsIndexPage; diff --git a/targets/contributions/pages/admin/questions/new.jsx b/targets/contributions/pages/admin/questions/new.jsx deleted file mode 100644 index 0960e140c3..0000000000 --- a/targets/contributions/pages/admin/questions/new.jsx +++ /dev/null @@ -1,61 +0,0 @@ -import { useRouter } from "next/router"; -import React from "react"; - -import { addQuestion } from "../../../src/api"; -import AdminForm from "../../../src/components/AdminForm"; - -const FIELDS = [ - { - inputType: "number", - label: "Index", - name: "index", - type: "input", - }, - { - label: "Intitulé", - name: "value", - type: "text", - }, -]; - -export default function AdminNew() { - const { back } = useRouter(); - const [isSubmitting, submitting] = React.useState(false); - const [error, setError] = React.useState(); - - const onSubmit = async data => { - try { - submitting(true); - setError(null); - await addQuestion(data.index, data.value); - back(); - } catch (err) { - if ( - err !== undefined && - err.response !== undefined && - err.response.data !== undefined && - typeof err.response.data.message === "string" - ) { - setError(`Erreur: ${err.response.data.message}.`); - } else { - setError(`Erreur: ${err}`); - if (err !== undefined) console.warn(err); - } - } finally { - submitting(false); - } - }; - - return ( - - ); -} diff --git a/targets/contributions/pages/admin/tracker/index.js b/targets/contributions/pages/admin/tracker/index.js deleted file mode 100644 index 094fcbe0ee..0000000000 --- a/targets/contributions/pages/admin/tracker/index.js +++ /dev/null @@ -1,193 +0,0 @@ -import styled from "@emotion/styled"; -import debounce from "lodash.debounce"; -import React from "react"; -import ReactDiffViewer from "react-diff-viewer"; -import { connect } from "react-redux"; -import { Flex } from "rebass"; - -import * as actions from "../../../src/actions"; -import Tree from "../../../src/components/Tree"; -import Button from "../../../src/elements/Button"; -import Icon from "../../../src/elements/Icon"; -import LoadingSpinner from "../../../src/elements/LoadingSpinner"; -import MarkdownEditor from "../../../src/elements/MarkdownEditor"; -import Subtitle from "../../../src/elements/Subtitle"; -import Title from "../../../src/elements/Title"; -import AdminMainLayout from "../../../src/layouts/AdminMain"; -import api from "../../../src/libs/api"; - -const Container = styled(Flex)` - margin: 0 1rem 1rem; -`; - -const TreeContainer = styled(Flex)` - max-width: 20rem; - min-width: 20rem; -`; - -const Editor = styled(MarkdownEditor)` - max-height: 100%; - min-height: 100%; - - .editor { - border: 0 !important; - } -`; - -export class AdminTrackerIndexPage extends React.Component { - constructor(props) { - super(props); - - this.selectAnswer = this.selectAnswer.bind(this); - this.updateAnswerValue = debounce(this._updateAnswerValue.bind(this), 500).bind(this); - - this.state = { - selectedReferenceDiff: null, - }; - } - - componentDidMount() { - this.props.dispatch(actions.answers.toggleIsLoading()); - this.props.dispatch(actions.alerts.load()); - } - - selectAnswer({ key }) { - this.props.dispatch(actions.alerts.selectOne(key)); - } - - async _updateAnswerValue({ source }) { - try { - const { - answers: { - data: { id }, - }, - } = this.props; - const value = source.trim(); - const uri = `/answers?id=eq.${id}`; - const data = { value }; - - await api.patch(uri, data); - } catch (err) { - console.warn(err); - } - } - - openAnswerInNewTab(id) { - window.open(`/admin/answers/${id}`, "_blank"); - } - - processAnswer() { - this.props.dispatch(actions.alerts.processOne()); - } - - renderDiff() { - const { - alerts: { - diff: { etat, texts }, - }, - } = this.props; - - return ( - - - État : {etat.previous} ► {etat.current} - - {texts.length !== 0 && ( - - )} - - ); - } - - renderTree() { - const { alerts } = this.props; - const { isLoading, selectedKey, tree } = alerts; - - if (isLoading) { - return ( - - - - ); - } - - return ( - - Tableau de veille - - - ); - } - - renderEditor() { - const { - alerts: { isLoading: alertsIsLoading }, - answers: { data: answersData, isLoading: answersIsLoading }, - } = this.props; - - if (alertsIsLoading || answersIsLoading) { - return ( - - - - ); - } - - if (answersData === null) { - return ( -

    - - Sélectionnez une réponse parmi les alertes pour la traiter. -

    - ); - } - - const { id, value } = answersData; - - return ( - - - {this.renderDiff()} - - - - - - - - - - ); - } - - render() { - return ( - - - {this.renderTree()} - {this.renderEditor()} - - - ); - } -} - -export default connect(({ alerts, answers, legalReferences }) => ({ - alerts, - answers, - legalReferences, -}))(AdminTrackerIndexPage); diff --git a/targets/contributions/pages/admin/users/edit.js b/targets/contributions/pages/admin/users/edit.js deleted file mode 100644 index 6836b649d0..0000000000 --- a/targets/contributions/pages/admin/users/edit.js +++ /dev/null @@ -1,54 +0,0 @@ -import withAdminEdit from "../../../src/templates/withAdminEdit"; -import { FIELDS } from "./new"; - -const componentDidMount = async (api, id) => { - const { data: users } = await api.eq("id", id).get("/administrator_users"); - const { data: agreements } = await api.get("/agreements"); - const { data: locations } = await api.get("/locations"); - - const defaultData = { - ...users[0], - agreements: users[0].agreements.map(agreement => ({ - id: agreement.id, - value: `${agreement.idcc} - ${agreement.name}`, - })), - }; - - const fields = [ - ...FIELDS, - { - label: "Unité", - name: "location_id", - options: locations.map(({ id: value, name: label }) => ({ - label, - value, - })), - type: "select", - }, - { - label: "Conventions", - name: "agreements", - tags: agreements.map(({ id, idcc, name }) => ({ - label: `${idcc} - ${name}`, - value: id, - })), - type: "tags", - }, - ]; - - return { - defaultData, - fields, - }; -}; - -const AdminUsersEditPage = withAdminEdit( - { - apiPath: "/rpc/update_user", - i18nSubject: "utilisateur", - indexPath: "/users", - }, - componentDidMount, -); - -export default AdminUsersEditPage; diff --git a/targets/contributions/pages/admin/users/index.js b/targets/contributions/pages/admin/users/index.js deleted file mode 100644 index 234e1796ff..0000000000 --- a/targets/contributions/pages/admin/users/index.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from "react"; - -import AdminIndex from "../../../src/components/AdminIndex"; - -const COLUMNS = [ - { - Header: "Nom", - accessor: "name", - }, - { - Header: "E-mail", - accessor: "email", - }, - { - Header: "Rôle", - accessor: "role", - }, - { - Header: "Conventions", - accessor: data => data.agreements.map(({ idcc }) => idcc).join(", "), - id: "idccs", - width: 160, - }, -]; - -const AdminUsersIndexPage = () => ( - -); - -export default AdminUsersIndexPage; diff --git a/targets/contributions/pages/admin/users/new.js b/targets/contributions/pages/admin/users/new.js deleted file mode 100644 index 669368dc30..0000000000 --- a/targets/contributions/pages/admin/users/new.js +++ /dev/null @@ -1,83 +0,0 @@ -import generatePassword from "../../../src/libs/generatePassword"; -import withAdminNew from "../../../src/templates/withAdminNew"; - -const PASSWORD_LENGTH = 16; - -export const FIELDS = [ - { - label: "Nom", - name: "name", - type: "input", - }, - { - label: "Rôle", - name: "role", - options: [ - { label: "Administrateur", value: "administrator" }, - { label: "Administrateur régional", value: "regional_administrator" }, - { label: "Contributeur", value: "contributor" }, - ], - type: "select", - }, - { - inputType: "email", - label: "E-mail", - name: "email", - type: "input", - }, - { - button: { - handler: () => generatePassword(PASSWORD_LENGTH), - icon: "sync", - title: "Bouton générant un mot de passe aléatoire", - }, - label: "Mot-de-passe", - name: "password", - type: "input", - }, -]; - -const componentDidMount = async api => { - const { data: agreements } = await api.get("/agreements"); - const { data: locations } = await api.get("/locations"); - - const defaultData = { - password: generatePassword(PASSWORD_LENGTH), - }; - - const fields = [ - ...FIELDS, - { - label: "Unité", - name: "location_id", - options: locations.map(({ id: value, name: label }) => ({ - label, - value, - })), - type: "select", - }, - { - ariaName: "la convention", - label: "Conventions", - name: "agreements", - tags: agreements.map(({ id, idcc, name }) => ({ - label: `${idcc} - ${name}`, - value: id, - })), - type: "tags", - }, - ]; - - return { defaultData, fields }; -}; - -const AdminUsersNewPage = withAdminNew( - { - apiPath: "/rpc/create_user", - i18nSubject: "utilisateur", - indexPath: "/users", - }, - componentDidMount, -); - -export default AdminUsersNewPage; diff --git a/targets/contributions/pages/answers/edit.js b/targets/contributions/pages/answers/edit.js deleted file mode 100644 index 4a289fb1a0..0000000000 --- a/targets/contributions/pages/answers/edit.js +++ /dev/null @@ -1,293 +0,0 @@ -import styled from "@emotion/styled"; -import debounce from "lodash.debounce"; -import Router from "next/router"; -import React from "react"; -import { connect } from "react-redux"; -import { Flex } from "rebass"; - -import * as actions from "../../src/actions"; -import AnswerEditionContentBlock from "../../src/blocks/AnswerEditionContent"; -import AnswerEditionHeadBlock from "../../src/blocks/AnswerEditionHead"; -import { TABS } from "../../src/blocks/AnswerEditionHead/Tabs"; -import AnswerEditionReferencesBlock from "../../src/blocks/AnswerEditionReferences"; -import { ANSWER_STATE } from "../../src/constants"; -import SavingSpinner from "../../src/elements/SavingSpinner"; -import Main from "../../src/layouts/Main"; -import { api } from "../../src/libs/GraphQLApi"; -import getCurrentUser from "../../src/libs/getCurrentUser"; -import makeApiFilter from "../../src/libs/makeApiFilter"; -import { - getAnswerReferences, - updateAnswerReference, - updateAnswersStates, -} from "../../src/libs/graphql"; - -const Container = styled(Main)` - overflow-x: hidden; -`; -const Content = styled(Flex)` - flex-grow: 1; - overflow-y: auto; -`; -const ContentInfo = styled(Flex)` - color: var(--color-shadow); - font-size: 1rem; - margin-top: 0.5rem; - position: absolute; - right: 1rem; - width: 12.5rem; -`; - -class AnswersEditPage extends React.Component { - constructor(props) { - super(props); - - this.state = { - currentTab: TABS.EDITOR, - hasSavingSpinner: false, - isLoading: true, - isSaving: false, - me: null, - references: [], - savingSpinnerTimeout: 0, - }; - - this.prevalue = null; - this.newPrevalue = null; - - this.createReference = debounce(this._createReference.bind(this), 500); - this.deleteReference = debounce(this._deleteReference.bind(this), 500); - this.updatePrevalue = debounce(this._updatePrevalue.bind(this), 500); - } - - async componentDidMount() { - const { id } = this.props; - const me = getCurrentUser(); - - this.load(); - - try { - const references = await api.fetch(getAnswerReferences, { - answer_id: id, - }); - - this.setState({ - isLoading: false, - me, - references, - }); - } catch (err) { - console.warn(err); - } - } - - componentDidUpdate() { - if (!this.props.answers.isLoading) { - if (this.prevalue === null) { - this.prevalue = this.props.answers.data.prevalue; - this.newPrevalue = this.props.answers.data.prevalue; - this.forceUpdate(); - } - } - } - - load() { - const { dispatch, id } = this.props; - - dispatch(actions.answers.loadOne(id)); - } - - async cancel() { - if (this.state.isSaving) return; - - this.props.dispatch( - actions.modal.open( - `Êtes-vous sûr d'annuler cette réponse (son contenu sera supprimé) ?`, - () => - actions.answers.cancel([this.props.id], () => - Router.push("/answers/draft/1") - ) - ) - ); - } - - async requestForAnswerValidation() { - if (this.state.isSaving) return; - - this.props.dispatch( - actions.modal.open( - `Êtes-vous sûr d'envoyer cette réponse en validation ?`, - () => - actions.answers.updateState( - [this.props.id], - ANSWER_STATE.PENDING_REVIEW, - () => Router.push("/answers/draft/1") - ) - ) - ); - } - - async _updatePrevalue(value) { - this.setState({ isSaving: true }); - this.showSavingSpinner(); - - try { - const data = { - prevalue: value, - state: "draft", - user_id: this.state.me.id, - }; - - await api.update(updateAnswersStates, { data, ids: [this.props.id] }); - this.newPrevalue = value; - } catch (err) { - console.warn(err); - } - - this.setState({ isSaving: false }); - } - - async _createReference(reference) { - this.setState({ isSaving: true }); - - try { - const answersData = { - state: "draft", - user_id: this.state.me.id, - }; - const answersReferencesData = { - answer_id: this.props.id, - ...reference, - }; - - await api.update(updateAnswersStates, { - data: answersData, - ids: [this.props.id], - }); - - const { id, ...data } = answersReferencesData; - await api.update(updateAnswerReference, { id, data }); - } catch (err) { - console.warn(err); - } - - this.setState({ - isSaving: false, - references: [...this.state.references, reference], - }); - } - - async _deleteReference(_value) { - this.setState({ isSaving: true }); - - try { - const uri = makeApiFilter("/answers_references", { - answer_id: this.props.id, - value: _value, - }); - - // TODO await api.delete(deleteAnswerReference, {}) - await api.delete(uri); - } catch (err) { - console.warn(err); - } - - this.setState({ - isSaving: false, - references: this.state.references.filter(({ value }) => value !== _value), - }); - } - - showSavingSpinner() { - if (this.state.hasSavingSpinner) { - clearTimeout(this.state.savingSpinnerTimeout); - } - - this.setState({ - hasSavingSpinner: true, - savingSpinnerTimeout: setTimeout( - () => - this.setState({ - hasSavingSpinner: false, - savingSpinnerTimeout: 0, - }), - 2000 - ), - }); - } - - switchTab(nextTab) { - if (nextTab === this.state.currentTab) return; - - if (nextTab === TABS.EDITOR) { - this.prevalue = this.newPrevalue; - } - - this.setState({ currentTab: nextTab }); - } - - renderTab() { - const { prevalue } = this; - const { references } = this.state; - - switch (this.state.currentTab) { - case TABS.REFERENCES: - return ( - - ); - - case TABS.EDITOR: - default: - return ( - - ); - } - } - - render() { - const { prevalue } = this; - const { answers } = this.props; - const { isLoading, references } = this.state; - - if (isLoading || answers.isLoading || prevalue === null) { - return
    ; - } - - const { agreement, question } = answers.data; - - return ( - - this.cancel()} - onSubmit={() => this.requestForAnswerValidation()} - onTabChange={this.switchTab.bind(this)} - question={question} - referencesCount={references.length} - /> - - {this.state.hasSavingSpinner && ( - - - Sauvegarde en cours… - - )} - - {this.renderTab()} - - - ); - } -} - -export default connect(({ answers }) => ({ answers }))(AnswersEditPage); diff --git a/targets/contributions/pages/answers/index.js b/targets/contributions/pages/answers/index.js deleted file mode 100644 index 491bbb9a06..0000000000 --- a/targets/contributions/pages/answers/index.js +++ /dev/null @@ -1,219 +0,0 @@ -import styled from "@emotion/styled"; -import debounce from "lodash.debounce"; -import Router, { withRouter } from "next/router"; -import React from "react"; -import { connect } from "react-redux"; -import { Flex } from "rebass"; - -import * as actions from "../../src/actions"; -import AnswerBlock from "../../src/blocks/Answer"; -import { ANSWER_STATE } from "../../src/constants"; -import Input from "../../src/elements/Input"; -import Subtitle from "../../src/elements/Subtitle"; -import Main from "../../src/layouts/Main"; -import T from "../../src/texts"; - -const Content = styled(Flex)` - flex-grow: 1; - padding: 0 1rem 1rem; -`; -const List = styled(Flex)` - flex-grow: 1; - min-height: 0; - overflow-y: auto; -`; - -const Text = styled.p` - margin-bottom: 0.5rem; -`; -const InfoText = styled(Text)` - color: var(--color-dark-slate-gray); -`; -const ErrorText = styled(Text)` - color: var(--color-text-red); - font-weight: 600; -`; -const HelpText = styled(Text)` - font-size: 0.875rem; -`; - -const FilterInputContainer = styled.div` - margin-right: 13rem; -`; -const FilterInput = styled(Input)` - margin: 0.5rem 0; -`; - -class AnswersIndexPage extends React.Component { - get query() { - return this.$query !== undefined && this.$query !== null ? this.$query.value : ""; - } - - constructor(props) { - super(props); - - this.state = { - me: null, - }; - - this.load = debounce(this._load.bind(this), 500); - } - - componentDidMount() { - this.load(); - } - - componentDidUpdate(prevProps) { - const { - router: { - query: { page: prevPage, state: prevState }, - }, - } = prevProps; - const { - router: { - query: { page, state }, - }, - } = this.props; - - if (page !== prevPage || state !== prevState) { - this.load(); - } - } - - _load() { - const { - router: { - query: { page, state }, - }, - } = this.props; - - const pageIndex = Number(page) - 1; - const states = - state === ANSWER_STATE.UNDER_REVIEW - ? [ANSWER_STATE.PENDING_REVIEW, ANSWER_STATE.UNDER_REVIEW] - : [state]; - - const meta = { - pageIndex, - query: this.query, - states, - }; - - this.props.dispatch(actions.answers.load(meta)); - } - - goToPage({ selected }) { - const { - router: { - query: { state }, - }, - } = this.props; - - const href = `/answers?state=${state}&page=${selected + 1}`; - const as = `/answers/${state}/${selected + 1}`; - Router.push(href, as, { shallow: true }); - } - - cancel(id) { - const action = () => actions.answers.cancel([id], this.load.bind(this)); - - this.props.dispatch(actions.modal.open(T.ANSWERS_INDEX_MODAL_CANCEL, action)); - } - - updateGenericReference(id, genericReference) { - this.props.dispatch( - actions.answers.updateGenericReference([id], genericReference, this.load.bind(this)), - ); - } - - openAnswer(id) { - const { - router: { - query: { state }, - }, - } = this.props; - - if ([ANSWER_STATE.TO_DO, ANSWER_STATE.DRAFT].includes(state)) { - Router.push(`/answers/edit/${id}`); - - return; - } - - Router.push(`/answers/view/${id}`); - } - - renderAnswers() { - const { - answers, - router: { - query: { state }, - }, - } = this.props; - const { list, error } = answers; - - if (error !== null) { - return {error}; - } - - if (list.length === 0) { - if (this.query.length !== 0) { - return {T.ANSWERS_INDEX_INFO_NO_SEARCH_RESULT}; - } - - return {T.ANSWERS_INDEX_INFO_NO_DATA(state)}; - } - - return list.map(answer => [ - , - ]); - } - - render() { - const { - answers, - router: { - query: { state }, - }, - } = this.props; - const { isLoading, list } = answers; - - return ( -
    - - {T.ANSWERS_INDEX_TITLE(state)} - - this.load()} - placeholder={T.ANSWERS_INDEX_SEARCH_PLACEHOLDER} - ref={node => (this.$query = node)} - /> - - {isLoading && ( - - Chargement… - - )} - {!isLoading && ( - - {state === ANSWER_STATE.TO_DO && list.length !== 0 && ( - {T.ANSWERS_INDEX_HELP_TO_DO} - )} - {this.renderAnswers()} - - )} - -
    - ); - } -} - -export default connect(({ answers }) => ({ - answers, -}))(withRouter(AnswersIndexPage)); diff --git a/targets/contributions/pages/answers/view.js b/targets/contributions/pages/answers/view.js deleted file mode 100644 index f2f34f5e1e..0000000000 --- a/targets/contributions/pages/answers/view.js +++ /dev/null @@ -1,230 +0,0 @@ -import styled from "@emotion/styled"; -import React from "react"; -import Medixtor from "react-medixtor"; -import { connect } from "react-redux"; -import { Flex } from "rebass"; - -import * as actions from "../../src/actions"; -import LegalReferences from "../../src/components/LegalReferences"; -import { ANSWER_STATE } from "../../src/constants"; -import Hr from "../../src/elements/Hr"; -import Idcc from "../../src/elements/Idcc"; -import Subtitle from "../../src/elements/Subtitle"; -import Title from "../../src/elements/Title"; -import Main from "../../src/layouts/Main"; -import { api } from "../../src/libs/GraphQLApi"; -import { getAnswerReferences } from "../../src/libs/graphql"; - -const Container = styled(Main)` - overflow-y: auto; - padding: 1rem; -`; - -const AnswerEditor = styled(Medixtor)` - border: solid 1px var(--color-border) !important; - border-radius: 0.25rem; - flex-grow: unset; - min-height: 15rem; - - .editor { - background-color: white; - } - .editor-status { - display: none; - } - - .preview { - background-color: white; - border-bottom-right-radius: 0.25rem; - border-top-right-radius: 0.25rem; - line-height: 1.4; - min-width: 100% !important; - overflow-y: auto; - padding-top: 0 !important; - width: 100% !important; - - a { - color: #0053b3; - - :after { - content: ""; - position: relative; - top: 1px; - display: inline-block; - width: 15px; - height: 15px; - margin-left: 5px; - background: url("/static/assets/icons/external-link.svg") 100% 50% / - 15px no-repeat; - } - - :hover { - text-decoration: none; - } - } - - h2, - h3, - h4, - h5, - h6 { - color: #006ab2; - } - h2 { - font-size: 1.875rem; - } - h3 { - font-size: 1.625rem; - } - h4 { - font-size: 1.375rem; - } - h5 { - font-size: 1.125rem; - } - h6 { - font-size: 1rem; - } - - p { - color: #434956; - margin-block-start: 1em; - margin-block-end: 1em; - margin-inline-start: 0; - margin-inline-end: 0; - } - - ul { - list-style-type: disc; - margin-block-start: 1em; - margin-block-end: 1em; - margin-inline-start: 0px; - margin-inline-end: 0px; - padding-inline-start: 20px; - - li { - display: list-item; - } - - ul { - list-style-type: circle; - } - } - } -`; - -const Strong = styled.p` - font-weight: 600; - margin: ${(props) => (props.isFirst ? "0 0 0.5rem" : "1rem 0 0.5rem")}; -`; - -class AnswersViewPage extends React.Component { - constructor(props) { - super(props); - - this.state = { - isLoading: true, - references: [], - }; - } - - async componentDidMount() { - this.load(); - await this.loadReferences(); - } - - load() { - const { dispatch, id } = this.props; - - dispatch(actions.answers.loadOne(id)); - } - - async loadReferences() { - try { - const references = await api.fetch(getAnswerReferences, { - answer_id: this.props.id, - }); - - this.setState({ - isLoading: false, - references, - }); - } catch (err) { - if (err !== undefined) console.warn(err); - } - } - - renderReferences(category = null) { - const references = this.state.references.filter( - ({ category: _category }) => _category === category - ); - - return ( - - ); - } - - render() { - const { answers } = this.props; - const { isLoading } = this.state; - - if (isLoading || answers.isLoading) { - return
    ; - } - - const { - agreement, - generic_reference, - prevalue, - question, - state, - value, - } = answers.data; - - const finalValue = state === ANSWER_STATE.VALIDATED ? value : prevalue; - const valueTitle = - state === ANSWER_STATE.VALIDATED ? "Réponse validée" : "Réponse proposée"; - - return ( - - - {this.isGeneric ? ( - - ) : ( - - )} - {`${question.index}) ${question.value}`} - -
    - - {valueTitle} - - - Références juridiques - Convention collective - {this.renderReferences("agreement")} - Code du travail - {this.renderReferences("labor_code")} - Autres - {this.renderReferences()} -
    - - Renvoi - { - { - labor_code: "Renvoyée au texte Code du Travail.", - national_agreement: "Renvoyée au texte de la CCN.", - null: "Aucun renvoi.", - }[String(generic_reference)] - } -
    - ); - } -} - -export default connect(({ answers }) => ({ answers }))(AnswersViewPage); diff --git a/targets/contributions/pages/api/graphql.js b/targets/contributions/pages/api/graphql.js deleted file mode 100644 index 415bc2bf22..0000000000 --- a/targets/contributions/pages/api/graphql.js +++ /dev/null @@ -1,27 +0,0 @@ -import { createProxyMiddleware } from "http-proxy-middleware"; - -export const config = { - api: { - bodyParser: false, - }, - externalResolver: true, -}; - -const proxy = createProxyMiddleware({ - changeOrigin: true, - followRedirects: true, - logLevel: "debug", - onError: (err, req, res) => { - res.writeHead(500, { - "Content-Type": "text/plain", - }); - res.end("Something went wrong. We've been notified."); - }, - pathRewrite: { "^/api/graphql": "/v1/graphql" }, - prependPath: false, - target: process.env.HASURA_GRAPHQL_ENDPOINT, - ws: true, - xfwd: true, // proxy websockets -}); - -export default proxy; diff --git a/targets/contributions/pages/charter.js b/targets/contributions/pages/charter.js deleted file mode 100644 index c184aa952e..0000000000 --- a/targets/contributions/pages/charter.js +++ /dev/null @@ -1,38 +0,0 @@ -// import { Flex } from "rebass"; -import styled from "@emotion/styled"; -import React from "react"; - -import Main from "../src/layouts/Main"; - -const IFrame = styled.iframe` - flex-grow: 1; -`; - -export default class CharterPage extends React.Component { - constructor(props) { - super(props); - - this.state = { - isLoading: true, - }; - } - - componentDidMount() { - this.setState({ isLoading: false }); - } - - render() { - if (this.state.isLoading) return
    ; - - return ( -
    -