mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
OrgPicker: Fixes so organisations load (#33990)
* OrgPicker: Fixes so organisations load * Update public/app/core/components/Select/OrgPicker.tsx Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> * Chore: updates after PR comments Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
This commit is contained in:
parent
baa5ceb4c0
commit
c1be52bed0
@ -36,7 +36,7 @@ export class OrgPicker extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
getOrgOptions = async (query: string): Promise<Array<SelectableValue<number>>> => {
|
||||
if (!this.orgs) {
|
||||
if (!this.orgs?.length) {
|
||||
await this.loadOrgs();
|
||||
}
|
||||
return this.orgs.map(
|
||||
|
@ -1,16 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { css, cx } from '@emotion/css';
|
||||
import {
|
||||
Button,
|
||||
ConfirmButton,
|
||||
Container,
|
||||
Field,
|
||||
HorizontalGroup,
|
||||
Modal,
|
||||
stylesFactory,
|
||||
Themeable,
|
||||
withTheme,
|
||||
} from '@grafana/ui';
|
||||
import { Button, ConfirmButton, Field, HorizontalGroup, Modal, stylesFactory, Themeable, withTheme } from '@grafana/ui';
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
import { AccessControlAction, Organization, OrgRole, UserOrg } from 'app/types';
|
||||
import { OrgPicker, OrgSelectItem } from 'app/core/components/Select/OrgPicker';
|
||||
@ -251,16 +241,16 @@ export class AddToOrgModal extends PureComponent<AddToOrgModalProps, AddToOrgMod
|
||||
<Field label="Role">
|
||||
<OrgRolePicker value={role} onChange={this.onOrgRoleChange} />
|
||||
</Field>
|
||||
<Container padding="md">
|
||||
<Modal.ButtonRow>
|
||||
<HorizontalGroup spacing="md" justify="center">
|
||||
<Button variant="secondary" fill="outline" onClick={this.onCancel}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button variant="primary" onClick={this.onAddUserToOrg}>
|
||||
Add to organization
|
||||
</Button>
|
||||
<Button variant="secondary" onClick={this.onCancel}>
|
||||
Cancel
|
||||
</Button>
|
||||
</HorizontalGroup>
|
||||
</Container>
|
||||
</Modal.ButtonRow>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user