-
Notifications
You must be signed in to change notification settings - Fork 713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the remoteHub field (for Git repository name) in the ChaosHub Frontend #4843
Added the remoteHub field (for Git repository name) in the ChaosHub Frontend #4843
Conversation
@@ -0,0 +1,2 @@ | |||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --> | |||
<svg width="800px" height="800px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="#2684FF" fill-rule="evenodd" d="M1.403 2.15A.43.43 0 011.73 2l12.54.002a.43.43 0 01.424.496l-1.81 11.135a.43.43 0 01-.425.36H3.693a.585.585 0 01-.568-.478l-1.82-11.02a.425.425 0 01.098-.345zm5.203 7.814H9.41l.677-3.93H5.859l.747 3.93z" clip-rule="evenodd"/><path fill="url(#bitbucket-color-16__paint0_linear_707_135)" d="M14.122 6.033H10.1l-.67 3.931H6.604L3.317 13.86c.105.09.238.139.376.14h8.766a.43.43 0 00.425-.36l1.238-7.607z"/><defs><linearGradient id="bitbucket-color-16__paint0_linear_707_135" x1="11.544" x2="6.918" y1="4.676" y2="11.282" gradientUnits="userSpaceOnUse"><stop offset=".18" stop-color="#0052CC"/><stop offset="1" stop-color="#2684FF"/></linearGradient></defs></svg> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can update height and width 32px for all svgs or just remove them if not required.
{ label: 'GitHub', value: 'GitHub' }, | ||
{ label: 'Bitbucket', value: 'Bitbucket' }, | ||
{ label: 'Azure Repo', value: 'Azure Repo' }, | ||
{ label: 'GitLab', value: 'GitLab' }, | ||
{ label: 'Others', value: 'Others' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings
const RemoteHubImage = ({ remoteHubName }: { remoteHubName: string }): React.ReactElement => { | ||
const hubSvg = () => { | ||
switch (remoteHubName) { | ||
case 'GitHub': | ||
return <img src={GitHub} height={27.38} width={29} alt="GitHub" />; | ||
case 'Azure Repo': | ||
return <img src={Azure} height={27.38} width={29} alt="Azure-Repo" />; | ||
case 'Bitbucket': | ||
return <img src={Bitbucket} height={27.38} width={29} alt="Bitbucket" />; | ||
case 'GitLab': | ||
return <img src={Gitlab} height={27.38} width={29} alt="Gitlab" />; | ||
default: | ||
return <img src={privateHubLogo} height={27.38} width={29} alt="Private Hub" />; | ||
} | ||
}; | ||
|
||
return hubSvg(); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of switching the img
tag we can switch the src
directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can shift this to utils
@@ -231,6 +236,22 @@ const GitConnectionStep: React.FC< | |||
placeholder={getString('enterHubRepositoryBranch')} | |||
/> | |||
|
|||
<FormInput.DropDown | |||
name="remoteHub" | |||
label={<Text font={{ variation: FontVariation.FORM_LABEL }}>Remote Hub</Text>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings
import enterpriseHubLogo from '../../images/enterpriseHub.svg'; | ||
import privateHubLogo from '../../images/privateHub.svg'; | ||
import Bitbucket from '../../images/Bitbucket.svg'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import all from @images
@@ -132,7 +155,7 @@ export const ChaosHubsView: React.FC<ChaosHubParams> = ({ | |||
{chaosHub.isDefault ? ( | |||
<img src={enterpriseHubLogo} height={26.85} width={29} alt="Enterprise Hub" /> | |||
) : ( | |||
<img src={privateHubLogo} height={27.38} width={29} alt="Private Hub" /> | |||
<RemoteHubImage remoteHubName={chaosHub.remoteHub} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can pass isDefault
too as a prop and get the correct icon
label={<Text font={{ variation: FontVariation.FORM_LABEL }}>Remote Hub</Text>} | ||
placeholder={'Select Remote hub'} | ||
items={[ | ||
{ label: 'GitHub', value: 'GitHub' }, | ||
{ label: 'Bitbucket', value: 'Bitbucket' }, | ||
{ label: 'Azure Repo', value: 'Azure Repo' }, | ||
{ label: 'GitLab', value: 'GitLab' }, | ||
{ label: 'Others', value: 'Others' } | ||
]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings
Signed-off-by: JanhaviAlekar <[email protected]>
Signed-off-by: JanhaviAlekar <[email protected]>
Signed-off-by: JanhaviAlekar <[email protected]>
Signed-off-by: JanhaviAlekar <[email protected]>
910d934
to
eafda38
Compare
…rontend (litmuschaos#4843) * added dropdown in add chaoshub modal(AddHubModalWizard) Signed-off-by: JanhaviAlekar <[email protected]> * added svg for list chaoshub in chaoshub page(ChaosHubs.tsx) Signed-off-by: JanhaviAlekar <[email protected]> * added dropdown list in edit chaoshub modal(EditHubModalWizard.tsx) Signed-off-by: JanhaviAlekar <[email protected]> * made remoteHub as required field Signed-off-by: JanhaviAlekar <[email protected]> --------- Signed-off-by: JanhaviAlekar <[email protected]> Signed-off-by: dusdjhyeon <[email protected]>
…rontend (litmuschaos#4843) * added dropdown in add chaoshub modal(AddHubModalWizard) Signed-off-by: JanhaviAlekar <[email protected]> * added svg for list chaoshub in chaoshub page(ChaosHubs.tsx) Signed-off-by: JanhaviAlekar <[email protected]> * added dropdown list in edit chaoshub modal(EditHubModalWizard.tsx) Signed-off-by: JanhaviAlekar <[email protected]> * made remoteHub as required field Signed-off-by: JanhaviAlekar <[email protected]> --------- Signed-off-by: JanhaviAlekar <[email protected]> Signed-off-by: sagnik3788 <[email protected]>
Proposed changes
Summarize your changes here to communicate with the maintainers and make sure to put the link of that issue
Types of changes
What types of changes does your code introduce to Litmus? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Dependency
Added remoteHub field in chaosHub backend #4842
Special notes for your reviewer: