-
Notifications
You must be signed in to change notification settings - Fork 703
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
feat/gitops/image-registry: Added revamped UI screens for Gitops and image registry #4135
feat/gitops/image-registry: Added revamped UI screens for Gitops and image registry #4135
Conversation
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
}); | ||
const [enableGitopsMutation, { loading: enableGitopsMutationLoading }] = enableGitOps({ | ||
onCompleted: () => { | ||
showSuccess('Gitops enabled successfully'); |
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 [addImageRegistryMutation, { loading: addImageRegistryMutationLoading }] = addImageRegistry({ | ||
onCompleted: () => { | ||
showSuccess('Image Registry added successfully'); |
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
onError: err => showError(err.message) | ||
}); | ||
return ( | ||
<Loader loading={getImageRegistryLoading}> |
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're following practice of controllers calling just views, you can put this loader inside the view.
label: ( | ||
<Layout.Vertical style={{ gap: '1rem' }}> | ||
<Text font={{ variation: FontVariation.BODY2_SEMI, weight: 'semi-bold' }} color={Color.BLACK}> | ||
Locally in Litmus |
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, check the entire file
rightElement={ | ||
( | ||
<Container | ||
flex={{ justifyContent: 'center', alignItems: 'center' }} | ||
height="100%" | ||
> | ||
<CopyButton stringToCopy={sshPublicKey} /> | ||
</Container> | ||
) as any | ||
} |
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.
is this working? since rightElement takes iconName only 😕
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.
height="100%" | ||
style={{ overflowY: 'auto' }} | ||
> | ||
{/* <Loader |
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.
commented code.
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
|
||
const [updateImageRegistryMutation, { loading: updateImageRegistryMutationLoading }] = updateImageRegistry({ | ||
onCompleted: () => { | ||
showSuccess('Image Registry updated successfully'); |
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
@@ -57,6 +59,9 @@ export const paths: UseRouteDefinitionsProps = { | |||
toKubernetesChaosInfrastructures: ({ environmentID }) => `/environments/${environmentID}/kubernetes`, | |||
toKubernetesChaosInfrastructureDetails: ({ chaosInfrastructureID, environmentID }) => | |||
`/environments/${environmentID}/kubernetes/${chaosInfrastructureID}`, | |||
// chaos image registry routes | |||
toImageRegistry: () => `/image-registry/`, |
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.
remove trailing /
@@ -14,6 +14,8 @@ aboutChaosCTL: >- | |||
infrastructure: | |||
acceptInvitation: Accept Invitation | |||
accessToAllNamespaces: Access to all namespaces | |||
accessToken: Access Token | |||
accessTokenPlaceholder: Enter your Personal Acess Token |
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.
accessTokenPlaceholder: Enter your Personal Acess Token | |
accessTokenPlaceholder: Enter your Personal Access Token |
customLabel: Custom | ||
customRepo: Custom Repo | ||
customValueText: All YAML files use the custom values. |
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.
customValueText: All YAML files use the custom values. | |
customValueText: All YAML files will use the custom values. |
daily: Daily | ||
dailyMessage: Your chaos experiment will run daily at your chosen time. | ||
dateExecuted: Date Executed | ||
dayOfMonthLabel: Day of month | ||
dayOfWeekLabel: Day of week | ||
declineInvitation: Decline Invitation | ||
declineInvitationDescription: Are you sure you want to decline the invitation? | ||
defaultValueOption: Use Default Values | ||
defaultValueText: >- | ||
All YAML files use these default values provided by Litmus. The values cannot |
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.
All YAML files use these default values provided by Litmus. The values cannot | |
All YAML files use these default values provided by Litmus. These values cannot |
enableGitops({ | ||
variables: { | ||
projectID: projectID, | ||
configurations: { | ||
branch: values.branch ?? '', | ||
repoURL: values.repoURL ?? '', | ||
authType: values.authType, | ||
token: values.token ?? '', | ||
sshPrivateKey: values.sshPrivateKey ?? '', | ||
userName: values.userName ?? '', | ||
password: values.password ?? '' | ||
} |
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.
call mutation only when values are present/defined
> | ||
<CopyButton stringToCopy={sshPublicKey} /> | ||
</Container> | ||
) as any |
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.
why as any
?
import Loader from '@components/Loader'; | ||
import css from './ImageRegistry.module.scss'; | ||
|
||
enum ImageRegistryValues { |
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.
shift to models
imageRegistryName: !getImageRegistryData?.imageRegistryInfo.isDefault | ||
? getImageRegistryData?.imageRegistryInfo.imageRegistryName | ||
: '', |
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.
imageRegistryName: !getImageRegistryData?.imageRegistryInfo.isDefault | |
? getImageRegistryData?.imageRegistryInfo.imageRegistryName | |
: '', | |
imageRegistryName: defaultTo(getImageRegistryData.imageRegistryInfo.isDefault, ''), |
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.
replace all ternary with this
imageRegistryName: values.imageRegistryName | ||
? imageRegValueType === ImageRegistryValues.DEFAULT | ||
? 'docker.io' | ||
: values.imageRegistryName | ||
: '', | ||
imageRepoName: values.imageRegistryRepo | ||
? imageRegValueType === ImageRegistryValues.DEFAULT | ||
? 'litmuschaos' | ||
: values.imageRegistryRepo | ||
: '', | ||
imageRegistryType: values.registryType | ||
? imageRegValueType === ImageRegistryValues.DEFAULT | ||
? ImageRegistryType.PRIVATE | ||
: values.registryType | ||
: ImageRegistryType.PUBLIC, | ||
secretName: values.secretName ? (imageRegValueType === ImageRegistryValues.DEFAULT ? '' : values.secretName) : '', | ||
secretNamespace: values.imageRegistryName | ||
? imageRegValueType === ImageRegistryValues.DEFAULT | ||
? '' | ||
: values.imageRegistryName | ||
: '', | ||
enableRegistry: imageRegValueType === ImageRegistryValues.DEFAULT ? false : true, | ||
isDefault: imageRegValueType === ImageRegistryValues.DEFAULT ? true : false | ||
}; |
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.
use defaultTo
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
….0.0/image-registry Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
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
Special notes for your reviewer: