mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-19 13:41:10 +02:00
* Create date-range component with tests * update selectors and callback behavior * update cc tests & selectors * cleanup * RIP calendar-widget and date-dropdown -- you were good components * reset on close * Add changelog * use parseApiTimestamp * fix test * cleanup * make date-range typescript, update behavior * add words * minor styling * fix test
54 lines
2.2 KiB
TypeScript
54 lines
2.2 KiB
TypeScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
// TODO: separate nested into distinct exported consts
|
|
export const CLIENT_COUNT = {
|
|
counts: {
|
|
description: '[data-test-counts-description]',
|
|
configDisabled: '[data-test-counts-disabled]',
|
|
namespaces: '[data-test-counts-namespaces]',
|
|
mountPaths: '[data-test-counts-auth-mounts]',
|
|
startDiscrepancy: '[data-test-counts-start-discrepancy]',
|
|
},
|
|
dateRange: {
|
|
dateDisplay: (name: string) => (name ? `[data-test-date-range="${name}"]` : '[data-test-date-range]'),
|
|
set: '[data-test-set-date-range]',
|
|
edit: '[data-test-date-range-edit]',
|
|
editModal: '[data-test-date-range-edit-modal]',
|
|
editDate: (name: string) => `[data-test-date-edit="${name}"]`,
|
|
reset: '[data-test-date-edit="reset"]',
|
|
defaultRangeAlert: '[data-test-range-default-alert]',
|
|
validation: '[data-test-date-range-validation]',
|
|
},
|
|
statText: (label: string) => `[data-test-stat-text="${label}"]`,
|
|
statTextValue: (label: string) =>
|
|
label ? `[data-test-stat-text="${label}"] .stat-value` : '[data-test-stat-text]',
|
|
usageStats: (title: string) => `[data-test-usage-stats="${title}"]`,
|
|
attributionBlock: '[data-test-clients-attribution]',
|
|
filterBar: '[data-test-clients-filter-bar]',
|
|
selectedAuthMount: 'div#mounts-search-select [data-test-selected-option] div',
|
|
selectedNs: 'div#namespace-search-select [data-test-selected-option] div',
|
|
upgradeWarning: '[data-test-clients-upgrade-warning]',
|
|
};
|
|
|
|
export const CHARTS = {
|
|
// container
|
|
container: (title: string) => `[data-test-chart-container="${title}"]`,
|
|
timestamp: '[data-test-chart-container-timestamp]',
|
|
legend: '[data-test-chart-container-legend]',
|
|
legendLabel: (nth: number) => `.legend-label:nth-child(${nth * 2})`, // nth * 2 accounts for dots in legend
|
|
|
|
// chart elements
|
|
chart: (title: string) => `[data-test-chart="${title}"]`,
|
|
hover: (area: string) => `[data-test-interactive-area="${area}"]`,
|
|
table: '[data-test-underlying-data]',
|
|
tooltip: '[data-test-tooltip]',
|
|
verticalBar: '[data-test-vertical-bar]',
|
|
xAxis: '[data-test-x-axis]',
|
|
yAxis: '[data-test-y-axis]',
|
|
xAxisLabel: '[data-test-x-axis] text',
|
|
plotPoint: '[data-test-plot-point]',
|
|
};
|