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

Zs filtering telegraph input #15601 #15787

Merged
merged 4 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions ui/cypress/e2e/collectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,31 @@ describe('Collectors', () => {
})
})
})
describe('Label creation and searching', () => {
beforeEach(() => {
const description = 'Config Description'
cy.get('@org').then(({id}: Organization) => {
cy.createTelegraf('newteleg', description, id, 'newbucket')
})
cy.reload()
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add one of those cy.get({timeout}) lines here after the reload to ensure that the page has loaded?

})
it('Can add label', () => {
cy.getByTestID('inline-labels--add').click()
cy.getByTestID('inline-labels--popover-field').type('zoe')
zoesteinkamp marked this conversation as resolved.
Show resolved Hide resolved
cy.getByTestID('inline-labels--create-new').click()
cy.getByTestID('overlay--container').should('exist')
cy.getByTestID('create-label-form--submit').click()
cy.getByTestID('label--pill zoe').should('exist')
//can search by label
cy.getByTestID('search-widget')
.clear()
.type('zoe')

cy.getByTestID('resource-card').should('have.length', 1)
cy.getByTestID('resource-card').should('contain', 'newteleg')
})

it('can search by label', () => {})
})
zoesteinkamp marked this conversation as resolved.
Show resolved Hide resolved
})
})
18 changes: 12 additions & 6 deletions ui/src/telegrafs/components/Collectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ class Collectors extends PureComponent<Props, State> {
<GetResources resources={[ResourceType.Labels]}>
<FilterList<Telegraf>
searchTerm={searchTerm}
searchKeys={['plugins.0.config.bucket', 'name']}
searchKeys={[
'plugins.0.config.bucket',
'name',
'labels[].name',
]}
list={collectors}
>
{cs => (
Expand Down Expand Up @@ -264,11 +268,13 @@ class Collectors extends PureComponent<Props, State> {
this.setState({searchTerm})
}
}
const mstp = ({telegrafs, orgs: {org}, buckets}: AppState): StateProps => ({
collectors: telegrafs.list,
orgName: org.name,
buckets: buckets.list,
})
const mstp = ({telegrafs, orgs: {org}, buckets}: AppState): StateProps => {
return {
collectors: telegrafs.list,
orgName: org.name,
buckets: buckets.list,
}
}

const mdtp: DispatchProps = {
onSetBucketInfo: setBucketInfo,
Expand Down