-
Notifications
You must be signed in to change notification settings - Fork 27
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
Migrated last Components and Configuration area #1708
Conversation
1f47bb2
to
de5627b
Compare
|
||
function confirm() { | ||
emit("confirm", settings); | ||
emit("confirm"); |
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.
the settings were not used, so I removed them
|
||
const baseUrl = window.defaultConfig.base_url; | ||
|
||
function subIsActive(input, exact) { | ||
const paths = Array.isArray(input) ? input : [input]; |
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.
nothing was passing an array, so removed that code
// The event is only actually emitted on the RetryRedirects.vue component | ||
// but if we don't include it, the console will show warnings about not being able to | ||
// subscribe to this event | ||
defineEmits(["redirectCountUpdated"]); |
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.
using a reactive exported const instead
@@ -20,36 +18,36 @@ const enable_tls = ref(settings.enable_tls); | |||
const from = ref(settings.from); | |||
const to = ref(settings.to); | |||
|
|||
const emailRe = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |||
const emailRe = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; |
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.
unnecessary escape
|
||
const isExpired = licenseStatus.isExpired; | ||
|
||
const emit = defineEmits(["redirectCountUpdated"]); |
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.
this now in redirectCountUpdated
src/ServicePulse.Host/vue/src/components/configuration/PlatformConnections.vue
Outdated
Show resolved
Hide resolved
src/ServicePulse.Host/vue/src/components/configuration/PlatformConnections.vue
Show resolved
Hide resolved
src/ServicePulse.Host/vue/src/resources/UpdateEmailNotificationsSettingsRequest.ts
Show resolved
Hide resolved
src/ServicePulse.Host/vue/src/components/configuration/EndpointConnection.vue
Show resolved
Hide resolved
ecb1d5e
to
74d4be4
Compare
… the other initialisation
@@ -252,11 +247,13 @@ async function getServiceControlConnection() { | |||
|
|||
async function getMonitoringConnection() { | |||
try { | |||
const [, data] = await useTypedFetchFromMonitoring<{ Metrics: MetricsConnectionDetails }>("connection"); | |||
return data; | |||
if (!useIsMonitoringDisabled()) { |
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.
not required, is in useTypedFetchFromMonitoring, which will return an undefined response and data
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.
removed
} catch { | ||
connections.monitoring.errors = [`Error SC Monitoring instance at ${monitoringUrl.value}connection`]; | ||
return null; | ||
return undefined; |
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.
does not returning anything also return undefined implicitly? That's what's happening currently if the if clause above returns 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.
also in getServiceControlConnection this same pattern is returning null rather than undefined, should be consistent
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.
fixed, anything else @PhilBastian ?
} catch { | ||
return null; | ||
} | ||
} catch {} |
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 try/catch
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.
should we rename the function? It's not getting the monitoring version, it's setting it in the environment settings
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.
fixed and renamed
@@ -63,6 +77,8 @@ function edit() { | |||
function close() { | |||
emit("cancel"); | |||
} | |||
|
|||
function save() {} |
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.
?
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.
need to figure that one out!
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.
This seems to be broken in master
ServicePulse/src/ServicePulse.Host/vue/src/components/configuration/RetryRedirectEdit.vue
Line 77 in fee0e35
<form name="redirectForm" novalidate @submit.prevent="save"> |
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.
I actually think this fix is ok, it seems the logic is in the onclick of the buttons.
Thoughts @PhilBastian ?
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.
shouldn't the call save on submit logic be removed? I would guess whomever migrated this originally intended to have it have form submit functionality (which isn't in angular), and then forgot
} | ||
|
||
interface MetricsConnectionDetails { | ||
Enabled: boolean; |
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.
should be camelCase
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.
The payload from the server is not camelCase, see https://particularsoftware.slack.com/archives/C368VHCTT/p1706660541812479
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.
could use https://www.npmjs.com/package/camelcase-keys on the API response (on all API responses to be consistent)
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.
possibly, or we fix the server side 😄
//NOTE to eliminate success msg showing everytime the screen is refreshed | ||
if (newValue !== oldValue) { | ||
if (newValue) { | ||
useShowToast(TYPE.ERROR, "Error", "Could not connect to ServiceControl at " + serviceControlUrl.value + '. <a class="btn btn-default" href="/#/configuration/connections">View connection settings</a>'); |
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.
convert to interpolation
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.
Fixed
//NOTE to eliminate success msg showing everytime the screen is refreshed | ||
if (newValue !== oldValue) { | ||
if (newValue) { | ||
useShowToast(TYPE.ERROR, "Error", "Could not connect to the ServiceControl Monitoring service at " + monitoringUrl.value + '. <a class="btn btn-default" href="/#/configuration/connections">View connection settings</a>'); |
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.
convert to interpolation
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.
Fixed
This PR pretty much migrates all remaining areas with the exception of "Failed Messages" area.
As part of this PR, I also removed the calls to initialise certain services fromApp.vue
, which means we rely on modules to execute them.Reverted ☝️