Chore: eslint react hook fix for public folder (#31174)

* Fixes under public/app/plugins

* Fixes under public/app/plugins/datasource

* Fixes under public/app/features

* Fixes under public/app/features

* Fixes under public/app/features

* Fixes under public/app/components

* Fix PanelNotSupported test

* Fix one more warning

* Fix warning in usePanelSave

* Fix traceview empty response

* Azure monitor fixes

* More fixes

* Fix tests for azure monitor

* Fixes after merging master

* Add comment for disabled rules

* Fixes after merging master

* Fixes after merging master

* Adress review comments

* Fix azure tests

* Address review feedbacks
This commit is contained in:
Zoltán Bedi
2021-03-25 12:42:14 +01:00
committed by GitHub
parent c9eff1892e
commit 8232b6ebbc
89 changed files with 373 additions and 368 deletions

View File

@@ -46,7 +46,7 @@ export const AdminEditOrgPage: FC<Props> = ({ match }) => {
useEffect(() => {
fetchOrg();
fetchOrgUsers().then((res) => setUsers(res));
}, []);
}, [fetchOrg, fetchOrgUsers]);
const updateOrgName = async (name: string) => {
return await getBackendSrv().put('/api/orgs/' + orgId, { ...orgState.value, name });

View File

@@ -23,7 +23,7 @@ export const AdminListOrgsPages: FC = () => {
useEffect(() => {
fetchOrgs();
}, []);
}, [fetchOrgs]);
return (
<Page navModel={navModel}>

View File

@@ -24,10 +24,13 @@ const createUser = async (user: UserDTO) => getBackendSrv().post('/api/admin/use
const UserCreatePage: React.FC<UserCreatePageProps> = ({ navModel }) => {
const history = useHistory();
const onSubmit = useCallback(async (data: UserDTO) => {
await createUser(data);
history.push('/admin/users');
}, []);
const onSubmit = useCallback(
async (data: UserDTO) => {
await createUser(data);
history.push('/admin/users');
},
[history]
);
return (
<Page navModel={navModel}>

View File

@@ -31,13 +31,14 @@ type Props = OwnProps & ConnectedProps & DispatchProps;
const UserListAdminPageUnConnected: React.FC<Props> = (props) => {
const styles = getStyles();
const { fetchUsers, navModel, query, changeQuery, users, showPaging, totalPages, page, changePage } = props;
useEffect(() => {
props.fetchUsers();
}, []);
fetchUsers();
}, [fetchUsers]);
return (
<Page navModel={props.navModel}>
<Page navModel={navModel}>
<Page.Contents>
<>
<div>
@@ -48,9 +49,9 @@ const UserListAdminPageUnConnected: React.FC<Props> = (props) => {
placeholder="Search user by login, email or name"
tabIndex={1}
autoFocus={true}
value={props.query}
value={query}
spellCheck={false}
onChange={(event) => props.changeQuery(event.currentTarget.value)}
onChange={(event) => changeQuery(event.currentTarget.value)}
prefix={<Icon name="search" />}
/>
<LinkButton href="admin/users/create" variant="primary">
@@ -77,12 +78,10 @@ const UserListAdminPageUnConnected: React.FC<Props> = (props) => {
<th style={{ width: '1%' }}></th>
</tr>
</thead>
<tbody>{props.users.map(renderUser)}</tbody>
<tbody>{users.map(renderUser)}</tbody>
</table>
</div>
{props.showPaging && (
<Pagination numberOfPages={props.totalPages} currentPage={props.page} onNavigate={props.changePage} />
)}
{showPaging && <Pagination numberOfPages={totalPages} currentPage={page} onNavigate={changePage} />}
</>
</Page.Contents>
</Page>