Skip to content

Commit

Permalink
[PLAT-14869][PLAT-14986][PLAT-14998][PLAT-15003] - ui improvements an…
Browse files Browse the repository at this point in the history
…d fixes

Summary:
**[PLAT-14869]** - Add a helper message in tooltip for pg audit log level.

**[PLAT-14986]** - Hide Logs Tab if YSQL is disabled for that universe.

**[PLAT-14998]** - Remove Learn More link form Edit PG Compatibility Dialog Box as it doesn't redirect to any page.

**[PLAT-15003]** - Integrate Runtime config to hide Download metrics button.

Other - Change tab name from CDC Replication Slots to CDC

Test Plan: Tested manually

Reviewers: kkannan

Reviewed By: kkannan

Subscribers: ui, yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D37404
  • Loading branch information
Lingeshwar committed Aug 21, 2024
1 parent d1576c4 commit 02da1f0
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { YBButton, YBButtonLink } from '../../common/forms/fields';
import { YBPanelItem } from '../../panels';
import { FlexContainer, FlexGrow } from '../../common/flexbox/YBFlexBox';
import CustomerMetricsPanel from '../CustomerMetricsPanel/CustomerMetricsPanel';
import { YBModal, YBProgress } from '../../../redesign/components';
import { getPromiseState } from '../../../utils/PromiseUtils';
import { isValidObject, isNonEmptyObject } from '../../../utils/ObjectUtils';
import { isDedicatedNodePlacement, isKubernetesUniverse } from '../../../utils/UniverseUtils';
Expand All @@ -37,8 +38,8 @@ import { CustomDatePicker } from '../CustomDatePicker/CustomDatePicker';
import { MetricsMeasureSelector } from '../MetricsMeasureSelector/MetricsMeasureSelector';
import { OutlierSelector } from '../OutlierSelector/OutlierSelector';
import { ybFormatDate } from '../../../redesign/helpers/DateUtils';
import { RuntimeConfigKey } from '../../../redesign/helpers/constants';
import './GraphPanelHeader.scss';
import { YBModal, YBProgress } from '../../../redesign/components';

require('react-widgets/dist/css/react-widgets.css');

Expand Down Expand Up @@ -562,7 +563,8 @@ class GraphPanelHeader extends Component {
closeModal,
visibleModal,
enableNodeComparisonModal,
printMode
printMode,
customer: { customerRuntimeConfigs }
} = this.props;
const {
filterType,
Expand All @@ -589,6 +591,11 @@ class GraphPanelHeader extends Component {
);
}

const isDownloadMetricsAllowed =
customerRuntimeConfigs?.data?.configEntries?.find(
(config) => config.key === RuntimeConfigKey.DOWNLOAD_METRICS_PDF
)?.value === 'true';

const self = this;
const menuItems = filterTypes.map((filter, idx) => {
const key = 'graph-filter-' + idx;
Expand Down Expand Up @@ -738,16 +745,18 @@ class GraphPanelHeader extends Component {
onClick={this.refreshGraphQuery}
/>
 
<YBButton
btnText="Download Metrics"
onClick={() => {
this.setState({
openPreviewMetricsModal: true,
pdfDownloadInProgress: false,
downloadPercent: 0
});
}}
/>
{isDownloadMetricsAllowed && (
<YBButton
btnText="Download Metrics"
onClick={() => {
this.setState({
openPreviewMetricsModal: true,
pdfDownloadInProgress: false,
downloadPercent: 0
});
}}
/>
)}
</div>
<Dropdown
id="graphSettingDropdown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ class UniverseDetail extends Component {
universe?.currentUniverse?.data?.universeDetails?.clusters
);
const useSystemd = primaryCluster?.userIntent?.useSystemd;
const isYSQLEnabledInUniverse = primaryCluster?.userIntent?.enableYSQL;
const isReadOnlyUniverse =
getPromiseState(currentUniverse).isSuccess() &&
currentUniverse.data.universeDetails.capability === 'READ_ONLY';
Expand Down Expand Up @@ -685,7 +686,7 @@ class UniverseDetail extends Component {
...(isReadOnlyUniverse
? []
: [
!isItKubernetesUniverse && isAuditLogEnabled && (
!isItKubernetesUniverse && isAuditLogEnabled && isYSQLEnabledInUniverse && (
<Tab.Pane
eventKey={'db-audit-log'}
tabtitle="Logs"
Expand All @@ -712,7 +713,7 @@ class UniverseDetail extends Component {
featureFlags.test.showReplicationSlots) && (
<Tab.Pane
eventKey={'replication-slots'}
tabtitle="CDC Replication Slots"
tabtitle="CDC"
key="ReplicationSlots-tab"
mountOnEnter={true}
unmountOnExit={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ export const EditPGCompatibilityModal: FC<PGCompatibilityModalProps> = ({
</li>
<li>{t('universeActions.pgCompatibility.disableWarning3')}</li>
</ul>
<Link underline="always" className={classes.learnLink}>
{/* <Link underline="always" className={classes.learnLink}>
{t('common.learnMore')}
</Link>
</Link> */}
</Typography>
</Box>
)}
Expand Down
3 changes: 2 additions & 1 deletion managed/ui/src/redesign/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export const RuntimeConfigKey = {
KUBERNETES_DEFAULT_VOLUME_SIZE: 'yb.kubernetes.default_volume_size_gb',
AZURE_DEFAULT_VOLUME_SIZE: 'yb.azure.default_volume_size_gb',
AZURE_DEFAULT_STORAGE_TYPE: 'yb.azure.storage.default_storage_type',
AZURE_PREMIUM_V2_STORAGE_TYPE: 'yb.azure.show_premiumv2_storage_type'
AZURE_PREMIUM_V2_STORAGE_TYPE: 'yb.azure.show_premiumv2_storage_type',
DOWNLOAD_METRICS_PDF: 'yb.ui.metrics.enable_download_pdf'
} as const;

/**
Expand Down
2 changes: 1 addition & 1 deletion managed/ui/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,7 @@
"tooltips": {
"logCatalog": "Log statements for the PostgreSQL system catalog relations in pg_catalog. Disable this option to reduce noise in the log.",
"logClient": "Log messages directly to clients such as ysqlsh and psql for debugging. When enabled, you can set the level of logs that are output using pgaudit.log_client.",
"logLevel": "Set the severity level of logs displayed in clients when pgaudit.log_client is on.",
"logLevel": "Set the severity level of logs displayed in clients when pgaudit.log_client is on.Will need to set an extra flag log_min_messages for all the severity levels to work. By default only LOG or WARNING will work without needing the flag log_min_messages",
"logParameter": "Include parameters passed with the statement. Parameters are provided in .csv format after the statement text.",
"logParameterMaxSize": "Maximum size, in bytes, of parameters to include. Parameters longer than this value are replaced with <long param suppressed>.",
"logRelation": "Create separate log entries for each relation (TABLE, VIEW, etc.) referenced in a SELECT or DML statement. This is a shortcut for exhaustive logging without using object audit logging.",
Expand Down

0 comments on commit 02da1f0

Please sign in to comment.