[Search] Visual fixes on deployment section (#188912)

## Summary

Small fixes for visual bugs for deployment section


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Efe Gürkan YALAMAN 2024-07-24 13:21:59 +02:00 committed by GitHub
parent 317154df43
commit e1277b829f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 27 deletions

View file

@ -119,9 +119,9 @@ export const ConnectorDeployment: React.FC = () => {
),
status: selectedDeploymentMethod === null ? 'incomplete' : 'complete',
title: i18n.translate(
'xpack.enterpriseSearch.content.connector_detail.configurationConnector.steps.runConnectorService.title',
'xpack.enterpriseSearch.content.connector_detail.configurationConnector.steps.chooseDeployment.title',
{
defaultMessage: 'Run connector service',
defaultMessage: 'Choose your deployment method',
}
),
titleSize: 'xs',
@ -131,27 +131,20 @@ export const ConnectorDeployment: React.FC = () => {
<>
<EuiSpacer size="s" />
<EuiText size="s">
{selectedDeploymentMethod === 'source' ? (
<FormattedMessage
id="xpack.enterpriseSearch.content.connector_detail.configurationConnector.steps.configureIndexAndApiKey.description.source"
defaultMessage="When you generate a configuration, Elastic will create an index, an API key and a Connector ID. You'll need to add this information to the {configYaml} file for your connector. Alternatively use an existing index and API key. "
values={{
configYaml: (
<EuiCode>
{i18n.translate(
'xpack.enterpriseSearch.connectorConfiguration.configymlCodeBlockLabel',
{ defaultMessage: 'config.yml' }
)}
</EuiCode>
),
}}
/>
) : (
<FormattedMessage
id="xpack.enterpriseSearch.content.connector_detail.configurationConnector.steps.configureIndexAndApiKey.description.docker"
defaultMessage="When you generate a configuration, Elastic will create an index, an API key and a Connector ID. Alternatively use an existing index and API key."
/>
)}
<FormattedMessage
id="xpack.enterpriseSearch.content.connector_detail.configurationConnector.steps.configureIndexAndApiKey.description.source"
defaultMessage="Generate a connector configuration with the attached index and a new API key. This information will be added to the {configYaml} file of your connector. Alternatively use an existing API key. "
values={{
configYaml: (
<EuiCode>
{i18n.translate(
'xpack.enterpriseSearch.connectorConfiguration.configymlCodeBlockLabel',
{ defaultMessage: 'config.yml' }
)}
</EuiCode>
),
}}
/>
</EuiText>
<EuiSpacer />
@ -235,7 +228,7 @@ export const ConnectorDeployment: React.FC = () => {
title: i18n.translate(
'xpack.enterpriseSearch.content.connector_detail.configurationConnector.steps.waitingForConnector.title',
{
defaultMessage: 'Waiting for your connector',
defaultMessage: 'Waiting for your connector to check in',
}
),
titleSize: 'xs',

View file

@ -17,7 +17,7 @@ import {
EuiResizeObserver,
} from '@elastic/eui';
import { IngestionStatus, IngestionMethod } from '@kbn/search-connectors';
import { IngestionStatus, IngestionMethod, ConnectorStatus } from '@kbn/search-connectors';
import { mountWithIntl } from '@kbn/test-jest-helpers';
import { Status } from '../../../../../../common/types/api';
@ -45,6 +45,7 @@ describe('SyncsContextMenu', () => {
status: Status.SUCCESS,
connector: {
index_name: 'index_name',
status: ConnectorStatus.CONFIGURED,
},
};
@ -117,7 +118,10 @@ describe('SyncsContextMenu', () => {
});
it('Cannot start a sync without an index name', () => {
setMockValues({ ...mockValues, connector: { index_name: null } });
setMockValues({
...mockValues,
connector: { index_name: null, status: ConnectorStatus.CONFIGURED },
});
const wrapper = mountWithIntl(<SyncsContextMenu />);
const button = wrapper.find(
'button[data-telemetry-id="entSearchContent-connector-header-sync-openSyncMenu"]'
@ -139,4 +143,13 @@ describe('SyncsContextMenu', () => {
})
);
});
it("Sync button is disabled when connector isn't configured", () => {
setMockValues({ ...mockValues, connector: { status: null } });
const wrapper = mountWithIntl(<SyncsContextMenu />);
const button = wrapper.find(
'button[data-telemetry-id="entSearchContent-connector-header-sync-openSyncMenu"]'
);
expect(button.prop('disabled')).toEqual(true);
});
});

View file

@ -73,6 +73,8 @@ export const SyncsContextMenu: React.FC<SyncsContextMenuProps> = ({ disabled = f
const syncLoading = (isSyncing || isWaitingForSync) && ingestionStatus !== IngestionStatus.ERROR;
const isWaitingForConnector = !connector?.status || connector?.status === ConnectorStatus.CREATED;
const shouldShowDocumentLevelSecurity =
productFeatures.hasDocumentLevelSecurityEnabled && hasDocumentLevelSecurityFeature;
const shouldShowIncrementalSync =
@ -175,7 +177,7 @@ export const SyncsContextMenu: React.FC<SyncsContextMenuProps> = ({ disabled = f
<EuiPopover
button={
<EuiButton
disabled={disabled}
disabled={disabled || isWaitingForConnector}
data-test-subj="enterpriseSearchSyncsContextMenuButton"
data-telemetry-id="entSearchContent-connector-header-sync-openSyncMenu"
iconType="arrowDown"