-
Notifications
You must be signed in to change notification settings - Fork 1
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
implementated if tls need to be enabled or not while creating or #113
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ import { NameIdView } from '~/console/components/name-id-view'; | |
import Select from '~/components/atoms/select'; | ||
import useCustomSwr from '~/root/lib/client/hooks/use-custom-swr'; | ||
import { useAppend, useMapper } from '~/components/utils'; | ||
import { Checkbox } from '~/components/atoms/checkbox'; | ||
import { IAppContext } from '../app+/$app+/_layout'; | ||
|
||
type IDialog = IDialogBase<ExtractNodeType<IRouters>>; | ||
|
@@ -49,12 +50,14 @@ const Root = (props: IDialog) => { | |
displayName: props.data.displayName, | ||
domains: [], | ||
isNameError: false, | ||
isTlsEnabled: props.data.spec.https?.enabled || false, | ||
} | ||
: { | ||
name: '', | ||
displayName: '', | ||
domains: [], | ||
isNameError: false, | ||
isTlsEnabled: false, | ||
}, | ||
validationSchema: Yup.object({ | ||
displayName: Yup.string().required(), | ||
|
@@ -81,7 +84,7 @@ const Root = (props: IDialog) => { | |
spec: { | ||
domains: val.domains, | ||
https: { | ||
enabled: true, | ||
enabled: val.isTlsEnabled, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (llm): Similar to my previous comment, the update logic for TLS enabling/disabling also lacks test coverage. Ensuring that existing routers correctly update their |
||
}, | ||
}, | ||
}, | ||
|
@@ -103,7 +106,7 @@ const Root = (props: IDialog) => { | |
...props.data.spec, | ||
domains: val.domains, | ||
https: { | ||
enabled: true, | ||
enabled: val.isTlsEnabled, | ||
}, | ||
}, | ||
}, | ||
|
@@ -198,6 +201,13 @@ const Root = (props: IDialog) => { | |
loading={domainLoading} | ||
disableWhileLoading | ||
/> | ||
<Checkbox | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (llm): It's great to see the UI component for toggling TLS being added. However, it would be beneficial to include end-to-end tests that simulate user interaction with this checkbox and verify that the TLS setting is correctly applied upon router creation or update. This would ensure the feature works as expected from a user's perspective. |
||
label="enable TLS" | ||
checked={values.isTlsEnabled} | ||
onChange={(val) => { | ||
handleChange('isTlsEnabled')(dummyEvent(val)); | ||
}} | ||
/> | ||
</Popup.Content> | ||
<Popup.Footer> | ||
<Popup.Button content="Cancel" variant="basic" closable /> | ||
|
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.
issue (llm): I noticed the implementation for toggling TLS has been added, but I don't see any unit tests covering this new logic. It's crucial to ensure that when
isTlsEnabled
is both true and false, the expected behavior is correctly implemented. Could you add tests to verify that thehttps
configuration is correctly updated based on theisTlsEnabled
state?