Skip to content

Commit

Permalink
🔗 link to template (cyclops-ui#448)
Browse files Browse the repository at this point in the history
* fix:(cyclops-ui#371) Device Port if default then not set is displayed

* fix:(cyclops-ui#371) Device Port if default then not set is displayed

* fix:(cyclops-ui#371) console log removed and name index if not present then not setis to be rendered

* fix:(cyclops-ui#371) text for <not set> changed to gray

* fix:(cyclops-ui#371) Namespace is added in the Module Header

* fix:(cyclops-ui#368) Removed the third unnecessary status

* fix:(cyclops-ui#368) Removed the calculation unnecessary status icon

* A function added and link to the template attached

* CSS added for hover effect

* If TemplateRefLocked then gray color is applied and on hover underline is applied

* The hex color #B8B8B8 is used and the css class created for underline effect
  • Loading branch information
tanbirali authored Jul 19, 2024
1 parent 3572c7c commit a69ebe7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 20 additions & 1 deletion cyclops-ui/src/components/pages/EditModule/EditModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,25 @@ const EditModule = () => {
);
};

const linkToTemplate = (templateRef: templateRef) => {
if (templateRef.repo.startsWith("https://github.com")) {
return (
<a
href={
templateRef.repo +
`/tree/` +
templateRef.resolvedVersion +
`/` +
templateRef.path
}
style={{ color: templateRefLock ? "#B8B8B8" : "" }}
className="linkToTemplate"
>
{templateRef.resolvedVersion.substring(0, 7)}
</a>
);
} else return templateRef.resolvedVersion.substring(0, 7);
};
return (
<div>
{error.message.length !== 0 && (
Expand Down Expand Up @@ -1228,7 +1247,7 @@ const EditModule = () => {
>
<Input
placeholder={"Version"}
addonAfter={templateRef.resolvedVersion.substring(0, 7)}
addonAfter={linkToTemplate(templateRef)}
disabled={templateRefLock}
/>
</Form.Item>
Expand Down
4 changes: 4 additions & 0 deletions cyclops-ui/src/components/pages/EditModule/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ code {
padding: 0;
}
}

.linkToTemplate:hover {
text-decoration: underline;
}

0 comments on commit a69ebe7

Please sign in to comment.