Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const getInstanceData = (instanceType, credentials) => {
return instance;
};

const getAdditionalOptions = (type, form) => {
const getAdditionalOptions = (type, remoteInstanceCredentials, form) => {
switch (type) {
case 'PostgreSQL':
return (
Expand All @@ -70,6 +70,20 @@ const getAdditionalOptions = (type, form) => {
</>
);
case 'MySQL':
if (remoteInstanceCredentials.isRDS) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about this? @lunaticusgreen

Suggested change
if (remoteInstanceCredentials.isRDS) {
return (
<>
<CheckboxField form={form} label={'Use performance schema'} name="qan_mysql_perfschema" />
<span className="description"></span>
(remoteInstanceCredentials.isRDS ? (
<CheckboxField form={form} label={'Disable Basic Metrics'} name="disable_basic_metrics" />
<span className="description"></span>
<CheckboxField form={form} label={'Disable Enhanced Metrics'} name="disable_enhanced_metrics" />
<span className="description"></span>
) : (Null))
</>
);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BupycHuk
There is no such thing as (Null) in js. What dit you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks ok, but instead of Null you have to use null

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null

return (
<>
<CheckboxField form={form} label="Use performance schema" name="qan_mysql_perfschema" />
<span className="description"></span>

<CheckboxField form={form} label="Disable Basic Metrics" name="disable_basic_metrics" />
<span className="description"></span>

<CheckboxField form={form} label="Disable Enhanced Metrics" name="disable_enhanced_metrics" />
<span className="description"></span>
</>
);
}
return (
<>
<CheckboxField form={form} label="Use performance schema" name="qan_mysql_perfschema" />
Expand Down Expand Up @@ -250,7 +264,7 @@ key2:value2"
data-cy="add-account-username"
/>
<span className="description"></span>
{getAdditionalOptions(instanceType, form)}
{getAdditionalOptions(instanceType, remoteInstanceCredentials, form)}
</div>

<div className="add-instance-form__submit-block">
Expand Down