Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL/ResourceSelector: Allow to set resources #12

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

andresmgot
Copy link
Collaborator

I have a case now that I need to get the list of resources in the parent component so to avoid duplicity, I made it optional to fetch resources in this component.

@andresmgot andresmgot requested review from a team, fridgepoet, iwysiu, yaelleC and sarahzinger and removed request for a team February 18, 2022 10:03
Copy link
Contributor

@yaelleC yaelleC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

Just a comment/question about import order 🙂

import { render, screen } from '@testing-library/react';
import { ResourceSelector, ResourceSelectorProps } from './ResourceSelector';
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm used to having React as first, any reason why you moved it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now using Typescript Hero to automatically add, order and remove imports. Since it's automatic, it uses the import path to order them (alphabetically). It also differentiate between packages and relative imports.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see!
I would have thought it would put default before named imports, but I don't see anything in the eslint or prettier config for it so good to go 👍

import { SelectableValue } from '@grafana/data';
import { InlineField, Select } from '@grafana/ui';
import { isEqual } from 'lodash';
import React, { useEffect, useMemo, useState } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem import order

@andresmgot andresmgot merged commit bfb0ab6 into main Feb 21, 2022
@andresmgot andresmgot deleted the resourceSelectorResources branch February 21, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants