Search Display Error

Added an additional check so the site renders despite description being undefined

Co-authored-by: Konstantin Schaper<konstantin.schaper@cloudogu.com>
This commit is contained in:
Tarik Gürsoy
2023-10-20 16:49:47 +02:00
parent 3e4681f714
commit e27c1a9cd3
2 changed files with 7 additions and 5 deletions

View File

@@ -0,0 +1,2 @@
- type: fixed
description: Display error when the description of a repository is not stored

View File

@@ -25,12 +25,12 @@
import React, { FC } from "react";
import { Link } from "react-router-dom";
import {
useDateHitFieldValue,
useStringHitFieldValue,
DateFromNow,
HitProps,
RepositoryAvatar,
TextHitField,
HitProps,
useDateHitFieldValue,
useStringHitFieldValue,
} from "@scm-manager/ui-components";
import { CardList } from "@scm-manager/ui-layout";
import classNames from "classnames";
@@ -74,11 +74,11 @@ const RepositoryHit: FC<HitProps> = ({ hit }) => {
</StyledLink>
</CardList.Card.Title>
</CardList.Card.Row>
{((description as ValueHitField).value || (description as HighlightedHitField).fragments) && (
{description && ((description as ValueHitField).value || (description as HighlightedHitField).fragments) ? (
<CardList.Card.Row className="is-size-7 has-text-secondary">
<TextHitField hit={hit} field="description" />
</CardList.Card.Row>
)}
) : null}
<CardList.Card.Row className="is-size-7 has-text-secondary">
<DateFromNow date={date} />
</CardList.Card.Row>