-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[App Search] First cut of the Relevance Tuning UI (#90621)
- Loading branch information
1 parent
2aaeea7
commit 8c9eaa2
Showing
32 changed files
with
1,564 additions
and
95 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...ise_search/public/applications/app_search/components/relevance_tuning/boost_icon.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { shallow } from 'enzyme'; | ||
|
||
import { EuiToken } from '@elastic/eui'; | ||
|
||
import { BoostIcon } from './boost_icon'; | ||
import { BoostType } from './types'; | ||
|
||
describe('BoostIcon', () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('renders a token according to the provided type', () => { | ||
const wrapper = shallow(<BoostIcon type={'value' as BoostType} />); | ||
expect(wrapper.find(EuiToken).prop('iconType')).toBe('tokenNumber'); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
...terprise_search/public/applications/app_search/components/relevance_tuning/boost_icon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { EuiToken } from '@elastic/eui'; | ||
|
||
import { BOOST_TYPE_TO_ICON_MAP } from './constants'; | ||
import { BoostType } from './types'; | ||
|
||
interface Props { | ||
type: BoostType; | ||
} | ||
|
||
export const BoostIcon: React.FC<Props> = ({ type }) => { | ||
return ( | ||
<EuiToken | ||
iconType={BOOST_TYPE_TO_ICON_MAP[type]} | ||
size="m" | ||
shape="square" | ||
color="euiColorVis1" | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...public/applications/app_search/components/relevance_tuning/relevance_tuning_form/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export { RelevanceTuningForm } from './relevance_tuning_form'; |
20 changes: 20 additions & 0 deletions
20
...s/app_search/components/relevance_tuning/relevance_tuning_form/relevance_tuning_form.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.relevanceTuningForm { | ||
&__item { | ||
width: 100%; | ||
margin-left: $euiSizeS; | ||
} | ||
|
||
&__panel + &__panel { | ||
margin-top: $euiSizeM; | ||
} | ||
|
||
&__panel .euiAccordion__button { | ||
&:hover, | ||
&:focus { | ||
text-decoration: none; | ||
h3 { | ||
text-decoration: underline; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.