UI text edits (#32524)

* Update TeamSettings.tsx

* Update navModel.ts

* Update ChangePasswordForm.tsx

* Update UserProfileEditForm.tsx

* Update DashboardImportPage.tsx

* Update uploadDashboardDirective.ts

* Update ImportDashboardForm.tsx

* Update ImportDashboardOverview.tsx

* Update validation.ts

* Update PlaylistEditPage.tsx

* ui text edits

* text edits

* Update buildCategories.ts

* text edits

* text edits

* Fix formatting

* Update test snapshots

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
This commit is contained in:
Diana Payton
2021-03-31 16:07:37 -07:00
committed by GitHub
parent dc791c4121
commit 1399b49c16
31 changed files with 56 additions and 56 deletions

View File

@ -37,7 +37,7 @@ export interface Props {
} }
const emptyListModel = { const emptyListModel = {
title: 'There are no data sources defined yet', title: 'No data sources defined',
buttonIcon: 'database' as IconName, buttonIcon: 'database' as IconName,
buttonLink: 'datasources/new', buttonLink: 'datasources/new',
buttonTitle: 'Add data source', buttonTitle: 'Add data source',

View File

@ -103,8 +103,8 @@ class NewDataSourcePage extends PureComponent<Props> {
<> <>
<br /> <br />
<p> <p>
Note that <strong>unsigned front-end datasource plugins</strong> are still usable, but this is subject Note that unsigned front-end data source plugins are still usable, but this is subject to change in
to change in the upcoming releases of Grafana the upcoming releases of Grafana.
</p> </p>
</> </>
</PluginsErrorsInfo> </PluginsErrorsInfo>

View File

@ -18,7 +18,7 @@ const BasicSettings: FC<Props> = ({ dataSourceName, isDefault, onDefaultChange,
<div className="gf-form max-width-30" style={{ marginRight: '3px' }}> <div className="gf-form max-width-30" style={{ marginRight: '3px' }}>
<InlineFormLabel <InlineFormLabel
tooltip={ tooltip={
'The name is used when you select the data source in panels. The Default data source is ' + 'The name is used when you select the data source in panels. The default data source is ' +
'preselected in new panels.' 'preselected in new panels.'
} }
> >

View File

@ -21,7 +21,7 @@ const ButtonRow: FC<Props> = ({ isReadOnly, onDelete, onSubmit, onTest }) => {
onClick={(event) => onSubmit(event)} onClick={(event) => onSubmit(event)}
aria-label={selectors.pages.DataSource.saveAndTest} aria-label={selectors.pages.DataSource.saveAndTest}
> >
Save &amp; Test Save &amp; test
</button> </button>
)} )}
{isReadOnly && ( {isReadOnly && (

View File

@ -56,7 +56,7 @@ export const CloudInfoBox: FC<Props> = ({ dataSource }) => {
}} }}
> >
<div className={styles.text}> <div className={styles.text}>
Or skip the effort and get {mainDS} (and {extraDS}) as fully managed, scalable and hosted data sources Or skip the effort and get {mainDS} (and {extraDS}) as fully-managed, scalable, and hosted data sources
from Grafana Labs with the{' '} from Grafana Labs with the{' '}
<a <a
className="external-link" className="external-link"

View File

@ -197,7 +197,7 @@ export class DataSourceSettingsPage extends PureComponent<Props> {
} }
} }
return <div>Page Not Found: {page}</div>; return <div>Page not found: {page}</div>;
} }
renderSettings() { renderSettings() {

View File

@ -46,7 +46,7 @@ export class PluginSettings extends PureComponent<Props> {
if (!plugin.components.ConfigEditor) { if (!plugin.components.ConfigEditor) {
// React editor is not specified, let's render angular editor // React editor is not specified, let's render angular editor
// How to apprach this better? Introduce ReactDataSourcePlugin interface and typeguard it here? // How to approach this better? Introduce ReactDataSourcePlugin interface and typeguard it here?
const loader = getAngularLoader(); const loader = getAngularLoader();
const template = '<plugin-component type="datasource-config-ctrl" />'; const template = '<plugin-component type="datasource-config-ctrl" />';

View File

@ -17,7 +17,7 @@ exports[`Render should render component 1`] = `
} }
> >
<FormLabel <FormLabel
tooltip="The name is used when you select the data source in panels. The Default data source is preselected in new panels." tooltip="The name is used when you select the data source in panels. The default data source is preselected in new panels."
> >
Name Name
</FormLabel> </FormLabel>

View File

@ -40,7 +40,7 @@ exports[`Render should render with buttons enabled 1`] = `
onClick={[Function]} onClick={[Function]}
type="submit" type="submit"
> >
Save & Test Save & test
</button> </button>
<button <button
aria-label="Data source settings page Delete button" aria-label="Data source settings page Delete button"

View File

@ -98,7 +98,7 @@ export const testDataSource = (
let message = ''; let message = '';
if (err.statusText) { if (err.statusText) {
message = 'HTTP Error ' + err.statusText; message = 'HTTP error ' + err.statusText;
} else { } else {
message = err.message; message = err.message;
} }

View File

@ -99,60 +99,60 @@ function getEnterprisePhantomPlugins(): DataSourcePluginMeta[] {
getPhantomPlugin({ getPhantomPlugin({
id: 'grafana-splunk-datasource', id: 'grafana-splunk-datasource',
name: 'Splunk', name: 'Splunk',
description: 'Visualize & explore Splunk logs', description: 'Visualize and explore Splunk logs',
imgUrl: 'public/img/plugins/splunk_logo_128.png', imgUrl: 'public/img/plugins/splunk_logo_128.png',
}), }),
getPhantomPlugin({ getPhantomPlugin({
id: 'grafana-oracle-datasource', id: 'grafana-oracle-datasource',
name: 'Oracle', name: 'Oracle',
description: 'Visualize & explore Oracle SQL', description: 'Visualize and explore Oracle SQL',
imgUrl: 'public/img/plugins/oracle.png', imgUrl: 'public/img/plugins/oracle.png',
}), }),
getPhantomPlugin({ getPhantomPlugin({
id: 'grafana-dynatrace-datasource', id: 'grafana-dynatrace-datasource',
name: 'Dynatrace', name: 'Dynatrace',
description: 'Visualize & explore Dynatrace data', description: 'Visualize and explore Dynatrace data',
imgUrl: 'public/img/plugins/dynatrace.png', imgUrl: 'public/img/plugins/dynatrace.png',
}), }),
getPhantomPlugin({ getPhantomPlugin({
id: 'grafana-servicenow-datasource', id: 'grafana-servicenow-datasource',
description: 'ServiceNow integration & data source', description: 'ServiceNow integration and data source',
name: 'ServiceNow', name: 'ServiceNow',
imgUrl: 'public/img/plugins/servicenow.svg', imgUrl: 'public/img/plugins/servicenow.svg',
}), }),
getPhantomPlugin({ getPhantomPlugin({
id: 'grafana-datadog-datasource', id: 'grafana-datadog-datasource',
description: 'DataDog integration & data source', description: 'DataDog integration and data source',
name: 'DataDog', name: 'DataDog',
imgUrl: 'public/img/plugins/datadog.png', imgUrl: 'public/img/plugins/datadog.png',
}), }),
getPhantomPlugin({ getPhantomPlugin({
id: 'grafana-newrelic-datasource', id: 'grafana-newrelic-datasource',
description: 'New Relic integration & data source', description: 'New Relic integration and data source',
name: 'New Relic', name: 'New Relic',
imgUrl: 'public/img/plugins/newrelic.svg', imgUrl: 'public/img/plugins/newrelic.svg',
}), }),
getPhantomPlugin({ getPhantomPlugin({
id: 'grafana-mongodb-datasource', id: 'grafana-mongodb-datasource',
description: 'MongoDB integration & data source', description: 'MongoDB integration and data source',
name: 'MongoDB', name: 'MongoDB',
imgUrl: 'public/img/plugins/mongodb.svg', imgUrl: 'public/img/plugins/mongodb.svg',
}), }),
getPhantomPlugin({ getPhantomPlugin({
id: 'grafana-snowflake-datasource', id: 'grafana-snowflake-datasource',
description: 'Snowflake integration & data source', description: 'Snowflake integration and data source',
name: 'Snowflake', name: 'Snowflake',
imgUrl: 'public/img/plugins/snowflake.svg', imgUrl: 'public/img/plugins/snowflake.svg',
}), }),
getPhantomPlugin({ getPhantomPlugin({
id: 'grafana-wavefront-datasource', id: 'grafana-wavefront-datasource',
description: 'Wavefront integration & data source', description: 'Wavefront integration and data source',
name: 'Wavefront', name: 'Wavefront',
imgUrl: 'public/img/plugins/wavefront.svg', imgUrl: 'public/img/plugins/wavefront.svg',
}), }),
getPhantomPlugin({ getPhantomPlugin({
id: 'dlopes7-appdynamics-datasource', id: 'dlopes7-appdynamics-datasource',
description: 'AppDynamics integration & data source', description: 'AppDynamics integration and data source',
name: 'AppDynamics', name: 'AppDynamics',
imgUrl: 'public/img/plugins/appdynamics.svg', imgUrl: 'public/img/plugins/appdynamics.svg',
}), }),
@ -167,7 +167,7 @@ function getGrafanaCloudPhantomPlugin(): DataSourcePluginMeta {
module: 'phantom', module: 'phantom',
baseUrl: '', baseUrl: '',
info: { info: {
description: 'Hosted Graphite, Prometheus and Loki', description: 'Hosted Graphite, Prometheus, and Loki',
logos: { small: 'public/img/grafana_icon.svg', large: 'asd' }, logos: { small: 'public/img/grafana_icon.svg', large: 'asd' },
author: { name: 'Grafana Labs' }, author: { name: 'Grafana Labs' },
links: [ links: [

View File

@ -85,7 +85,7 @@ export class FolderSettingsPage extends PureComponent<Props, State> {
return ( return (
<Page navModel={navModel}> <Page navModel={navModel}>
<Page.Contents isLoading={this.state.isLoading}> <Page.Contents isLoading={this.state.isLoading}>
<h3 className="page-sub-heading">Folder Settings</h3> <h3 className="page-sub-heading">Folder settings</h3>
<div className="section gf-form-group"> <div className="section gf-form-group">
<form name="folderSettingsForm" onSubmit={this.onSave}> <form name="folderSettingsForm" onSubmit={this.onSave}>

View File

@ -10,7 +10,7 @@ exports[`Render should enable save button 1`] = `
<h3 <h3
className="page-sub-heading" className="page-sub-heading"
> >
Folder Settings Folder settings
</h3> </h3>
<div <div
className="section gf-form-group" className="section gf-form-group"
@ -68,7 +68,7 @@ exports[`Render should render component 1`] = `
<h3 <h3
className="page-sub-heading" className="page-sub-heading"
> >
Folder Settings Folder settings
</h3> </h3>
<div <div
className="section gf-form-group" className="section gf-form-group"

View File

@ -5,7 +5,7 @@ export function buildNavModel(folder: FolderDTO): NavModelItem {
const model = { const model = {
icon: 'folder', icon: 'folder',
id: 'manage-folder', id: 'manage-folder',
subTitle: 'Manage folder dashboards & permissions', subTitle: 'Manage folder dashboards and permissions',
url: '', url: '',
text: folder.title, text: folder.title,
breadcrumbs: [{ title: 'Dashboards', url: 'dashboards' }], breadcrumbs: [{ title: 'Dashboards', url: 'dashboards' }],

View File

@ -88,10 +88,10 @@ class DashboardImportUnConnected extends PureComponent<Props> {
<Field invalid={!!errors.gcomDashboard} error={errors.gcomDashboard && errors.gcomDashboard.message}> <Field invalid={!!errors.gcomDashboard} error={errors.gcomDashboard && errors.gcomDashboard.message}>
<Input <Input
name="gcomDashboard" name="gcomDashboard"
placeholder="Grafana.com dashboard url or id" placeholder="Grafana.com dashboard URL or ID"
type="text" type="text"
ref={register({ ref={register({
required: 'A Grafana dashboard url or id is required', required: 'A Grafana dashboard URL or ID is required',
validate: validateGcomDashboard, validate: validateGcomDashboard,
})} })}
addonAfter={<Button type="submit">Load</Button>} addonAfter={<Button type="submit">Load</Button>}
@ -109,7 +109,7 @@ class DashboardImportUnConnected extends PureComponent<Props> {
<TextArea <TextArea
name="dashboardJson" name="dashboardJson"
ref={register({ ref={register({
required: 'Need a dashboard json model', required: 'Need a dashboard JSON model',
validate: validateDashboardJson, validate: validateDashboardJson,
})} })}
rows={10} rows={10}

View File

@ -74,9 +74,9 @@ export const ImportDashboardForm: FC<Props> = ({
/> />
</Field> </Field>
<Field <Field
label="Unique identifier (uid)" label="Unique identifier (UID)"
description="The unique identifier (uid) of a dashboard can be used for uniquely identify a dashboard between multiple Grafana installs. description="The unique identifier (UID) of a dashboard can be used for uniquely identify a dashboard between multiple Grafana installs.
The uid allows having consistent URLs for accessing dashboards so changing the title of a dashboard will not break any The UID allows having consistent URLs for accessing dashboards so changing the title of a dashboard will not break any
bookmarked links to that dashboard." bookmarked links to that dashboard."
invalid={!!errors.uid} invalid={!!errors.uid}
error={errors.uid && errors.uid.message} error={errors.uid && errors.uid.message}

View File

@ -56,7 +56,7 @@ class ImportDashboardOverviewUnConnected extends PureComponent<Props, State> {
<div style={{ marginBottom: '24px' }}> <div style={{ marginBottom: '24px' }}>
<div> <div>
<Legend> <Legend>
Importing Dashboard from{' '} Importing dashboard from{' '}
<a <a
href={`https://grafana.com/dashboards/${dashboard.gnetId}`} href={`https://grafana.com/dashboards/${dashboard.gnetId}`}
className="external-link" className="external-link"

View File

@ -33,7 +33,7 @@ export function uploadDashboardDirective() {
console.error(err); console.error(err);
appEvents.emit(AppEvents.alertError, [ appEvents.emit(AppEvents.alertError, [
'Import failed', 'Import failed',
'JSON -> JS Serialization failed: ' + err.message, 'JSON -> JS serialization failed: ' + err.message,
]); ]);
return; return;
} }
@ -62,7 +62,7 @@ export function uploadDashboardDirective() {
// Something // Something
elem[0].addEventListener('change', file_selected, false); elem[0].addEventListener('change', file_selected, false);
} else { } else {
appEvents.emit(AppEvents.alertError, ['Oops', 'The HTML5 File APIs are not fully supported in this browser']); appEvents.emit(AppEvents.alertError, ['Oops', 'The HTML5 file APIs are not fully supported in this browser']);
} }
}, },
}; };

View File

@ -14,7 +14,7 @@ export const validateGcomDashboard = (gcomDashboard: string) => {
// From DashboardImportCtrl // From DashboardImportCtrl
const match = /(^\d+$)|dashboards\/(\d+)/.exec(gcomDashboard); const match = /(^\d+$)|dashboards\/(\d+)/.exec(gcomDashboard);
return match && (match[1] || match[2]) ? true : 'Could not find a valid Grafana.com id'; return match && (match[1] || match[2]) ? true : 'Could not find a valid Grafana.com ID';
}; };
export const validateTitle = (newTitle: string, folderId: number) => { export const validateTitle = (newTitle: string, folderId: number) => {
@ -34,7 +34,7 @@ export const validateUid = (value: string) => {
return getBackendSrv() return getBackendSrv()
.get(`/api/dashboards/uid/${value}`) .get(`/api/dashboards/uid/${value}`)
.then((existingDashboard) => { .then((existingDashboard) => {
return `Dashboard named '${existingDashboard?.dashboard.title}' in folder '${existingDashboard?.meta.folderTitle}' has the same uid`; return `Dashboard named '${existingDashboard?.dashboard.title}' in folder '${existingDashboard?.meta.folderTitle}' has the same UID`;
}) })
.catch((error) => { .catch((error) => {
error.isHandled = true; error.isHandled = true;

View File

@ -35,10 +35,10 @@ export const PlaylistEditPage: FC<Props> = ({ navModel, match }) => {
return ( return (
<Page navModel={navModel}> <Page navModel={navModel}>
<Page.Contents isLoading={loading}> <Page.Contents isLoading={loading}>
<h3 className={styles.subHeading}>Edit Playlist</h3> <h3 className={styles.subHeading}>Edit playlist</h3>
<p className={styles.description}> <p className={styles.description}>
A playlist rotates through a pre-selected list of Dashboards. A Playlist can be a great way to build A playlist rotates through a pre-selected list of dashboards. A playlist can be a great way to build
situational awareness, or just show off your metrics to your team or visitors. situational awareness, or just show off your metrics to your team or visitors.
</p> </p>

View File

@ -34,7 +34,7 @@ export const PlaylistNewPage: FC<Props> = ({ navModel }) => {
<h3 className={styles.subHeading}>New Playlist</h3> <h3 className={styles.subHeading}>New Playlist</h3>
<p className={styles.description}> <p className={styles.description}>
A playlist rotates through a pre-selected list of Dashboards. A Playlist can be a great way to build A playlist rotates through a pre-selected list of dashboards. A playlist can be a great way to build
situational awareness, or just show off your metrics to your team or visitors. situational awareness, or just show off your metrics to your team or visitors.
</p> </p>

View File

@ -15,7 +15,7 @@ export const PlaylistTableRows: FC<PlaylistTableRowsProps> = ({ items, onMoveUp,
return ( return (
<tr> <tr>
<td> <td>
<em>Playlist is empty, add dashboards below.</em> <em>Playlist is empty. Add dashboards below.</em>
</td> </td>
</tr> </tr>
); );

View File

@ -16,10 +16,10 @@ export const ChangePasswordForm: FC<Props> = ({ user, onChangePassword, isSaving
const authSource = user.authLabels?.length && user.authLabels[0]; const authSource = user.authLabels?.length && user.authLabels[0];
if (ldapEnabled || authProxyEnabled) { if (ldapEnabled || authProxyEnabled) {
return <p>You cannot change password when ldap or auth proxy authentication is enabled.</p>; return <p>You cannot change password when LDAP or auth proxy authentication is enabled.</p>;
} }
if (authSource && disableLoginForm) { if (authSource && disableLoginForm) {
return <p>Password cannot be changed here!</p>; return <p>Password cannot be changed here.</p>;
} }
return ( return (

View File

@ -21,7 +21,7 @@ export const UserProfileEditForm: FC<Props> = ({ user, isSavingUser, updateProfi
<Form onSubmit={onSubmitProfileUpdate} validateOn="onBlur"> <Form onSubmit={onSubmitProfileUpdate} validateOn="onBlur">
{({ register, errors }) => { {({ register, errors }) => {
return ( return (
<FieldSet label="Edit Profile"> <FieldSet label="Edit profile">
<Field label="Name" invalid={!!errors.name} error="Name is required" disabled={disableLoginForm}> <Field label="Name" invalid={!!errors.name} error="Name is required" disabled={disableLoginForm}>
<Input <Input
name="name" name="name"
@ -65,7 +65,7 @@ export default UserProfileEditForm;
const InputSuffix: FC = () => { const InputSuffix: FC = () => {
return disableLoginForm ? ( return disableLoginForm ? (
<Tooltip content="Login Details Locked - managed in another system."> <Tooltip content="Login details locked because they are managed in another system.">
<Icon name="lock" /> <Icon name="lock" />
</Tooltip> </Tooltip>
) : null; ) : null;

View File

@ -250,7 +250,7 @@ export class QueryGroupOptionsEditor extends PureComponent<Props, State> {
width={9} width={9}
tooltip={ tooltip={
<> <>
The evaluated Interval that is sent to data source and is used in <code>$__interval</code> and{' '} The evaluated interval that is sent to data source and is used in <code>$__interval</code> and{' '}
<code>$__interval_ms</code> <code>$__interval_ms</code>
</> </>
} }

View File

@ -79,7 +79,7 @@ export class PanelQueryRunner {
let processedData = data; let processedData = data;
if (withFieldConfig) { if (withFieldConfig) {
// Apply field defaults & overrides // Apply field defaults and overrides
const fieldConfig = this.dataConfigSource.getFieldOverrideOptions(); const fieldConfig = this.dataConfigSource.getFieldOverrideOptions();
const timeZone = data.request?.timezone ?? 'browser'; const timeZone = data.request?.timezone ?? 'browser';

View File

@ -14,7 +14,7 @@ export interface Props {
export const TeamSettings: FC<Props> = ({ team, updateTeam }) => { export const TeamSettings: FC<Props> = ({ team, updateTeam }) => {
return ( return (
<VerticalGroup> <VerticalGroup>
<FieldSet label="Team Settings"> <FieldSet label="Team settings">
<Form <Form
defaultValues={{ ...team }} defaultValues={{ ...team }}
onSubmit={(formTeam: Team) => { onSubmit={(formTeam: Team) => {
@ -29,7 +29,7 @@ export const TeamSettings: FC<Props> = ({ team, updateTeam }) => {
<Field <Field
label="Email" label="Email"
description="This is optional and is primarily used to set the team profile avatar (via gravatar service)" description="This is optional and is primarily used to set the team profile avatar (via gravatar service)."
> >
<Input placeholder="team@email.com" type="email" name="email" ref={register} /> <Input placeholder="team@email.com" type="email" name="email" ref={register} />
</Field> </Field>

View File

@ -3,7 +3,7 @@
exports[`Render should render component 1`] = ` exports[`Render should render component 1`] = `
<VerticalGroup> <VerticalGroup>
<FieldSet <FieldSet
label="Team Settings" label="Team settings"
> >
<Form <Form
defaultValues={ defaultValues={

View File

@ -6,7 +6,7 @@ export function buildNavModel(team: Team): NavModelItem {
const navModel = { const navModel = {
img: team.avatarUrl, img: team.avatarUrl,
id: 'team-' + team.id, id: 'team-' + team.id,
subTitle: 'Manage members & settings', subTitle: 'Manage members and settings',
url: '', url: '',
text: team.name, text: team.name,
breadcrumbs: [{ title: 'Teams', url: 'org/teams' }], breadcrumbs: [{ title: 'Teams', url: 'org/teams' }],