-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f8d58f
commit c4b1b1c
Showing
5 changed files
with
149 additions
and
46 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
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
134 changes: 134 additions & 0 deletions
134
...app/pages/applications/components/application-detail-drawer/application-detail-fields.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,134 @@ | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { Title, TextContent, Text, TextVariants } from "@patternfly/react-core"; | ||
import { Application } from "@app/api/models"; | ||
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; | ||
import { ApplicationBusinessService } from "../application-business-service"; | ||
import { EmptyTextMessage } from "@app/components/EmptyTextMessage"; | ||
|
||
export const ApplicationDetailFields: React.FC<{ | ||
application: Application | null; | ||
}> = ({ application }) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<> | ||
<TextContent className={spacing.mtLg}> | ||
<Title headingLevel="h3" size="md"> | ||
{t("terms.applicationInformation")} | ||
</Title> | ||
</TextContent> | ||
<Title headingLevel="h3" size="md"> | ||
{t("terms.owner")} | ||
</Title> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
{application?.owner ?? t("terms.notAvailable")} | ||
</Text> | ||
<Title headingLevel="h3" size="md"> | ||
{t("terms.contributors")} | ||
</Title> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
{application?.contributors?.length | ||
? application.contributors | ||
.map((contributor) => contributor.name) | ||
.join(", ") | ||
: t("terms.notAvailable")} | ||
</Text> | ||
<Title headingLevel="h3" size="md"> | ||
{t("terms.sourceCode")} | ||
</Title> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
{t("terms.repositoryType")} | ||
{": "} | ||
</Text> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
{application?.repository?.kind} | ||
</Text> | ||
<br /> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
<a href={application?.repository?.url} target="_"> | ||
{application?.repository?.url} | ||
</a> | ||
</Text> | ||
<br /> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
{t("terms.branch")} | ||
{": "} | ||
</Text> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
{application?.repository?.branch} | ||
</Text> | ||
<br /> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
{t("terms.rootPath")} | ||
{": "} | ||
</Text> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
{application?.repository?.path} | ||
</Text> | ||
<br /> | ||
<Title headingLevel="h3" size="md"> | ||
{t("terms.binary")} | ||
</Title> | ||
<Text | ||
component={TextVariants.small} | ||
className="pf-v5-u-color-200 pf-v5-u-font-weight-light" | ||
> | ||
{application?.binary} | ||
</Text> | ||
<Title headingLevel="h3" size="md"> | ||
{t("terms.businessService")} | ||
</Title> | ||
<Text component="small"> | ||
{application?.businessService ? ( | ||
<ApplicationBusinessService id={application.businessService.id} /> | ||
) : ( | ||
t("terms.unassigned") | ||
)} | ||
</Text> | ||
<Title headingLevel="h3" size="md"> | ||
{t("terms.migrationWave")} | ||
</Title> | ||
<Text component="small"> | ||
{application?.migrationWave | ||
? application.migrationWave.name | ||
: t("terms.unassigned")} | ||
</Text> | ||
<Title headingLevel="h3" size="md"> | ||
{t("terms.commentsFromApplication")} | ||
</Title> | ||
<Text component="small" cy-data="comments"> | ||
{application?.comments || ( | ||
<EmptyTextMessage message={t("terms.notAvailable")} /> | ||
)} | ||
</Text> | ||
</> | ||
); | ||
}; |