-
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(frontend): Display better error messages during model comparison
- Loading branch information
1 parent
1cc496d
commit cbca3b0
Showing
4 changed files
with
231 additions
and
196 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright DB InfraGO AG and contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
const CommitInformation = ({ | ||
commitDetails, | ||
isExpanded, | ||
toggleExpand, | ||
section | ||
}) => { | ||
return ( | ||
<div className="text-left"> | ||
<p> | ||
<span className="font-semibold">Hash:</span> {commitDetails.hash} | ||
</p> | ||
{commitDetails.tag && ( | ||
<p> | ||
<span className="font-semibold">Tag:</span> {commitDetails.tag} | ||
</p> | ||
)} | ||
<p> | ||
<span className="font-semibold">Author:</span> {commitDetails.author} | ||
</p> | ||
<p style={{ whiteSpace: 'pre-wrap' }}> | ||
<span className="font-semibold">Description:</span>{' '} | ||
{isExpanded | ||
? commitDetails.description | ||
: `${commitDetails.description.split('\n')[0]}${ | ||
commitDetails.description.includes('\n') ? '' : '' | ||
}`} | ||
</p> | ||
{commitDetails.description.includes('\n') && ( | ||
<button | ||
className="mb-4 mt-2 font-normal text-custom-blue | ||
hover:text-custom-blue-hover" | ||
onClick={() => toggleExpand(section)}> | ||
{isExpanded ? 'Show Less' : 'Show Full Description'} | ||
</button> | ||
)} | ||
<p> | ||
<span className="font-semibold">Date:</span> {commitDetails.date} | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CommitInformation; |
Oops, something went wrong.