mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* WIP: intial commit * Tests: Runs e2e tests * Refactor: Adds BASE_URL support * Refactor: Adds namespacing * Refactor: Cleans up the Page api * Build: Adds to build-branches-and-prs job for testing * Build: Hardcoded image for now * Refactor: Uses Selectors in App * Refactor: Adds addDataSource flow * WIP * Refactor: Adds e2eScenario * Refactor: Adds add and delete scenarios * Refactor: Adds logging * Refactor: Adds ability to for Selectors with variables * Refactor: Using variable selectors instead * Refactor: Adds flow until Share Panel * Refactor: Adds clicking on rendered image link * Refactor: Deletes log output * Refactor: Updates snapshots * Chore: Reverts changes * Refactor: Removes log plugin because maybe it breaks yarn build * Refactor: Adds rendered image download * Refactor: Adds image comparison * Refactor: Removes uncaught errors override * Refactor: Changes order of images to compare * Refactor: Updates truth image * Build: Updates path to CI artifacts * Refactor: Cleaning up types and config * wip * Refactor: Cleans up external api * Refactor: More cleanup * Refactor: More cleanup * Refactor: Removes usages of Pages and Flows * Refactor: Removes last traces of Cypress in spec * Refactor: Adds comments
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
import React, { FC } from 'react';
|
|
import { FormLabel, Input, Switch } from '@grafana/ui';
|
|
import { e2e } from '@grafana/e2e';
|
|
|
|
export interface Props {
|
|
dataSourceName: string;
|
|
isDefault: boolean;
|
|
onNameChange: (name: string) => void;
|
|
onDefaultChange: (value: boolean) => void;
|
|
}
|
|
|
|
const BasicSettings: FC<Props> = ({ dataSourceName, isDefault, onDefaultChange, onNameChange }) => {
|
|
return (
|
|
<div className="gf-form-group" aria-label="Datasource settings page basic settings">
|
|
<div className="gf-form-inline">
|
|
<div className="gf-form max-width-30" style={{ marginRight: '3px' }}>
|
|
<FormLabel
|
|
tooltip={
|
|
'The name is used when you select the data source in panels. The Default data source is ' +
|
|
'preselected in new panels.'
|
|
}
|
|
>
|
|
Name
|
|
</FormLabel>
|
|
<Input
|
|
className="gf-form-input max-width-23"
|
|
type="text"
|
|
value={dataSourceName}
|
|
placeholder="Name"
|
|
onChange={event => onNameChange(event.target.value)}
|
|
required
|
|
aria-label={e2e.pages.DataSource.selectors.name}
|
|
/>
|
|
</div>
|
|
<Switch
|
|
label="Default"
|
|
checked={isDefault}
|
|
onChange={event => {
|
|
// @ts-ignore
|
|
onDefaultChange(event.target.checked);
|
|
}}
|
|
/>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default BasicSettings;
|