-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(MAJ prod): lister les documents déployés lors des mises à jours …
…de prod et pre-prod
- Loading branch information
1 parent
fda61bd
commit 718fe68
Showing
15 changed files
with
248 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
{ | ||
"extends": ["@shared/eslint-config"] | ||
"extends": [ | ||
"@shared/eslint-config" | ||
], | ||
"rules": { | ||
"@typescript-eslint/naming-convention": "warn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
targets/frontend/src/modules/documents/api/documents.query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const getDocumentsUpdatedAfterDateQuery = ` | ||
query GetDocuments($updated_at: timestamptz!, $sources: [String!]) { | ||
documents(where: { | ||
updated_at: {_gte: $updated_at}, | ||
source: {_in: $sources} | ||
}, | ||
order_by: {updated_at: desc}) { | ||
title | ||
source | ||
slug | ||
} | ||
}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
targets/frontend/src/modules/export/components/document-list.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react"; | ||
import { Stack } from "src/components/layout/Stack"; | ||
import BlockIcon from "@mui/icons-material/Block"; | ||
import { CircularProgress as Spinner, Link } from "@mui/material"; | ||
import { getRouteBySource } from "@socialgouv/cdtn-sources"; | ||
import { ShortDocument } from "../../documents"; | ||
|
||
type Props = { | ||
docs: ShortDocument[]; | ||
isLoadingDocs: boolean; | ||
}; | ||
export default function DocumentList({ | ||
docs, | ||
isLoadingDocs, | ||
}: Props): JSX.Element { | ||
return ( | ||
<> | ||
<strong>Documents inclus dans la mise à jour</strong> | ||
|
||
{isLoadingDocs ? ( | ||
<Stack mt={2} justifyContent="center"> | ||
<Spinner></Spinner> | ||
</Stack> | ||
) : docs.length ? ( | ||
<ul> | ||
{docs.map((doc) => ( | ||
<li key={doc.slug}> | ||
<Link | ||
href={`https://code-du-travail-numerique-preprod.dev.fabrique.social.gouv.fr/${getRouteBySource( | ||
doc.source | ||
)}/${doc.slug}`} | ||
target="_blank" | ||
sx={{ fontSize: "0.8rem" }} | ||
> | ||
{doc.title} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
) : ( | ||
<Stack mt={2} justifyContent="center"> | ||
<BlockIcon></BlockIcon> | ||
</Stack> | ||
)} | ||
</> | ||
); | ||
} |
Oops, something went wrong.