mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 17:43:35 -06:00
* 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>
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
import React, { FC } from 'react';
|
|
import { connect } from 'react-redux';
|
|
import { Input, Field, Form, Button, FieldSet, VerticalGroup } from '@grafana/ui';
|
|
|
|
import { SharedPreferences } from 'app/core/components/SharedPreferences/SharedPreferences';
|
|
import { updateTeam } from './state/actions';
|
|
import { Team } from 'app/types';
|
|
|
|
export interface Props {
|
|
team: Team;
|
|
updateTeam: typeof updateTeam;
|
|
}
|
|
|
|
export const TeamSettings: FC<Props> = ({ team, updateTeam }) => {
|
|
return (
|
|
<VerticalGroup>
|
|
<FieldSet label="Team settings">
|
|
<Form
|
|
defaultValues={{ ...team }}
|
|
onSubmit={(formTeam: Team) => {
|
|
updateTeam(formTeam.name, formTeam.email);
|
|
}}
|
|
>
|
|
{({ register }) => (
|
|
<>
|
|
<Field label="Name">
|
|
<Input name="name" ref={register({ required: true })} />
|
|
</Field>
|
|
|
|
<Field
|
|
label="Email"
|
|
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} />
|
|
</Field>
|
|
<Button type="submit">Update</Button>
|
|
</>
|
|
)}
|
|
</Form>
|
|
</FieldSet>
|
|
<SharedPreferences resourceUri={`teams/${team.id}`} />
|
|
</VerticalGroup>
|
|
);
|
|
};
|
|
|
|
const mapDispatchToProps = {
|
|
updateTeam,
|
|
};
|
|
|
|
export default connect(null, mapDispatchToProps)(TeamSettings);
|