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:
@@ -36,7 +36,7 @@ export class OrgPicker extends PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getOrgOptions = async (query: string): Promise<Array<SelectableValue<number>>> => {
|
getOrgOptions = async (query: string): Promise<Array<SelectableValue<number>>> => {
|
||||||
if (!this.orgs) {
|
if (!this.orgs?.length) {
|
||||||
await this.loadOrgs();
|
await this.loadOrgs();
|
||||||
}
|
}
|
||||||
return this.orgs.map(
|
return this.orgs.map(
|
||||||
|
|||||||
@@ -1,16 +1,6 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import { css, cx } from '@emotion/css';
|
import { css, cx } from '@emotion/css';
|
||||||
import {
|
import { Button, ConfirmButton, Field, HorizontalGroup, Modal, stylesFactory, Themeable, withTheme } from '@grafana/ui';
|
||||||
Button,
|
|
||||||
ConfirmButton,
|
|
||||||
Container,
|
|
||||||
Field,
|
|
||||||
HorizontalGroup,
|
|
||||||
Modal,
|
|
||||||
stylesFactory,
|
|
||||||
Themeable,
|
|
||||||
withTheme,
|
|
||||||
} from '@grafana/ui';
|
|
||||||
import { GrafanaTheme } from '@grafana/data';
|
import { GrafanaTheme } from '@grafana/data';
|
||||||
import { AccessControlAction, Organization, OrgRole, UserOrg } from 'app/types';
|
import { AccessControlAction, Organization, OrgRole, UserOrg } from 'app/types';
|
||||||
import { OrgPicker, OrgSelectItem } from 'app/core/components/Select/OrgPicker';
|
import { OrgPicker, OrgSelectItem } from 'app/core/components/Select/OrgPicker';
|
||||||
@@ -251,16 +241,16 @@ export class AddToOrgModal extends PureComponent<AddToOrgModalProps, AddToOrgMod
|
|||||||
<Field label="Role">
|
<Field label="Role">
|
||||||
<OrgRolePicker value={role} onChange={this.onOrgRoleChange} />
|
<OrgRolePicker value={role} onChange={this.onOrgRoleChange} />
|
||||||
</Field>
|
</Field>
|
||||||
<Container padding="md">
|
<Modal.ButtonRow>
|
||||||
<HorizontalGroup spacing="md" justify="center">
|
<HorizontalGroup spacing="md" justify="center">
|
||||||
|
<Button variant="secondary" fill="outline" onClick={this.onCancel}>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
<Button variant="primary" onClick={this.onAddUserToOrg}>
|
<Button variant="primary" onClick={this.onAddUserToOrg}>
|
||||||
Add to organization
|
Add to organization
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="secondary" onClick={this.onCancel}>
|
|
||||||
Cancel
|
|
||||||
</Button>
|
|
||||||
</HorizontalGroup>
|
</HorizontalGroup>
|
||||||
</Container>
|
</Modal.ButtonRow>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user