Skip to content

Commit

Permalink
Merge branch 'master' into fufeck_feat_update-multi-numeros
Browse files Browse the repository at this point in the history
  • Loading branch information
fufeck authored Oct 22, 2024
2 parents 69dadc9 + be365c4 commit 70f8ce5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 19 deletions.
4 changes: 2 additions & 2 deletions components/bal/voies-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ function VoiesList({
: null
}
comment={
voie.commentedNumeros.length > 0 ? (
<CommentsContent comments={voie.commentedNumeros} />
voie.comments.length > 0 ? (
<CommentsContent comments={voie.comments} />
) : null
}
warning={
Expand Down
17 changes: 5 additions & 12 deletions components/comments-content.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { Pane, Text } from "evergreen-ui";
import { uniqueId } from "lodash";

const COMMENTS_LIMIT = 10;

interface CommentsContentProps {
comments: {
id: string;
numero: number;
suffixe: string;
comment: string;
}[];
comments: string[];
}

function CommentsContent({ comments }: CommentsContentProps) {
Expand All @@ -23,18 +19,15 @@ function CommentsContent({ comments }: CommentsContentProps) {
Commentaire{`${comments.length > 0 ? "s" : ""}`} :
</Text>
</Pane>
{filteredComments.map(({ id, numero, suffixe, comment }) => (
{filteredComments.map((comment) => (
<Pane
color="white"
key={id}
key={uniqueId()}
whiteSpace="nowrap"
overflow="hidden"
textOverflow="ellipsis"
>
<Text color="white">
{numero}
{suffixe} : {comment}
</Text>
<Text color="white">{comment}</Text>
</Pane>
))}
{nbComments > COMMENTS_LIMIT && (
Expand Down
2 changes: 1 addition & 1 deletion components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function Header() {

<Button
is="a"
href={PEERTUBE_LINK}
href={`${PEERTUBE_LINK}/w/p/4kx66AESyPc6Er47sgBeFX`}
target="_blank"
appearance="minimal"
marginRight="12px"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ function AlertPublishedBALMoissoneur({
const loadOrganization = async () => {
if (revision.context.extras.sourceId) {
const sourceId: string = revision.context.extras.sourceId;
const id: string[] = sourceId.split("-");
const dataset: Dataset = await DataGouvService.findDataset(id[1]);
const dataset: Dataset = await DataGouvService.findDataset(sourceId);

setOrganization(dataset.organization);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/openapi/models/ExtendedVoieDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export type ExtendedVoieDTO = {
typeNumerotation: ExtendedVoieDTO.typeNumerotation;
centroid: Record<string, any>;
trace: Record<string, any>;
bbox: Array<string>;
baseLocale: BaseLocale;
numeros: Array<Numero>;
nbNumeros: number;
nbNumerosCertifies: number;
isAllCertified: boolean;
commentedNumeros: Array<string>;
bbox: Record<string, any>;
comments: Array<string>;
};

export namespace ExtendedVoieDTO {
Expand Down
1 change: 1 addition & 0 deletions lib/openapi/models/Voie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type Voie = {
typeNumerotation: Voie.typeNumerotation;
centroid: Record<string, any>;
trace: Record<string, any>;
bbox: Array<string>;
baseLocale: BaseLocale;
numeros: Array<Numero>;
};
Expand Down

0 comments on commit 70f8ce5

Please sign in to comment.