Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix display of no flagged pieces #1511

Merged
merged 1 commit into from
Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 49 additions & 53 deletions react/src/LID.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,6 @@ function FlaggedPieces({setSearchQuery}) {
const totalCount = data.piecesFlagged.totalCount
const moreRows = data.piecesFlagged.more

if (!totalCount) {
return <div className="flagged-pieces-none">
Boost doctor did not find any pieces with errors
</div>
}

var cursor = params.cursor
if (pageNum === 1 && rows.length) {
cursor = rows[0].CreatedAt.getTime()
Expand All @@ -265,25 +259,33 @@ function FlaggedPieces({setSearchQuery}) {
Flagged pieces ({totalCount})
</h3>

<table>
<tbody>
<tr>
<th>Piece CID</th>
<th>Index</th>
<th>Deals</th>
</tr>
{ totalCount ? (
<>
<table>
<tbody>
<tr>
<th>Piece CID</th>
<th>Index</th>
<th>Deals</th>
</tr>

{rows.map(piece => (
<FlaggedPieceRow
key={piece.Piece.PieceCid}
piece={piece.Piece}
setSearchQuery={setSearchQuery}
/>
))}
</tbody>
</table>
{rows.map(piece => (
<FlaggedPieceRow
key={piece.Piece.PieceCid}
piece={piece.Piece}
setSearchQuery={setSearchQuery}
/>
))}
</tbody>
</table>

<Pagination {...paginationParams} />
<Pagination {...paginationParams} />
</>
) : (
<div className="flagged-pieces-none">
Boost doctor did not find any pieces with errors
</div>
)}
</div>
}

Expand All @@ -301,10 +303,6 @@ function NoUnsealedSectorLink() {
return <div>&nbsp;</div>
}

if (!data.piecesFlaggedCount) {
return null
}

return <div>
<Link className="nav-link" to="/no-unsealed">See {data.piecesFlaggedCount} pieces with no unsealed copy ➜</Link>
</div>
Expand Down Expand Up @@ -373,12 +371,6 @@ function NoUnsealedSectorPieces() {
const totalCount = data.piecesFlagged.totalCount
const moreRows = data.piecesFlagged.more

if (!totalCount) {
return <div className="flagged-pieces-none">
Boost doctor did not find any pieces that were flagged because there is no unsealed copy of the sector
</div>
}

var cursor = params.cursor
if (pageNum === 1 && rows.length) {
cursor = rows[0].CreatedAt.getTime()
Expand All @@ -400,24 +392,32 @@ function NoUnsealedSectorPieces() {
Pieces with no unsealed sector ({totalCount})
</h3>

<table>
<tbody>
<tr>
<th>Piece CID</th>
<th>Index</th>
<th>Deals</th>
</tr>
{ totalCount ? (
<>
<table>
<tbody>
<tr>
<th>Piece CID</th>
<th>Index</th>
<th>Deals</th>
</tr>

{rows.map(piece => (
<FlaggedPieceRow
key={piece.Piece.PieceCid}
piece={piece.Piece}
/>
))}
</tbody>
</table>
{rows.map(piece => (
<FlaggedPieceRow
key={piece.Piece.PieceCid}
piece={piece.Piece}
/>
))}
</tbody>
</table>

<Pagination {...paginationParams} />
<Pagination {...paginationParams} />
</>
) : (
<div className="flagged-pieces-none">
Boost doctor did not find any pieces with no unsealed sector
</div>
)}
</div>
}

Expand All @@ -435,10 +435,6 @@ function FlaggedPiecesLink() {
return <div>&nbsp;</div>
}

if (!data.piecesFlaggedCount) {
return null
}

return <div>
<Link className="nav-link" to="/piece-doctor">See {data.piecesFlaggedCount} flagged pieces ➜</Link>
</div>
Expand Down