chore: apply capitalization guidelines - iteration 1 (#12447)

Apply capitalization guidelines defined in #12343 

Use sentence casing for most places.
This commit is contained in:
Michael S. Molina 2021-01-12 15:47:55 -03:00 committed by GitHub
parent ed53b0090e
commit 6731cd0be6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 33 additions and 33 deletions

View File

@ -83,7 +83,7 @@ describe('getControlsForVizType', () => {
JSON.stringify({ JSON.stringify({
label_colors: { label_colors: {
type: 'ColorMapControl', type: 'ColorMapControl',
label: t('Color Map'), label: t('Color map'),
default: {}, default: {},
renderTrigger: true, renderTrigger: true,
mapStateToProps: state => ({ mapStateToProps: state => ({

View File

@ -301,7 +301,7 @@ export function runAnnotationQuery(
dispatch( dispatch(
annotationQueryFailed( annotationQueryFailed(
annotation, annotation,
{ error: 'Query Timeout' }, { error: 'Query timeout' },
sliceKey, sliceKey,
), ),
); );

View File

@ -38,14 +38,14 @@ import Collapse from './Collapse';
import { CronPicker, CronError } from './CronPicker'; import { CronPicker, CronError } from './CronPicker';
export default { export default {
title: 'Common Components', title: 'Common components',
decorators: [withKnobs], decorators: [withKnobs],
}; };
export const StyledModal = () => ( export const StyledModal = () => (
<Modal <Modal
disablePrimaryButton={false} disablePrimaryButton={false}
onHandledPrimaryAction={action('Primary Action')} onHandledPrimaryAction={action('Primary action')}
primaryButtonName="Danger" primaryButtonName="Danger"
primaryButtonType="danger" primaryButtonType="danger"
show show
@ -65,14 +65,14 @@ export const StyledTabs = () => (
<Tabs.TabPane <Tabs.TabPane
tab="Tab 1" tab="Tab 1"
key="1" key="1"
disabled={boolean('Tab 1 Disabled', false)} disabled={boolean('Tab 1 disabled', false)}
> >
Tab 1 Content! Tab 1 Content!
</Tabs.TabPane> </Tabs.TabPane>
<Tabs.TabPane <Tabs.TabPane
tab="Tab 2" tab="Tab 2"
key="2" key="2"
disabled={boolean('Tab 2 Disabled', false)} disabled={boolean('Tab 2 disabled', false)}
> >
Tab 2 Content! Tab 2 Content!
</Tabs.TabPane> </Tabs.TabPane>
@ -88,14 +88,14 @@ export const StyledEditableTabs = () => (
<Tabs.TabPane <Tabs.TabPane
tab="Tab 1" tab="Tab 1"
key="1" key="1"
disabled={boolean('Tab 1 Disabled', false)} disabled={boolean('Tab 1 disabled', false)}
> >
Tab 1 Content! Tab 1 Content!
</Tabs.TabPane> </Tabs.TabPane>
<Tabs.TabPane <Tabs.TabPane
tab="Tab 2" tab="Tab 2"
key="2" key="2"
disabled={boolean('Tab 2 Disabled', false)} disabled={boolean('Tab 2 disabled', false)}
> >
Tab 2 Content! Tab 2 Content!
</Tabs.TabPane> </Tabs.TabPane>
@ -123,7 +123,7 @@ export const TabsWithDropdownMenu = () => (
</> </>
} }
key="1" key="1"
disabled={boolean('Tab 1 Disabled', false)} disabled={boolean('Tab 1 disabled', false)}
> >
Tab 1 Content! Tab 1 Content!
</Tabs.TabPane> </Tabs.TabPane>

View File

@ -85,7 +85,7 @@ class AnchorLink extends React.PureComponent {
filters, filters,
anchorLinkId, anchorLinkId,
)} )}
emailSubject={t('Superset Chart')} emailSubject={t('Superset chart')}
emailContent={t('Check out this chart in dashboard:')} emailContent={t('Check out this chart in dashboard:')}
placement={placement} placement={placement}
/> />

View File

@ -178,7 +178,7 @@ export default function EditableTitle({
label="title" label="title"
tooltip={ tooltip={
canEdit canEdit
? t('click to edit') ? t('Click to edit')
: noPermitTooltip || : noPermitTooltip ||
t("You don't have the rights to alter this title.") t("You don't have the rights to alter this title.")
} }

View File

@ -41,7 +41,7 @@ const getDashboards = query =>
})), })),
) )
.catch(() => ({ .catch(() => ({
title: t('An error occurred while fethching Dashboards'), title: t('An error occurred while fetching dashboards'),
})); }));
const OmniModal = styled(Modal)` const OmniModal = styled(Modal)`

View File

@ -60,7 +60,7 @@ const guessFrame = (timeRange: string): FrameType => {
return 'Calendar'; return 'Calendar';
} }
if (timeRange === 'No filter') { if (timeRange === 'No filter') {
return 'No Filter'; return 'No filter';
} }
if (customTimeRangeDecode(timeRange).matchedFlag) { if (customTimeRangeDecode(timeRange).matchedFlag) {
return 'Custom'; return 'Custom';
@ -251,7 +251,7 @@ export default function DateFilterControl(props: DateFilterLabelProps) {
}; };
function onFrame(option: SelectOptionType) { function onFrame(option: SelectOptionType) {
if (option.value === 'No Filter') { if (option.value === 'No filter') {
setTimeRangeValue('No filter'); setTimeRangeValue('No filter');
} }
setFrame(option.value as FrameType); setFrame(option.value as FrameType);
@ -266,7 +266,7 @@ export default function DateFilterControl(props: DateFilterLabelProps) {
onChange={onFrame} onChange={onFrame}
className="frame-dropdown" className="frame-dropdown"
/> />
{frame !== 'No Filter' && <Divider />} {frame !== 'No filter' && <Divider />}
{frame === 'Common' && ( {frame === 'Common' && (
<CommonFrame value={timeRangeValue} onChange={setTimeRangeValue} /> <CommonFrame value={timeRangeValue} onChange={setTimeRangeValue} />
)} )}
@ -279,10 +279,10 @@ export default function DateFilterControl(props: DateFilterLabelProps) {
{frame === 'Custom' && ( {frame === 'Custom' && (
<CustomFrame value={timeRangeValue} onChange={setTimeRangeValue} /> <CustomFrame value={timeRangeValue} onChange={setTimeRangeValue} />
)} )}
{frame === 'No Filter' && <div data-test="no-filter" />} {frame === 'No filter' && <div data-test="no-filter" />}
<Divider /> <Divider />
<div> <div>
<div className="section-title">{t('Actual Time Range')}</div> <div className="section-title">{t('Actual time range')}</div>
{validTimeRange && <div>{evalResponse}</div>} {validTimeRange && <div>{evalResponse}</div>}
{!validTimeRange && ( {!validTimeRange && (
<IconWrapper className="warning"> <IconWrapper className="warning">
@ -321,7 +321,7 @@ export default function DateFilterControl(props: DateFilterLabelProps) {
const title = ( const title = (
<IconWrapper> <IconWrapper>
<Icon name="edit-alt" /> <Icon name="edit-alt" />
<span className="text">{t('Edit Time Range')}</span> <span className="text">{t('Edit time range')}</span>
</IconWrapper> </IconWrapper>
); );

View File

@ -32,7 +32,7 @@ export const FRAME_OPTIONS: SelectOptionType[] = [
{ value: 'Calendar', label: t('Previous') }, { value: 'Calendar', label: t('Previous') },
{ value: 'Custom', label: t('Custom') }, { value: 'Custom', label: t('Custom') },
{ value: 'Advanced', label: t('Advanced') }, { value: 'Advanced', label: t('Advanced') },
{ value: 'No Filter', label: t('No Filter') }, { value: 'No filter', label: t('No filter') },
]; ];
export const COMMON_RANGE_OPTIONS: SelectOptionType[] = [ export const COMMON_RANGE_OPTIONS: SelectOptionType[] = [

View File

@ -26,7 +26,7 @@ export type FrameType =
| 'Calendar' | 'Calendar'
| 'Custom' | 'Custom'
| 'Advanced' | 'Advanced'
| 'No Filter'; | 'No filter';
export type DateTimeGrainType = export type DateTimeGrainType =
| 'second' | 'second'

View File

@ -77,11 +77,11 @@ export const sqlaAutoGeneratedMetricRegex = /^(LONG|DOUBLE|FLOAT)?(SUM|AVG|MAX|M
export const druidAutoGeneratedMetricRegex = /^(LONG|DOUBLE|FLOAT)?(SUM|MAX|MIN|COUNT)\([A-Z0-9_."]*\)$/i; export const druidAutoGeneratedMetricRegex = /^(LONG|DOUBLE|FLOAT)?(SUM|MAX|MIN|COUNT)\([A-Z0-9_."]*\)$/i;
export const TIME_FILTER_LABELS = { export const TIME_FILTER_LABELS = {
time_range: t('Time Range'), time_range: t('Time range'),
granularity_sqla: t('Time Column'), granularity_sqla: t('Time column'),
time_grain_sqla: t('Time Grain'), time_grain_sqla: t('Time grain'),
druid_time_origin: t('Origin'), druid_time_origin: t('Origin'),
granularity: t('Time Granularity'), granularity: t('Time granularity'),
}; };
export const FILTER_CONFIG_ATTRIBUTES = { export const FILTER_CONFIG_ATTRIBUTES = {

View File

@ -203,13 +203,13 @@ export const controls = {
viz_type: { viz_type: {
type: 'VizTypeControl', type: 'VizTypeControl',
label: t('Visualization Type'), label: t('Visualization type'),
default: 'table', default: 'table',
description: t('The type of visualization to display'), description: t('The type of visualization to display'),
}, },
color_picker: { color_picker: {
label: t('Fixed Color'), label: t('Fixed color'),
description: t('Use this to define a static color for all circles'), description: t('Use this to define a static color for all circles'),
type: 'ColorPickerControl', type: 'ColorPickerControl',
default: PRIMARY_COLOR, default: PRIMARY_COLOR,
@ -218,14 +218,14 @@ export const controls = {
metric_2: { metric_2: {
...metric, ...metric,
label: t('Right Axis Metric'), label: t('Right axis metric'),
clearable: true, clearable: true,
description: t('Choose a metric for right axis'), description: t('Choose a metric for right axis'),
}, },
linear_color_scheme: { linear_color_scheme: {
type: 'ColorSchemeControl', type: 'ColorSchemeControl',
label: t('Linear Color Scheme'), label: t('Linear color scheme'),
choices: () => choices: () =>
sequentialSchemeRegistry.values().map(value => [value.id, value.label]), sequentialSchemeRegistry.values().map(value => [value.id, value.label]),
default: sequentialSchemeRegistry.getDefaultKey(), default: sequentialSchemeRegistry.getDefaultKey(),
@ -238,7 +238,7 @@ export const controls = {
secondary_metric: { secondary_metric: {
...metric, ...metric,
label: t('Color Metric'), label: t('Color metric'),
default: null, default: null,
validators: [], validators: [],
description: t('A metric to use for color'), description: t('A metric to use for color'),
@ -385,7 +385,7 @@ export const controls = {
timeseries_limit_metric: { timeseries_limit_metric: {
type: 'MetricsControl', type: 'MetricsControl',
label: t('Sort By'), label: t('Sort by'),
default: null, default: null,
clearable: true, clearable: true,
description: t('Metric used to define the top series'), description: t('Metric used to define the top series'),
@ -433,7 +433,7 @@ export const controls = {
size: { size: {
...metric, ...metric,
label: t('Bubble Size'), label: t('Bubble size'),
default: null, default: null,
}, },
@ -479,7 +479,7 @@ export const controls = {
color_scheme: { color_scheme: {
type: 'ColorSchemeControl', type: 'ColorSchemeControl',
label: t('Color Scheme'), label: t('Color scheme'),
default: categoricalSchemeRegistry.getDefaultKey(), default: categoricalSchemeRegistry.getDefaultKey(),
renderTrigger: true, renderTrigger: true,
choices: () => categoricalSchemeRegistry.keys().map(s => [s, s]), choices: () => categoricalSchemeRegistry.keys().map(s => [s, s]),
@ -489,7 +489,7 @@ export const controls = {
label_colors: { label_colors: {
type: 'ColorMapControl', type: 'ColorMapControl',
label: t('Color Map'), label: t('Color map'),
default: {}, default: {},
renderTrigger: true, renderTrigger: true,
mapStateToProps: state => ({ mapStateToProps: state => ({