-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add git versioning info for process (#32)
* feat: add git versioning info for process
- Loading branch information
Showing
17 changed files
with
223 additions
and
204 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Anchor, Flex, Paper, Popover, Text } from "@mantine/core"; | ||
import { useDisclosure } from "@mantine/hooks"; | ||
import { IProcess } from "@pm2.web/typings"; | ||
import { IconGitMerge } from "@tabler/icons-react"; | ||
|
||
import classes from "@/styles/process.module.css"; | ||
|
||
export default function ProcessGitMetric({ versioning }: { versioning?: IProcess["versioning"] }) { | ||
const [opened, { close, open }] = useDisclosure(false); | ||
|
||
return ( | ||
<Popover withArrow shadow="md" opened={opened} trapFocus> | ||
<Popover.Target> | ||
<Paper | ||
className={classes.processMetric} | ||
radius="md" | ||
p={"4px"} | ||
px={"10px"} | ||
onMouseEnter={open} | ||
onMouseLeave={close} | ||
> | ||
<Flex align={"center"} justify={"space-between"} gap={"5px"} w={"5em"}> | ||
<IconGitMerge size="1.2rem" /> | ||
<Anchor href={`${versioning?.url}/commit/${versioning?.revision}`} target="_blank" underline="hover"> | ||
{versioning?.branch} | ||
{versioning?.unstaged && "*"} | ||
</Anchor> | ||
</Flex> | ||
</Paper> | ||
</Popover.Target> | ||
<Popover.Dropdown style={{ pointerEvents: "none" }}> | ||
{versioning?.comment?.split("\n")?.map((t, tIdx) => ( | ||
<Text size="sm" key={tIdx}> | ||
{t} | ||
</Text> | ||
))} | ||
</Popover.Dropdown> | ||
</Popover> | ||
); | ||
} |
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
Oops, something went wrong.