-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://issues.redhat.com/browse/MTA-1538?filter=12422675 --------- Signed-off-by: ibolton336 <[email protected]>
- Loading branch information
1 parent
e10fecf
commit b66abc1
Showing
7 changed files
with
194 additions
and
49 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
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
161 changes: 161 additions & 0 deletions
161
...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,161 @@ | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { | ||
Title, | ||
TextContent, | ||
Text, | ||
TextVariants, | ||
Button, | ||
Grid, | ||
GridItem, | ||
} 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"; | ||
import { EditIcon } from "@patternfly/react-icons"; | ||
|
||
export const ApplicationDetailFields: React.FC<{ | ||
application: Application | null; | ||
onEditClick: () => void; | ||
onCloseClick: () => void; | ||
}> = ({ application, onEditClick, onCloseClick }) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<> | ||
<TextContent className={spacing.mtLg}> | ||
<Grid> | ||
<GridItem span={6}> | ||
<Title headingLevel="h3" size="md"> | ||
{t("terms.applicationInformation")} | ||
</Title> | ||
</GridItem> | ||
<GridItem span={1}> | ||
<Button | ||
style={{ paddingTop: "0px", paddingBottom: "0px" }} | ||
variant="link" | ||
aria-label="Edit" | ||
onClick={() => { | ||
onEditClick(); | ||
onCloseClick(); | ||
}} | ||
icon={<EditIcon />} | ||
/> | ||
</GridItem> | ||
</Grid> | ||
</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> | ||
</> | ||
); | ||
}; |