From 43afe5ffd709c3a3e8a4ece8ae1102edb501f64a Mon Sep 17 00:00:00 2001 From: Mohit Tilala <63147650+mohittilala@users.noreply.github.com> Date: Thu, 9 Jul 2026 05:11:08 +0530 Subject: [PATCH 001/165] Fixes #29092: use AUTOCOMMIT for ingestion engines to release AccessShareLock (#29658) * Use AUTOCOMMIT for ingestion engines to release AccessShareLock Read-only metadata/profiler ingestion opened a transaction and never committed it until the run ended, pinning AccessShareLock on every crawled table (Redshift/Postgres release locks only at COMMIT) and blocking other users' DDL for hours. Build ingestion engines with isolation_level=AUTOCOMMIT in the shared create_generic_db_connection, guarded to dialects that support it, so locks release after each statement. An explicit caller isolation_level is respected. * Assert explicit isolation_level is honored via get_isolation_level --- .../ingestion/connections/builders.py | 28 ++++++++++- .../tests/unit/test_connection_builders.py | 49 +++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/ingestion/src/metadata/ingestion/connections/builders.py b/ingestion/src/metadata/ingestion/connections/builders.py index c1be5868e238..6ccec567e951 100644 --- a/ingestion/src/metadata/ingestion/connections/builders.py +++ b/ingestion/src/metadata/ingestion/connections/builders.py @@ -19,7 +19,7 @@ from pydantic import SecretStr from sqlalchemy import create_engine -from sqlalchemy.engine import Engine +from sqlalchemy.engine import Dialect, Engine from sqlalchemy.event import listen from sqlalchemy.pool import QueuePool @@ -56,6 +56,24 @@ def get_connection_args_common(connection) -> Dict[str, Any]: # noqa: UP006 ) +def _dialect_supports_autocommit(dialect: Dialect) -> bool: + """ + Return True when the SQLAlchemy dialect accepts isolation_level='AUTOCOMMIT'. + Uses get_isolation_level_values(None), which the transactional dialects + evaluate without a live connection. Non-transactional dialects (Hive, Impala, + Druid, Pinot) may not implement it, in which case we treat it as unsupported. + """ + supported = False + # Transactional dialects report their isolation levels without reading the + # connection, so None is safe here; others raise and are handled below. + no_connection: Any = None + try: + supported = "AUTOCOMMIT" in dialect.get_isolation_level_values(no_connection) + except Exception: # pylint: disable=broad-except + supported = False + return supported + + def create_generic_db_connection( connection, get_connection_url_fn: Callable, @@ -82,6 +100,14 @@ def create_generic_db_connection( **kwargs, ) + # Read-only metadata/profiler ingestion must not hold a transaction open for + # the whole run. On Redshift/Postgres that pins AccessShareLock on every + # crawled table and blocks other users' DDL for hours (issue #29092). + # AUTOCOMMIT releases locks after each statement. Skip dialects that do not + # support it (non-transactional engines do not hold these locks anyway). + if "isolation_level" not in kwargs and _dialect_supports_autocommit(engine.dialect): + engine.update_execution_options(isolation_level="AUTOCOMMIT") + attach_query_tracker(engine) if hasattr(connection, "supportsQueryComment"): diff --git a/ingestion/tests/unit/test_connection_builders.py b/ingestion/tests/unit/test_connection_builders.py index b5ac9dde1dc7..c57f2bcb01e3 100644 --- a/ingestion/tests/unit/test_connection_builders.py +++ b/ingestion/tests/unit/test_connection_builders.py @@ -21,6 +21,8 @@ MysqlConnection, ) from metadata.ingestion.connections.builders import ( + _dialect_supports_autocommit, + create_generic_db_connection, get_connection_args_common, get_connection_options_dict, init_empty_connection_arguments, @@ -78,3 +80,50 @@ def test_init_empty_connection_arguments(self): self.assertEqual(new_args.root.get("hello"), "world") self.assertIsNone(new_args.root.get("not there")) + + +class FakeDialectWithAutocommit: + def get_isolation_level_values(self, dbapi_conn): + return ("READ COMMITTED", "AUTOCOMMIT") + + +class FakeDialectNoAutocommit: + def get_isolation_level_values(self, dbapi_conn): + return ("READ COMMITTED",) + + +class FakeDialectRaises: + def get_isolation_level_values(self, dbapi_conn): + raise NotImplementedError("dialect has no isolation levels") + + +def test_dialect_supports_autocommit_true(): + assert _dialect_supports_autocommit(FakeDialectWithAutocommit()) is True + + +def test_dialect_supports_autocommit_false_when_absent(): + assert _dialect_supports_autocommit(FakeDialectNoAutocommit()) is False + + +def test_dialect_supports_autocommit_false_when_raises(): + assert _dialect_supports_autocommit(FakeDialectRaises()) is False + + +def test_create_generic_db_connection_applies_autocommit(): + engine = create_generic_db_connection( + connection=object(), + get_connection_url_fn=lambda _conn: "sqlite://", + get_connection_args_fn=lambda _conn: {}, + ) + assert engine.get_execution_options().get("isolation_level") == "AUTOCOMMIT" + + +def test_create_generic_db_connection_respects_explicit_isolation_level(): + engine = create_generic_db_connection( + connection=object(), + get_connection_url_fn=lambda _conn: "sqlite://", + get_connection_args_fn=lambda _conn: {}, + isolation_level="SERIALIZABLE", + ) + with engine.connect() as conn: + assert conn.get_isolation_level() == "SERIALIZABLE" From 69c9532f16d063dd92d0bbcd83f5249466300e9b Mon Sep 17 00:00:00 2001 From: Anujkumar Yadav Date: Thu, 9 Jul 2026 08:03:50 +0530 Subject: [PATCH 002/165] Refactor(entity-rename): replace antd with core-components in EntityNameModal (#29783) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(entity-rename): replace antd components with core-components in EntityNameModal - Replace antd Form, Modal, Button, Typography with @openmetadata/ui-core-components equivalents (Dialog, ModalOverlay, Modal, Button, Typography) - Use react-hook-form (Controller/useForm) instead of antd Form context - Add SanitizedField helper wrapping InputBase in AriaTextField so onChange receives a string and id flows through to the DOM , preserving Playwright locators (#name, #displayName, #name_help, [role="dialog"]) - Update EntityNameModal.interface.ts: remove antd Rule import, add EntityNameValidationRule object type - Update ManageButton.tsx: cast DISPLAY_NAME_FIELD_RULES as EntityNameValidationRule[] - Update SchemaTable.component.tsx: replace antd Form context for constraint with local editConstraint state; cast updateColumnDetails arg as Partial - Update entityPanel.ts: replace .ant-modal selector with [role="dialog"] Co-Authored-By: Claude Sonnet 4.6 * fix(entity-rename): sort Controller props in EntityNameModal Move the rules prop after render on the name/displayName Controllers to satisfy the sort-props lint rule. Co-Authored-By: Claude Opus 4.8 * fix(entity-rename): address gitar-bot review on EntityNameModal - buildValidate: skip min/max/pattern for empty non-required values, mirroring antd async-validator behavior (clearing displayName no longer produces a spurious min-length error) - useEffect reset: depend on entity.name/entity.displayName primitives instead of the entity object reference, so inline object literals passed by callers (e.g. ManageButton) don't wipe in-progress edits on every parent re-render Co-Authored-By: Claude Sonnet 4.6 * fix(entity-rename): restore DeleteWidgetModal import in ManageButton Previous commit accidentally renamed DeleteWidgetModal → DeleteEntityModal causing all test suites that import ManageButton to fail with "Cannot find module '../../DeleteWidget/DeleteEntityModal'". Co-Authored-By: Claude Sonnet 4.6 * fix(playwright): fix stale antd selectors after EntityNameModal migration - EntitySummaryPanel: replace .ant-modal with [role="dialog"] for cancel test - EntityVersionPages: replace .ant-modal-footer/.ant-modal-body with [role="dialog"] selectors for column display name edit step - EntityNameModal: add mode:'onChange' to useForm so validation errors appear on keystroke (glossary rename max-length test expects #name_help to populate without clicking save first) Co-Authored-By: Claude Sonnet 4.6 * fix(checkstyle): remove unused eslint-disable directive in EntityNameModal The react-hooks/exhaustive-deps directive is no longer needed because the deps array already uses the correct primitive values (entity.name, entity.displayName) and the linter does not flag a violation. Co-Authored-By: Claude Sonnet 4.6 * fix(entity-rename): address gitar-bot and greptile review findings - buildValidate: enforce required rule for empty values — previously a rule with {required:true} and no min/max/pattern returned true for empty input instead of the error message - SchemaTable: narrow editConstraint state to Constraint|undefined (was string|undefined, losing enum-level type safety); add Constraint import from generated table types - EntityNameModal: add data-testid="entity-name-modal" to Dialog so Playwright selectors can be scoped to avoid collisions with other [role="dialog"] elements on the page - Update entityPanel.ts, EntitySummaryPanel.spec.ts, and EntityVersionPages.spec.ts to use getByTestId('entity-name-modal') Co-Authored-By: Claude Sonnet 4.6 * fix lint checks * nit * Refactor component * nit * nit * nit --------- Co-authored-by: Claude Sonnet 4.6 --- .../e2e/Features/EntitySummaryPanel.spec.ts | 2 +- .../Glossary/GlossaryMiscOperations.spec.ts | 8 +- .../VersionPages/EntityVersionPages.spec.ts | 5 +- .../ui/playwright/utils/entityPanel.ts | 2 +- .../SchemaTable/SchemaTable.component.tsx | 38 ++- .../EntityNameModal.component.tsx | 264 +++++++++++++----- .../EntityNameModal.interface.ts | 13 +- .../ManageButton/ManageButton.tsx | 9 +- 8 files changed, 239 insertions(+), 102 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/EntitySummaryPanel.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/EntitySummaryPanel.spec.ts index e99ae20d03db..8649bfaf0cf8 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/EntitySummaryPanel.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/EntitySummaryPanel.spec.ts @@ -221,7 +221,7 @@ test.describe('Entity Title Section - Edit Display Name', () => { const editButton = summaryPanel.getByTestId('edit-displayName-button'); await editButton.click(); - const modal = page.locator('.ant-modal'); + const modal = page.getByTestId('entity-name-modal'); await expect(modal).toBeVisible(); await modal.getByRole('button', { name: 'Cancel' }).click(); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Glossary/GlossaryMiscOperations.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Glossary/GlossaryMiscOperations.spec.ts index 3477216aea69..f29fe15edba1 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Glossary/GlossaryMiscOperations.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Glossary/GlossaryMiscOperations.spec.ts @@ -159,14 +159,14 @@ test.describe('Glossary Miscellaneous Operations', () => { await page.getByTestId('rename-button').first().click(); // Wait for rename modal to appear - await expect(page.locator('[role="dialog"]')).toBeVisible(); + const renameModal = page.getByTestId('entity-name-modal'); + await expect(renameModal).toBeVisible(); const newName = 'RenamedParent'; - // Use getByLabel to target the Name input in the modal - await page.getByLabel('Name', { exact: true }).fill(newName); + await renameModal.getByTestId('name').fill(newName); const renameRes = page.waitForResponse('/api/v1/glossaryTerms/*'); - await page.getByRole('button', { name: 'Save' }).click(); + await renameModal.getByTestId('save-button').click(); await renameRes; // Navigate to child term and verify its FQN includes new parent name diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts index 3b181f799242..806653bab287 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts @@ -272,10 +272,11 @@ test.describe('Entity Version pages', () => { await page.locator('#displayName').fill('New Column Name'); await page - .locator('.ant-modal-footer [data-testid="save-button"]') + .getByTestId('entity-name-modal') + .getByTestId('save-button') .click(); - await page.locator('.ant-modal-body').waitFor({ + await page.getByTestId('entity-name-modal').waitFor({ state: 'detached', }); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/entityPanel.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/entityPanel.ts index a0657ce506af..988636efef50 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/entityPanel.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/entityPanel.ts @@ -610,7 +610,7 @@ export const editDisplayNameFromPanel = async ( await editButton.waitFor({ state: 'visible' }); await editButton.click(); - const modal = page.locator('.ant-modal'); + const modal = page.getByTestId('entity-name-modal'); await modal.waitFor({ state: 'visible' }); const displayNameInput = modal.locator('#displayName'); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/SchemaTable/SchemaTable.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/SchemaTable/SchemaTable.component.tsx index aa71a41d93fd..c2c8715ab94b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/SchemaTable/SchemaTable.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/SchemaTable/SchemaTable.component.tsx @@ -11,11 +11,11 @@ * limitations under the License. */ +import { Label } from '@openmetadata/ui-core-components'; import { Button, Col, Dropdown, - Form, Row, Select, TableProps, @@ -55,6 +55,7 @@ import { import { EntityType } from '../../../enums/entity.enum'; import { Column, + Constraint, Table as TableType, } from '../../../generated/entity/data/table'; import { TestSummary } from '../../../generated/tests/testCase'; @@ -106,10 +107,7 @@ import Table from '../../common/Table/Table'; import TestCaseStatusSummaryIndicator from '../../common/TestCaseStatusSummaryIndicator/TestCaseStatusSummaryIndicator.component'; import { useGenericContext } from '../../Customization/GenericProvider/GenericContext'; import EntityNameModal from '../../Modals/EntityNameModal/EntityNameModal.component'; -import { - EntityName, - EntityNameWithAdditionFields, -} from '../../Modals/EntityNameModal/EntityNameModal.interface'; +import { EntityName } from '../../Modals/EntityNameModal/EntityNameModal.interface'; import { ColumnFilter } from '../ColumnFilter/ColumnFilter.component'; import TableDescription from '../TableDescription/TableDescription.component'; import TableTags from '../TableTags/TableTags.component'; @@ -169,6 +167,9 @@ const SchemaTable = () => { } = useFqn({ type: EntityType.TABLE }); const [editColumnDisplayName, setEditColumnDisplayName] = useState(); + const [editConstraint, setEditConstraint] = useState< + Constraint | undefined + >(); const { permissions: tablePermissions, @@ -599,10 +600,11 @@ const SchemaTable = () => { const handleEditDisplayNameClick = useCallback((record: Column) => { setEditColumnDisplayName(record); + setEditConstraint(record.constraint); }, []); const handleEditColumnData = async (data: EntityName) => { - const { displayName, constraint } = data as EntityNameWithAdditionFields; + const { displayName } = data; if ( !isUndefined(editColumnDisplayName) && editColumnDisplayName.fullyQualifiedName @@ -612,21 +614,23 @@ const SchemaTable = () => { editColumnDisplayName.fullyQualifiedName, { displayName: displayName, - ...(isEmpty(constraint) + ...(isEmpty(editConstraint) ? { removeConstraint: true, } - : { constraint }), - }, + : { constraint: editConstraint }), + } as Partial, 'displayName' ); } catch (error) { showErrorToast(error as AxiosError); } finally { setEditColumnDisplayName(undefined); + setEditConstraint(undefined); } } else { setEditColumnDisplayName(undefined); + setEditConstraint(undefined); } }; @@ -920,22 +924,26 @@ const SchemaTable = () => { ); const additionalFieldsInEntityNameModal = ( - +
+ + field.onChange(getSanitizeContent(val)) + } + /> + {fieldState.error && ( + + {fieldState.error.message} + + )} + + )} + rules={{ + required: `${t('label.field-required', { + field: t('label.name'), + })}`, + pattern: { + value: ENTITY_NAME_REGEX, + message: t('message.entity-name-validation'), + }, + validate: buildValidate(nameValidationRules), + }} + /> + + + + ( + <> + + field.onChange(getSanitizeContent(val)) + } + /> + {fieldState.error && ( + + {fieldState.error.message} + + )} + + )} + rules={{ + validate: buildValidate(displayNameValidationRules), + }} + /> + - {additionalFields} - - + {additionalFields} + + + + + + + + + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Modals/EntityNameModal/EntityNameModal.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Modals/EntityNameModal/EntityNameModal.interface.ts index 38f05e9faeb3..374bdf683563 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Modals/EntityNameModal/EntityNameModal.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Modals/EntityNameModal/EntityNameModal.interface.ts @@ -10,7 +10,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Rule } from 'antd/lib/form'; import { Constraint } from '../../../generated/entity/data/table'; export type EntityName = { name: string; displayName?: string; id?: string }; @@ -19,6 +18,14 @@ export type EntityNameWithAdditionFields = EntityName & { constraint: Constraint; }; +export type EntityNameValidationRule = { + min?: number; + max?: number; + pattern?: RegExp; + required?: boolean | string; + message?: string; +}; + export interface EntityNameModalProps< T extends { name: string; displayName?: string } > { @@ -28,7 +35,7 @@ export interface EntityNameModalProps< onSave: (obj: T) => void | Promise; entity: T; title: string; - nameValidationRules?: Rule[]; - displayNameValidationRules?: Rule[]; + nameValidationRules?: EntityNameValidationRule[]; + displayNameValidationRules?: EntityNameValidationRule[]; additionalFields?: React.ReactNode; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/ManageButton/ManageButton.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/ManageButton/ManageButton.tsx index f50780d79544..d8abf8e3efe8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/ManageButton/ManageButton.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/ManageButton/ManageButton.tsx @@ -31,7 +31,10 @@ import { ANNOUNCEMENT_ENTITIES } from '../../../../utils/AnnouncementsUtils'; import entityUtilClassBase from '../../../../utils/EntityUtilClassBase'; import { showErrorToast } from '../../../../utils/ToastUtils'; import EntityNameModal from '../../../Modals/EntityNameModal/EntityNameModal.component'; -import { EntityName } from '../../../Modals/EntityNameModal/EntityNameModal.interface'; +import { + EntityName, + EntityNameValidationRule, +} from '../../../Modals/EntityNameModal/EntityNameModal.interface'; import DeleteEntityModal from '../../DeleteWidget/DeleteEntityModal'; import { ManageButtonItemLabel } from '../../ManageButtonContentItem/ManageButtonContentItem.component'; import { ManageButtonProps } from './ManageButton.interface'; @@ -326,7 +329,9 @@ const ManageButton: FC = ({ {onEditDisplayName && isDisplayNameEditing && ( Date: Thu, 9 Jul 2026 09:52:20 +0530 Subject: [PATCH 003/165] Removed bulk delete material ui component (#29845) * Removed bulk delete material ui component * nit --- .../common/atoms/actions/useDelete.tsx | 226 ++++-------------- 1 file changed, 50 insertions(+), 176 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/atoms/actions/useDelete.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/atoms/actions/useDelete.tsx index 11480a799d5e..b283d9d5205f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/atoms/actions/useDelete.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/atoms/actions/useDelete.tsx @@ -11,25 +11,14 @@ * limitations under the License. */ -import { - Badge, - Box, - Button, - Dialog, - DialogActions, - DialogContent, - DialogTitle, - IconButton, - Typography, - useTheme, -} from '@mui/material'; +import { Badge, ButtonUtility } from '@openmetadata/ui-core-components'; import { Trash01 } from '@untitledui/icons'; import { useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { deleteEntity } from '../../../../rest/miscAPI'; import { getEntityName } from '../../../../utils/EntityNameUtils'; import { showErrorToast, showSuccessToast } from '../../../../utils/ToastUtils'; -import Loader from '../../Loader/Loader'; +import { DeleteModal } from '../../DeleteModal/DeleteModal'; interface UseDeleteConfig< T extends { id: string; name?: string; displayName?: string } @@ -42,7 +31,7 @@ interface UseDeleteConfig< } /** - * Generic delete hook for handling entity deletion with MUI components + * Generic delete hook for handling entity deletion with core-components * * @description * Provides a reusable delete functionality for any entity type with: @@ -76,7 +65,6 @@ export const useDelete = < onDeleteComplete, onCancel, }: UseDeleteConfig) => { - const theme = useTheme(); const { t } = useTranslation(); const [isOpen, setIsOpen] = useState(false); const [isDeleting, setIsDeleting] = useState(false); @@ -114,37 +102,37 @@ export const useDelete = < }`; }, [selectedEntities, entityLabel]); - const getDeleteMessage = useCallback(() => { - if (selectedEntities.length === 0) { - return ''; + const deleteConfirmationMessage = useMemo(() => { + if (selectedEntities.length > 1) { + return t('message.are-you-sure-you-want-to-delete-these-entities', { + count: selectedEntities.length, + entity: entityLabel?.toLowerCase() || 'items', + }); } if (selectedEntities.length === 1) { - const name = getEntityName(selectedEntities[0]); - - return name ? `"${name}"` : `this ${entityLabel || 'item'}`; + return t('message.are-you-sure-you-want-to-delete-this-entity', { + entity: entityLabel?.toLowerCase() || 'item', + }); } - // For multiple, show count with entity type - return `these ${selectedEntities.length} ${entityLabel || 'item'}${ - selectedEntities.length > 1 ? 's' : '' - }`; - }, [selectedEntities, entityLabel]); + return ''; + }, [selectedEntities.length, entityLabel, t]); const handleDelete = useCallback(async () => { setIsDeleting(true); const errors: string[] = []; - for (let i = 0; i < selectedEntities.length; i++) { + for (const entity of selectedEntities) { try { await deleteEntity( entityType, - selectedEntities[i].id, + entity.id, false, // recursive: false (safe default) true // hardDelete: true (permanent) ); - } catch (error) { - errors.push(getEntityName(selectedEntities[i])); + } catch { + errors.push(getEntityName(entity)); } } @@ -170,166 +158,52 @@ export const useDelete = < setIsDeleting(false); setIsOpen(false); - }, [selectedEntities, entityType, entityLabel, onDeleteComplete]); + }, [selectedEntities, entityType, entityLabel, onDeleteComplete, t]); const deleteIconButton = useMemo( - () => - selectedEntities.length > 1 ? ( - - - - - - ) : ( - - - - ), - [selectedEntities.length, openModal, theme.palette.allShades] + () => ( +
+ + {selectedEntities.length > 1 && ( + + {selectedEntities.length} + + )} +
+ ), + [selectedEntities.length, openModal, t] ); const deleteModal = useMemo( () => ( - - - - - - - - {t('label.delete')} {getEntityTitle()} - - - - - {selectedEntities.length > 1 - ? t('message.are-you-sure-you-want-to-delete-these-entities', { - count: selectedEntities.length, - entity: entityLabel?.toLowerCase() || 'items', - }) - : selectedEntities.length === 1 - ? t('message.are-you-sure-you-want-to-delete-this-entity', { - entity: entityLabel?.toLowerCase() || 'item', - }) - : ''} - - - - - - - - - + onCancel={handleCancel} + onDelete={handleDelete} + /> ), [ - getDeleteMessage, getEntityTitle, + deleteConfirmationMessage, handleCancel, handleDelete, isDeleting, isOpen, - selectedEntities.length, - theme.palette.allShades, ] ); From e8b6977bccfd327293a86c4b593155e3ceecaaa4 Mon Sep 17 00:00:00 2001 From: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Date: Thu, 9 Jul 2026 11:03:49 +0530 Subject: [PATCH 004/165] =?UTF-8?q?feat(ui):=20Agents=20tab=20revamp=20?= =?UTF-8?q?=E2=80=94=20new=20agent=20listing=20+=20details=20wired=20to=20?= =?UTF-8?q?real=20data=20(#29656)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(ui): scaffold Agents page prototype with header, route and preview harness Co-Authored-By: Claude Sonnet 4.6 * fix(ui): point Agents token bridge at tw-prefixed theme tokens The Tailwind v4 theme is imported with prefix(tw), so the real tokens are --tw-color-*/--tw-shadow-*. The bridge targeted unprefixed --color-* names which resolve empty, leaving the page colorless. Retarget to --tw-* and add bare --shadow-* aliases. Co-Authored-By: Claude Opus 4.8 (1M context) * feat(ui): Agents page agent list, cards, group and tabs Co-Authored-By: Claude Opus 4.8 (1M context) * fix(ui): Agents card action icons, line length, prop order, description copy Co-Authored-By: Claude Opus 4.8 (1M context) * feat(ui): Agents page live simulation and deployment summary card Co-Authored-By: Claude Sonnet 4.6 * feat(ui): Agents page run history drawer Implements Task 4 of the ServiceAgents prototype: a slide-over run history drawer with a CI-style run rail, stat tiles, and per-step breakdown with promoted attention cards (copy, how-to-fix hint, show/hide raw logs toggle). Co-Authored-By: Claude Opus 4.8 (1M context) * feat(ui): Agents page raw log viewer drawer Co-Authored-By: Claude Opus 4.8 (1M context) * chore(ui): Agents page i18n sync, checkstyle and copy polish - Lowercase summary stat captions: assets-ingested → "assets ingested", est-remaining → "est. remaining" - Apply .toLowerCase() to error-plural callsite in DeploymentSummaryCard (no shared key mutation) - Add trailing period to message.no-lines-match - Add URL.revokeObjectURL after a.click() in LogViewerDrawer.handleDownload - Sync all 19 locale files via yarn i18n (adds ~40 Agents keys per locale) - Run full checkstyle sequence: organize-imports → lint:fix → prettier → license-header-fix - Reflow >200-col mock/agents.mock.ts lines via prettier (0 lint errors) Co-Authored-By: Claude Opus 4.8 (1M context) * fix(ui): Agents page agspin keyframe, title i18n, mock log seam Co-Authored-By: Claude Opus 4.8 (1M context) * feat(ui): Agents real-data mapper (pipeline -> agent view-model) + tests Adds pure mapping functions that translate IngestionPipeline/PipelineStatus/ StepSummary API shapes into the Agents page view-model (Agent, AgentRun, RunStep, LogLine), reusing the existing AgentStatus classification and date-time utilities. Covered by 45 Jest unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) * chore(ui): remove Agents mock-page harness; add fqn/pipelineType to Agent view-model Deletes the standalone preview harness (AgentsPage.component, preview entry, agents-preview.html), the useSimulatedAgents hook, mock/agents.mock.ts, and the AGENTS_PREVIEW route + constant — the page now targets the real service Agents tab. Adds fqn + pipelineType to the Agent view-model so the run-history and log drawers can fetch by pipeline. runs.mock/logs.mock remain until the drawers are wired to real data. Co-Authored-By: Claude Opus 4.8 (1M context) * feat(ui): Agents real-data hooks (list poll, run history, logs, actions) - useMetadataAgents: maps pipelines -> Agent[] and polls running agents' latest status every 5s (skips polling when none running). - useAgentRuns: getRunHistoryForPipeline -> AgentRun[] for the history drawer. - useAgentLogs: getIngestionPipelineLogById -> parsed LogLine[] with after/total paginated load-more. - useAgentActions: trigger/deploy/kill/toggle with success+error toasts. Adds label.stopped-lowercase. Co-Authored-By: Claude Opus 4.8 (1M context) * feat(ui): wire Agents drawers to real data (runs, logs, attention stackTrace) - RunHistoryDrawer uses useAgentRuns (async/empty + loading states). - LogViewerDrawer uses useAgentLogs with paginated load-more. - RunStepRow attention raw-logs now render the real StackTraceError.stackTrace (toggle hidden when absent); adds RunAttention.stackTrace + mapper support. - Deletes mock/runs.mock and mock/logs.mock (no longer referenced). Co-Authored-By: Claude Opus 4.8 (1M context) * feat(ui): render new Agents design in service tab with real data Rewrites Ingestion.component to show the DeploymentSummaryCard status header + Metadata/Collate-AI sub-tabs; Metadata renders the new MetadataAgentsView (real agents via useMetadataAgents + actions via useAgentActions + run/log drawers + real AddIngestionButton), Collate keeps the existing widget. Filters and search dropped. AgentGroup gains an addAgentSlot for the real add button. Co-Authored-By: Claude Opus 4.8 (1M context) * chore(ui): Agents real-data test, i18n sync and checkstyle - Rewrites Ingestion.test for the new container (airflow-error + Add Agent permission gating); drops removed filter/search/legacy-widget tests. - Adds message.no-recent-runs; syncs new keys to all locales. - Runs organize-imports + eslint + prettier across the changed files. Co-Authored-By: Claude Opus 4.8 (1M context) * feat(ui): Agents logs use LogViewerModal (+wrap), delete confirm, ongoing copy - Adds a Wrap toggle to the shared LogViewerModal (AlignLeft + LazyLog wrapLines) and uses it for agent logs; deletes the bespoke LogViewerDrawer. - Overflow Delete now opens a ConfirmationModal before calling the delete API. - DeploymentSummaryCard copy reworded for the ongoing tab (not first-deploy). Co-Authored-By: Claude Opus 4.8 (1M context) * chore(ui): remove dead Agents standalone header/tab-bar components AgentsPageHeader and AgentsTabBar were only used by the deleted preview page; the service tab provides its own header + sub-tab switch. Co-Authored-By: Claude Opus 4.8 (1M context) * refactor(ui): Agents components use core Box/Card/Grid primitives Replace hand-rolled flex divs and inline-style flex containers in the Agents UI with the shared Box/Card primitives from @openmetadata/ui-core-components. Purely mechanical - rendered classes/styles are preserved exactly; Grid was evaluated for the 5-tile run-history stat strip but its 24-column track doesn't divide evenly by 5, so that row stays a Box row per the documented fallback. Co-Authored-By: Claude Opus 4.8 (1M context) * fix(ui): keep DeploymentSummaryCard gradient wrapper a block div The primitives sweep turned the outer gradient container (originally a block div, not flex) into a Box; revert it so block layout is preserved exactly. Inner rows remain Box. Co-Authored-By: Claude Opus 4.8 (1M context) * Add new agents icons * Update localization changes * Update the agents list and details components to match the design * Fix the recent runs dots not showing per status * add the fetch-event-source package for SSE UI integration with jwt * Integrate the SSE live updates in the UI for agents status * Update the agents switch to tab and move the banner above tabs * add onRefresh handler to IngestionWorkflow component * Fix icon styling * Fix add ingestion button * Fix the agents status * Add agent button extensibility * Worked on comments * fix checkstyle * Fix tests * integrate the ingestion pipeline update logic when got pipeline through streaming data * Fix playwright and tab count not updating * Fix checkstyle * Fix permission fallback defaults and flaky trigger wait Agent action buttons now default to no permissions until an explicit permission set resolves, permissions are fetched for stream-discovered agents via FQN-keyed lookups, and the permission spec retries the trigger instead of a fixed 15s sleep. Co-Authored-By: Claude Fable 5 * Fix test connection modal not showing all step accordians * Fix TestConnectionModal unit tests after gate fallback change The gate fallback now requires a ConnectionGate category or a CheckAccess step, so gate-related specs mock CheckAccess/GetSchemas instead of generic step names. Adds coverage for the no-gate case where every step renders as a capability accordion. Co-Authored-By: Claude Fable 5 * Add empty placeholder * Fix the agents count not updating * Fix failed banner style * Work on comments * Add footer to the agents log * Fix the banner stuck in running state * Fix drawer closing on viewing logs --------- Co-authored-by: Claude Sonnet 4.6 Co-authored-by: Aniket Katkar --- .../slideout-menus/slideout-menu.tsx | 6 +- .../ui/src/components/base/badges/badges.tsx | 4 +- .../src/main/resources/ui/package.json | 3 +- .../playwright/e2e/Features/AutoPilot.spec.ts | 68 +- .../ServiceAgentsLiveProgress.spec.ts | 396 +++++++++++ .../Flow/ServiceCreationPermissions.spec.ts | 41 +- .../e2e/nightly/ServiceIngestion.spec.ts | 52 +- .../entity/ingestion/MySqlIngestionClass.ts | 40 +- .../ingestion/PostgresIngestionClass.ts | 7 +- .../RedshiftWithDBTIngestionClass.ts | 7 +- .../entity/ingestion/ServiceBaseClass.ts | 40 +- .../ui/playwright/utils/serviceIngestion.ts | 3 + .../ui/src/assets/svg/agents/lineage.svg | 7 + .../ui/src/assets/svg/agents/play.svg | 3 + .../ui/src/assets/svg/agents/run-failed.svg | 4 + .../ui/src/assets/svg/agents/run-partial.svg | 4 + .../ui/src/assets/svg/agents/run-running.svg | 4 + .../ui/src/assets/svg/agents/run-skipped.svg | 3 + .../ui/src/assets/svg/agents/run-success.svg | 4 + .../ui/src/assets/svg/agents/sparkle.svg | 4 + .../ServiceAgents/AgentsPage.interface.ts | 118 ++++ .../ServiceAgents/agents-preview.css | 33 + .../components/AgentCard.component.tsx | 266 ++++++++ .../components/AgentCard.test.tsx | 173 +++++ .../components/AgentGroup.component.tsx | 119 ++++ .../components/AgentGroup.test.tsx | 96 +++ .../AgentOverflowMenu.component.tsx | 125 ++++ .../components/AgentOverflowMenu.test.tsx | 122 ++++ .../DeploymentSummaryCard.component.tsx | 180 +++++ .../components/DeploymentSummaryCard.test.tsx | 180 +++++ .../MetadataAgentsView.component.tsx | 265 ++++++++ .../components/RunGlyph.component.tsx | 73 ++ .../components/RunHistoryDrawer.component.tsx | 306 +++++++++ .../components/RunHistoryDrawer.test.tsx | 137 ++++ .../components/RunStepRow.component.tsx | 211 ++++++ .../components/shared/Metric.component.tsx | 58 ++ .../shared/ProgressBar.component.tsx | 38 ++ .../shared/StatusPill.component.tsx | 65 ++ .../ServiceAgents/hooks/useAgentActions.ts | 105 +++ .../ServiceAgents/hooks/useAgentLogs.ts | 103 +++ .../hooks/useAgentPermissions.ts | 79 +++ .../ServiceAgents/hooks/useAgentRuns.ts | 60 ++ .../hooks/useMetadataAgents.test.ts | 249 +++++++ .../ServiceAgents/hooks/useMetadataAgents.ts | 210 ++++++ .../hooks/useServiceProgressStream.test.ts | 248 +++++++ .../hooks/useServiceProgressStream.ts | 189 ++++++ .../ServiceAgents/utils/agents.utils.ts | 214 ++++++ .../utils/agentsDataMapper.test.ts | 621 ++++++++++++++++++ .../ServiceAgents/utils/agentsDataMapper.ts | 413 ++++++++++++ .../AddIngestionButton.component.tsx | 12 +- .../Ingestion/Ingestion.component.tsx | 218 ++---- .../Services/Ingestion/Ingestion.test.tsx | 178 +---- .../Services/Ingestion/ingestion.interface.ts | 2 + .../Services/Ingestion/ingestion.less | 63 -- .../LogViewerModal.component.tsx | 21 +- .../LogViewerModal/LogViewerModal.test.tsx | 12 + .../LogViewerModal/log-viewer-modal.less | 5 + .../TestConnectionModal.test.tsx | 53 +- .../ui/src/locale/languages/ar-sa.json | 68 +- .../ui/src/locale/languages/de-de.json | 68 +- .../ui/src/locale/languages/en-us.json | 66 ++ .../ui/src/locale/languages/es-es.json | 68 +- .../ui/src/locale/languages/fr-fr.json | 68 +- .../ui/src/locale/languages/gl-es.json | 68 +- .../ui/src/locale/languages/he-he.json | 68 +- .../ui/src/locale/languages/ja-jp.json | 68 +- .../ui/src/locale/languages/ko-kr.json | 68 +- .../ui/src/locale/languages/mr-in.json | 68 +- .../ui/src/locale/languages/nl-nl.json | 68 +- .../ui/src/locale/languages/pr-pr.json | 68 +- .../ui/src/locale/languages/pt-br.json | 68 +- .../ui/src/locale/languages/pt-pt.json | 68 +- .../ui/src/locale/languages/ru-ru.json | 68 +- .../ui/src/locale/languages/sv-se.json | 68 +- .../ui/src/locale/languages/th-th.json | 68 +- .../ui/src/locale/languages/tr-tr.json | 68 +- .../ui/src/locale/languages/zh-cn.json | 68 +- .../ui/src/locale/languages/zh-tw.json | 68 +- .../resources/ui/src/mocks/Ingestion.mock.ts | 1 + .../EditIngestionPage.component.tsx | 2 + .../ServiceDetailsPage.test.tsx | 7 + .../ServiceDetailsPage/ServiceDetailsPage.tsx | 18 +- .../src/utils/AgentsProgressPureUtils.test.ts | 335 ++++++++++ .../ui/src/utils/AgentsProgressPureUtils.ts | 177 +++++ .../resources/ui/src/utils/IngestionUtils.tsx | 29 + .../ui/src/utils/TestConnectionUtils.test.ts | 16 +- .../ui/src/utils/TestConnectionUtils.ts | 16 +- .../ui/src/utils/date-time/DateTimeUtils.ts | 6 + .../src/main/resources/ui/yarn.lock | 5 + 89 files changed, 7772 insertions(+), 518 deletions(-) create mode 100644 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ServiceAgentsLiveProgress.spec.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/lineage.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/play.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-failed.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-partial.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-running.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-skipped.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-success.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/sparkle.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/AgentsPage.interface.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/agents-preview.css create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentCard.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentCard.test.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentGroup.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentGroup.test.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentOverflowMenu.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentOverflowMenu.test.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/DeploymentSummaryCard.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/DeploymentSummaryCard.test.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/MetadataAgentsView.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunGlyph.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunHistoryDrawer.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunHistoryDrawer.test.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunStepRow.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/Metric.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/ProgressBar.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/StatusPill.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentActions.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentLogs.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentPermissions.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentRuns.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useMetadataAgents.test.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useMetadataAgents.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useServiceProgressStream.test.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useServiceProgressStream.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agents.utils.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agentsDataMapper.test.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agentsDataMapper.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/utils/AgentsProgressPureUtils.test.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/utils/AgentsProgressPureUtils.ts diff --git a/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/slideout-menus/slideout-menu.tsx b/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/slideout-menus/slideout-menu.tsx index 9fe9eb6d780e..5e57df2b7ae7 100644 --- a/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/slideout-menus/slideout-menu.tsx +++ b/openmetadata-ui-core-components/src/main/resources/ui/src/components/application/slideout-menus/slideout-menu.tsx @@ -1,3 +1,5 @@ +import { CloseButton } from '@/components/base/buttons/close-button'; +import { cx } from '@/utils/cx'; import { type ComponentPropsWithRef, type ReactNode, @@ -14,8 +16,6 @@ import { Modal as AriaModal, ModalOverlay as AriaModalOverlay, } from 'react-aria-components'; -import { CloseButton } from '@/components/base/buttons/close-button'; -import { cx } from '@/utils/cx'; interface ModalOverlayProps extends AriaModalOverlayProps, @@ -147,7 +147,7 @@ const Header = ({
{children} diff --git a/openmetadata-ui-core-components/src/main/resources/ui/src/components/base/badges/badges.tsx b/openmetadata-ui-core-components/src/main/resources/ui/src/components/base/badges/badges.tsx index 1313ae7209b7..d59991404e1a 100644 --- a/openmetadata-ui-core-components/src/main/resources/ui/src/components/base/badges/badges.tsx +++ b/openmetadata-ui-core-components/src/main/resources/ui/src/components/base/badges/badges.tsx @@ -157,6 +157,7 @@ interface BadgeProps { children: ReactNode; className?: string; bordered?: boolean; + 'data-testid'?: string; } export const Badge = (props: BadgeProps) => { @@ -196,7 +197,8 @@ export const Badge = (props: BadgeProps) => { colors.styles[color].root, bordered && 'tw:ring-1 tw:ring-inset', props.className - )}> + )} + data-testid={props['data-testid']}> {children} ); diff --git a/openmetadata-ui/src/main/resources/ui/package.json b/openmetadata-ui/src/main/resources/ui/package.json index 4eda05ff42da..e352eb8c5a35 100644 --- a/openmetadata-ui/src/main/resources/ui/package.json +++ b/openmetadata-ui/src/main/resources/ui/package.json @@ -72,6 +72,7 @@ "@internationalized/date": "^3.11.0", "@material/material-color-utilities": "^0.3.0", "@melloware/react-logviewer": "6.4.1", + "@microsoft/fetch-event-source": "^2.0.1", "@mui/icons-material": "^7.3.1", "@mui/material": "^7.3.1", "@mui/x-date-pickers": "^8.11.0", @@ -306,4 +307,4 @@ "uuid": "^14.0.0", "esbuild": "^0.28.1" } -} \ No newline at end of file +} diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AutoPilot.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AutoPilot.spec.ts index 905844c5643a..000804478a97 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AutoPilot.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/AutoPilot.spec.ts @@ -12,6 +12,7 @@ */ import { expect, test } from '@playwright/test'; +import { isEmpty } from 'lodash'; import { PLAYWRIGHT_INGESTION_TAG_OBJ } from '../../constant/config'; import AirflowIngestionClass from '../../support/entity/ingestion/AirflowIngestionClass'; import ApiIngestionClass from '../../support/entity/ingestion/ApiIngestionClass'; @@ -27,7 +28,10 @@ import { redirectToHomePage, } from '../../utils/common'; import { waitForAllLoadersToDisappear } from '../../utils/entity'; -import { getServiceCategoryFromService } from '../../utils/serviceIngestion'; +import { + getAgentCard, + getServiceCategoryFromService, +} from '../../utils/serviceIngestion'; import { settingClick, SettingOptionsType } from '../../utils/sidebar'; const user = new UserClass(); @@ -113,8 +117,66 @@ services.forEach((ServiceClass) => { await page.waitForURL('**/service/**'); await waitForAllLoadersToDisappear(page); - // Check the auto pilot status via API polling - await checkAutoPilotStatus(page, service); + // Open a parallel page on the Agents tab BEFORE any AutoPilot run + // starts. Its pipeline list loads empty, so the agent cards asserted + // below can only arrive through the SSE DISCOVERY events that carry + // the newly created pipeline entities — the page is never reloaded. + const agentsPage = + service.serviceType === 'Mysql' + ? await page.context().newPage() + : undefined; + + try { + if (agentsPage) { + await agentsPage.goto(page.url()); + await waitForAllLoadersToDisappear(agentsPage); + await agentsPage.click('[role="tab"] [data-testid="agents"]'); + + const metadataSubTab = agentsPage.locator( + '[data-testid="metadata-sub-tab"]' + ); + if (await metadataSubTab.isVisible()) { + await metadataSubTab.click(); + } + } + + // Check the auto pilot status via API polling + await checkAutoPilotStatus(page, service); + + if (agentsPage) { + const { apiContext } = await getApiContext(agentsPage); + const pipelinesResponse = await apiContext.get( + `/api/v1/services/ingestionPipelines?fields=pipelineStatuses&service=${ + service.serviceResponseData.name + }&pipelineType=metadata%2Cusage%2Clineage%2Cprofiler%2CautoClassification%2Cdbt&serviceType=${getServiceCategoryFromService( + service.category + )}&limit=15` + ); + const pipelines: Array<{ + name: string; + pipelineStatuses?: unknown; + }> = (await pipelinesResponse.json()).data; + + // Only pipelines that actually ran emit DISCOVERY frames; the + // ones AutoPilot leaves Pending never stream and stay invisible. + const ranPipelines = pipelines.filter( + (pipeline) => !isEmpty(pipeline.pipelineStatuses) + ); + + expect(ranPipelines.length).toBeGreaterThan(0); + + for (const pipeline of ranPipelines) { + const agentCard = getAgentCard(agentsPage, pipeline.name); + + await expect(agentCard).toBeVisible(); + await expect( + agentCard.getByTestId('pipeline-status') + ).not.toBeEmpty(); + } + } + } finally { + await agentsPage?.close(); + } // Reload to render the completed workflow status in the UI. // The page was loaded before the workflow finished, and the WebSocket diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ServiceAgentsLiveProgress.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ServiceAgentsLiveProgress.spec.ts new file mode 100644 index 000000000000..a0228a179c86 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ServiceAgentsLiveProgress.spec.ts @@ -0,0 +1,396 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { APIRequestContext, expect, Page, test } from '@playwright/test'; +import { randomUUID } from 'crypto'; +import { PLAYWRIGHT_INGESTION_TAG_OBJ } from '../../constant/config'; +import { DatabaseServiceClass } from '../../support/entity/service/DatabaseServiceClass'; +import { + createNewPage, + getApiContext, + redirectToHomePage, + uuid, +} from '../../utils/common'; +import { getAgentCard } from '../../utils/serviceIngestion'; + +// use the admin user to login +test.use({ storageState: 'playwright/.auth/admin.json' }); + +const service = new DatabaseServiceClass(); +let pipelineFqn = ''; +let pipelineName = ''; + +/** + * End-to-end without mocks: the browser holds a real SSE connection to + * `GET /progress/service/{serviceType}/{serviceFqn}/stream` while the test + * publishes real ProgressUpdate frames through + * `PUT /progress/{fqn}/{runId}` — the exact endpoint the Python ingestion + * workflow uses (OMetaProgressMixin). Events flow through the real + * IngestionProgressTracker and SSE broadcaster. + */ +const publishProgress = async ( + apiContext: APIRequestContext, + runId: string, + updateType: 'PROCESSING' | 'PIPELINE_COMPLETE', + done: number, + estimatedSecondsRemaining: number +) => { + const response = await apiContext.put( + `/api/v1/services/ingestionPipelines/progress/${encodeURIComponent( + pipelineFqn + )}/${runId}`, + { + data: { + runId, + timestamp: Date.now(), + updateType, + globalCounters: [{ entityType: 'Table', done, total: 1000 }], + estimatedSecondsRemaining, + }, + } + ); + + expect(response.status()).toBe(200); +}; + +const openAgentsTab = async (page: Page) => { + await redirectToHomePage(page); + await service.visitEntityPage(page); + await page.getByTestId('data-assets-header').waitFor(); + await page.getByTestId('agents').click(); + + const metadataSubTab = page.getByTestId('metadata-sub-tab'); + if (await metadataSubTab.isVisible()) { + await metadataSubTab.click(); + } +}; + +test.describe( + 'Service Agents live progress (SSE)', + PLAYWRIGHT_INGESTION_TAG_OBJ, + () => { + test.beforeAll(async ({ browser }) => { + const { apiContext, afterAction } = await createNewPage(browser); + + await service.create(apiContext); + + pipelineName = `pw-live-progress-${uuid()}`; + const pipelineResponse = await apiContext.post( + '/api/v1/services/ingestionPipelines', + { + data: { + airflowConfig: {}, + loggerLevel: 'INFO', + name: pipelineName, + pipelineType: 'metadata', + service: { + id: service.entityResponseData.id, + type: 'databaseService', + }, + sourceConfig: { config: { type: 'DatabaseMetadata' } }, + }, + } + ); + + expect(pipelineResponse.status()).toBe(201); + + const pipeline = await pipelineResponse.json(); + pipelineFqn = pipeline.fullyQualifiedName; + + // Seed one finished run so the terminal reconcile refetch has real + // pipelineStatuses to map and the card renders run history entry points + const now = Date.now(); + const statusResponse = await apiContext.put( + `/api/v1/services/ingestionPipelines/${encodeURIComponent( + pipelineFqn + )}/pipelineStatus`, + { + data: { + runId: randomUUID(), + pipelineState: 'success', + startDate: now - 120000, + timestamp: now - 120000, + endDate: now - 60000, + }, + } + ); + + expect(statusResponse.ok()).toBeTruthy(); + + await afterAction(); + }); + + test.afterAll(async ({ browser }) => { + const { apiContext, afterAction } = await createNewPage(browser); + + await service.delete(apiContext); + await afterAction(); + }); + + test('agent card and summary update live from the progress stream', async ({ + page, + }) => { + test.slow(); + + const runId = randomUUID(); + + await openAgentsTab(page); + + const { apiContext } = await getApiContext(page); + + const agentCard = getAgentCard(page, pipelineName); + + await expect(agentCard).toBeVisible(); + + await test.step('Seeded run renders before any live event', async () => { + await expect(agentCard.getByTestId('pipeline-status')).toContainText( + 'Success' + ); + await expect( + agentCard.getByTestId('agent-run-dot').first() + ).toBeVisible(); + }); + + await test.step('First progress frame flips the card to running', async () => { + await publishProgress(apiContext, runId, 'PROCESSING', 350, 120); + + await expect(agentCard.getByTestId('pipeline-status')).toContainText( + 'Running' + ); + await expect(agentCard.getByTestId('agent-progress-bar')).toBeVisible(); + await expect( + agentCard.getByTestId('agent-assets-metric') + ).toContainText('350'); + await expect(agentCard.getByTestId('agent-eta-metric')).toBeVisible(); + + await expect(page.getByTestId('deployment-summary-card')).toBeVisible(); + await expect(page.getByTestId('summary-assets-ingested')).toContainText( + '350' + ); + await expect(page.getByTestId('deployment-progress-bar')).toBeVisible(); + }); + + await test.step('Next frame advances the counters', async () => { + await publishProgress(apiContext, runId, 'PROCESSING', 700, 45); + + await expect( + agentCard.getByTestId('agent-assets-metric') + ).toContainText('700'); + await expect(page.getByTestId('summary-assets-ingested')).toContainText( + '700' + ); + }); + + await test.step('Terminal frame completes the run', async () => { + await publishProgress(apiContext, runId, 'PIPELINE_COMPLETE', 1000, 0); + + await expect(agentCard.getByTestId('pipeline-status')).toContainText( + 'Success' + ); + await expect(agentCard.getByTestId('agent-progress-bar')).toBeHidden(); + await expect( + page.getByTestId('deployment-summary-title') + ).toContainText('Deployment complete'); + }); + }); + } +); + +test.describe( + 'Service Agents stream discovery (SSE)', + PLAYWRIGHT_INGESTION_TAG_OBJ, + () => { + const discoveryService = new DatabaseServiceClass(); + + test.beforeAll(async ({ browser }) => { + const { apiContext, afterAction } = await createNewPage(browser); + + await discoveryService.create(apiContext); + await afterAction(); + }); + + test.afterAll(async ({ browser }) => { + const { apiContext, afterAction } = await createNewPage(browser); + + await discoveryService.delete(apiContext); + await afterAction(); + }); + + test('agent discovered from the stream updates card and tab counts without reload', async ({ + page, + }) => { + test.slow(); + + await redirectToHomePage(page); + await discoveryService.visitEntityPage(page); + await page.getByTestId('data-assets-header').waitFor(); + await page.getByTestId('agents').click(); + + const metadataSubTab = page.getByTestId('metadata-sub-tab'); + const hasSubTabs = await metadataSubTab.isVisible(); + if (hasSubTabs) { + await metadataSubTab.click(); + } + + const agentsTabCount = page + .getByTestId('agents') + .getByTestId('filter-count'); + const initialTabCount = Number( + (await agentsTabCount.textContent()) ?? '0' + ); + const initialSubTabCount = hasSubTabs + ? Number((await metadataSubTab.textContent())?.match(/\d+/)?.[0] ?? '0') + : 0; + + const { apiContext } = await getApiContext(page); + + // The pipeline is created only AFTER the page loaded its (empty) agent + // list, so the card and counts below can only come from the stream. + const discoveredPipelineName = `pw-discovered-agent-${uuid()}`; + const pipelineResponse = await apiContext.post( + '/api/v1/services/ingestionPipelines', + { + data: { + airflowConfig: {}, + loggerLevel: 'INFO', + name: discoveredPipelineName, + pipelineType: 'metadata', + service: { + id: discoveryService.entityResponseData.id, + type: 'databaseService', + }, + sourceConfig: { config: { type: 'DatabaseMetadata' } }, + }, + } + ); + + expect(pipelineResponse.status()).toBe(201); + + const discoveredPipeline = await pipelineResponse.json(); + const runId = randomUUID(); + + // The server attaches the pipeline entity to the DISCOVERY frame, which + // is what lets the UI insert the agent it has never fetched. + const discoveryResponse = await apiContext.put( + `/api/v1/services/ingestionPipelines/progress/${encodeURIComponent( + discoveredPipeline.fullyQualifiedName + )}/${runId}`, + { + data: { + runId, + timestamp: Date.now(), + updateType: 'DISCOVERY', + }, + } + ); + + expect(discoveryResponse.status()).toBe(200); + + await test.step('Card appears live without a reload', async () => { + const agentCard = getAgentCard(page, discoveredPipelineName); + + await expect(agentCard).toBeVisible(); + await expect(agentCard.getByTestId('pipeline-status')).toContainText( + 'Running' + ); + }); + + await test.step('Agents tab count includes the discovered agent', async () => { + await expect(agentsTabCount).toHaveText(String(initialTabCount + 1)); + }); + + if (hasSubTabs) { + await test.step('Metadata sub-tab count includes the discovered agent', async () => { + await expect(metadataSubTab).toContainText( + String(initialSubTabCount + 1) + ); + }); + } + }); + + test('agent discovered while on another tab updates count and appears on Agents tab', async ({ + page, + }) => { + test.slow(); + + // Stay on the default tab; the discovery stream must be connected at + // page level for the tab count and agent list to update. + await redirectToHomePage(page); + await discoveryService.visitEntityPage(page); + await page.getByTestId('data-assets-header').waitFor(); + + const agentsTabCount = page + .getByTestId('agents') + .getByTestId('filter-count'); + const initialTabCount = Number( + (await agentsTabCount.textContent()) ?? '0' + ); + + const { apiContext } = await getApiContext(page); + + // Created only AFTER the page loaded, so the updates below can only + // come from the SSE stream — mirrors autopilot creating an agent. + const discoveredPipelineName = `pw-discovered-agent-${uuid()}`; + const pipelineResponse = await apiContext.post( + '/api/v1/services/ingestionPipelines', + { + data: { + airflowConfig: {}, + loggerLevel: 'INFO', + name: discoveredPipelineName, + pipelineType: 'metadata', + service: { + id: discoveryService.entityResponseData.id, + type: 'databaseService', + }, + sourceConfig: { config: { type: 'DatabaseMetadata' } }, + }, + } + ); + + expect(pipelineResponse.status()).toBe(201); + + const discoveredPipeline = await pipelineResponse.json(); + const runId = randomUUID(); + + const discoveryResponse = await apiContext.put( + `/api/v1/services/ingestionPipelines/progress/${encodeURIComponent( + discoveredPipeline.fullyQualifiedName + )}/${runId}`, + { + data: { + runId, + timestamp: Date.now(), + updateType: 'DISCOVERY', + }, + } + ); + + expect(discoveryResponse.status()).toBe(200); + + await test.step('Agents tab count updates while on another tab', async () => { + await expect(agentsTabCount).toHaveText(String(initialTabCount + 1)); + }); + + await test.step('Discovered agent card is present on the Agents tab without reload', async () => { + await page.getByTestId('agents').click(); + + const metadataSubTab = page.getByTestId('metadata-sub-tab'); + if (await metadataSubTab.isVisible()) { + await metadataSubTab.click(); + } + + await expect(getAgentCard(page, discoveredPipelineName)).toBeVisible(); + }); + }); + } +); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/ServiceCreationPermissions.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/ServiceCreationPermissions.spec.ts index 68d5f3c2ea47..f0b9bd319976 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/ServiceCreationPermissions.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/ServiceCreationPermissions.spec.ts @@ -32,6 +32,7 @@ import { updateDescription } from '../../utils/entity'; import { visitServiceDetailsPage } from '../../utils/service'; import { advanceToServiceConnectionStep, + getAgentCard, mockSuccessfulTestConnection, selectServiceConnector, testConnectionIfRequired, @@ -101,9 +102,9 @@ const openPipelineActions = async (page: Page) => { await metadataSubTab.click(); } - const actionButton = page - .locator(`[data-row-key*="${ingestionPipelineName}"]`) - .getByTestId('more-actions'); + const actionButton = getAgentCard(page, ingestionPipelineName).getByTestId( + 'more-actions' + ); await actionButton.waitFor(); await actionButton.click(); @@ -588,19 +589,32 @@ test.describe( await expect(page.getByTestId('edit-button')).toBeHidden(); await expect(page.getByTestId('kill-button')).toBeHidden(); - const triggerResponse = page.waitForResponse( - (response) => - response - .url() - .includes('/api/v1/services/ingestionPipelines/trigger/') && - response.request().method() === 'POST' - ); + // The pipeline deployed in beforeAll may still be registering in + // Airflow, so retry the trigger until it succeeds instead of a fixed sleep. + await expect + .poll( + async () => { + const triggerResponse = page.waitForResponse( + (response) => + response + .url() + .includes('/api/v1/services/ingestionPipelines/trigger/') && + response.request().method() === 'POST' + ); - await page.getByTestId('run-button').click(); + await page.getByTestId('run-button').click(); - const response = await triggerResponse; + const response = await triggerResponse; - expect(response.status()).toBe(200); + if (response.status() !== 200) { + await openPipelineActions(page); + } + + return response.status(); + }, + { intervals: [3_000], timeout: 90_000 } + ) + .toBe(200); }); test('User with EditAll but not Trigger cannot run a pipeline', async ({ @@ -609,7 +623,6 @@ test.describe( await openPipelineActions(page); await expect(page.getByTestId('edit-button')).toBeVisible(); - await expect(page.getByTestId('kill-button')).toBeVisible(); await expect(page.getByTestId('re-deploy-button')).toBeVisible(); await expect(page.getByTestId('run-button')).toBeHidden(); }); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/nightly/ServiceIngestion.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/nightly/ServiceIngestion.spec.ts index 5c1dc0cd4f11..0c36751ec763 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/nightly/ServiceIngestion.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/nightly/ServiceIngestion.spec.ts @@ -33,7 +33,7 @@ import { redirectToHomePage, } from '../../utils/common'; import { visitServiceDetailsPage } from '../../utils/service'; -import { makeRetryRequest } from '../../utils/serviceIngestion'; +import { getAgentCard, makeRetryRequest } from '../../utils/serviceIngestion'; import { settingClick, SettingOptionsType } from '../../utils/sidebar'; const table = new TableClass(); @@ -372,19 +372,29 @@ test.describe.serial( .getByTestId('loader') .waitFor({ state: 'detached' }); - const pipelineRow = page.locator(`[data-row-key*="${pipeline.name}"]`); + const agentCard = getAgentCard(page, pipeline.name); - await expect(pipelineRow).toBeVisible(); + await expect(agentCard).toBeVisible(); - const runStatusBadges = pipelineRow.getByTestId('pipeline-status'); + const runDots = agentCard.getByTestId('agent-run-dot'); - await expect(runStatusBadges).toHaveCount(TOTAL_RUNS); + await expect(runDots).toHaveCount(TOTAL_RUNS); - const latestBadge = runStatusBadges.last(); - - await expect(latestBadge).toContainText( - /(Success|Failed|PartialSuccess)/i + await expect(agentCard.getByTestId('pipeline-status')).toContainText( + /(Success|Failed)/i ); + + // Latest run dot opens the run history drawer with the full run list + await runDots.first().click(); + + await expect(page.getByTestId('run-history-drawer')).toBeVisible(); + await expect( + page.getByTestId('run-history-item').first() + ).toBeVisible(); + + expect( + await page.getByTestId('run-history-item').count() + ).toBeGreaterThanOrEqual(TOTAL_RUNS); }); }); } @@ -504,26 +514,20 @@ test.describe.serial( await metadataTab.click(); } - const pipelineRow = page.locator( - `[data-row-key*="${slowTestPipeline.name}"]` - ); - - await expect(pipelineRow).toBeVisible(); + const agentCard = getAgentCard(page, slowTestPipeline.name); - // skeleton while the slow pipelineStatus API is still in-flight — - // confirming the UI reflects the pending state in both columns - await expect(pipelineRow.locator('.ant-skeleton-input')).toHaveCount(2); + await expect(agentCard).toBeVisible(); // Action buttons must be visible immediately — before the slow pipelineStatus // API resolves — verifying permissions don't wait on run history - await expect(pipelineRow.getByTestId('pause-button')).toBeVisible(); + await expect(agentCard.getByTestId('logs-button')).toBeVisible(); - await expect(pipelineRow.getByTestId('logs-button')).toBeVisible(); + await expect(agentCard.getByTestId('run-agent-button')).toBeVisible(); - await expect(pipelineRow.getByTestId('more-actions')).toBeVisible(); + await expect(agentCard.getByTestId('more-actions')).toBeVisible(); // Open the more-actions dropdown and verify the run button is present - await pipelineRow.getByTestId('more-actions').click(); + await agentCard.getByTestId('more-actions').click(); await expect(page.getByTestId('run-button')).toBeVisible(); // Trigger a pipeline run via the run button. @@ -544,10 +548,8 @@ test.describe.serial( await triggerResponse; await statusRefreshResponse; - // Verify the run was triggered by checking the pipeline row shows a running state - await expect( - pipelineRow.getByTestId('pipeline-status').first() - ).toBeVisible(); + // Verify the run was triggered by checking the card shows a status pill + await expect(agentCard.getByTestId('pipeline-status')).toBeVisible(); }); } ); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/MySqlIngestionClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/MySqlIngestionClass.ts index ce5436b1a3a8..49024c555a33 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/MySqlIngestionClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/MySqlIngestionClass.ts @@ -33,6 +33,7 @@ import { expandAdvancedConfig } from '../../../utils/profilerForm'; import { visitServiceDetailsPage } from '../../../utils/service'; import { checkServiceFieldSectionHighlighting, + getAgentCard, Services, } from '../../../utils/serviceIngestion'; import ServiceBaseClass from './ServiceBaseClass'; @@ -94,6 +95,13 @@ class MysqlIngestionClass extends ServiceBaseClass { async fillIngestionDetails(page: Page) { for (const filter of this.tableFilter) { + await waitForAllLoadersToDisappear(page); + const ingestionFilterSection = page.getByTestId( + 'ingestion-section-filters' + ); + if (await ingestionFilterSection.isVisible()) { + ingestionFilterSection.click(); + } await page.getByTestId('filter-section-tableFilterPattern').click(); await page.getByTestId('tableFilterPattern-only-specific-button').click(); await page @@ -108,6 +116,7 @@ class MysqlIngestionClass extends ServiceBaseClass { .press('Enter'); } for (const schema of this.excludeSchemas) { + await page.getByTestId('filter-section-schemaFilterPattern').click(); await page .getByTestId('filter-section-schemaFilterPattern') .getByTestId('exclude-filter-input') @@ -173,7 +182,7 @@ class MysqlIngestionClass extends ServiceBaseClass { .getByTestId('profile-sample-input') .locator('input') .fill('10'); - await page.click('[data-testid="submit-btn"]'); + await page.click('[data-testid="next-button"]'); // Make sure we create ingestion with None schedule to avoid conflict between Airflow and Argo behavior await this.scheduleIngestion(page); @@ -204,9 +213,9 @@ class MysqlIngestionClass extends ServiceBaseClass { // eslint-disable-next-line playwright/no-wait-for-timeout -- pipeline deployment settling time await page.waitForTimeout(3000); - await page.click( - `[data-row-key*="${response.data[0].name}"] [data-testid="more-actions"]` - ); + await getAgentCard(page, response.data[0].name) + .getByTestId('more-actions') + .click(); await page.getByTestId('run-button').click(); await toastNotification(page, `Pipeline triggered successfully!`); @@ -234,21 +243,30 @@ class MysqlIngestionClass extends ServiceBaseClass { } async validateIngestionDetails(page: Page) { - const tableIncludes = page.getByTestId( - 'workflow-array-field-root/tableFilterPattern/includes' + await waitForAllLoadersToDisappear(page); + const ingestionFilterSection = page.getByTestId( + 'ingestion-section-filters' ); + if (await ingestionFilterSection.isVisible()) { + ingestionFilterSection.click(); + } + await page.getByTestId('filter-section-tableFilterPattern').click(); + await page.getByTestId('filter-section-schemaFilterPattern').click(); + const tableIncludes = page.getByTestId('filter-section-tableFilterPattern'); const schemaExcludes = page.getByTestId( - 'workflow-array-field-root/schemaFilterPattern/excludes' + 'filter-section-schemaFilterPattern' ); - await tableIncludes.waitFor(); - for (const filter of this.tableFilter) { - await expect(tableIncludes.locator(`[title="${filter}"]`)).toBeVisible(); + await expect( + tableIncludes.getByTestId(`include-chip-contains:${filter}`) + ).toBeVisible(); } for (const schema of this.excludeSchemas) { - await expect(schemaExcludes.locator(`[title="${schema}"]`)).toBeVisible(); + await expect( + schemaExcludes.getByTestId(`exclude-chip-startsWith:^${schema}`) + ).toBeVisible(); } } } diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/PostgresIngestionClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/PostgresIngestionClass.ts index 7f426e3f3634..815c55805c58 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/PostgresIngestionClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/PostgresIngestionClass.ts @@ -30,6 +30,7 @@ import { import { visitServiceDetailsPage } from '../../../utils/service'; import { checkServiceFieldSectionHighlighting, + getAgentCard, Services, } from '../../../utils/serviceIngestion'; import ServiceBaseClass from './ServiceBaseClass'; @@ -158,9 +159,9 @@ class PostgresIngestionClass extends ServiceBaseClass { // eslint-disable-next-line playwright/no-wait-for-timeout -- pipeline deployment settling time await page.waitForTimeout(3000); - await page.click( - `[data-row-key*="${response.data[0].name}"] [data-testid="more-actions"]` - ); + await getAgentCard(page, response.data[0].name) + .getByTestId('more-actions') + .click(); await page.getByTestId('run-button').click(); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/RedshiftWithDBTIngestionClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/RedshiftWithDBTIngestionClass.ts index dc11e18999fd..de5a12329082 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/RedshiftWithDBTIngestionClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/RedshiftWithDBTIngestionClass.ts @@ -33,6 +33,7 @@ import { visitLineageTab } from '../../../utils/lineage'; import { visitServiceDetailsPage } from '../../../utils/service'; import { checkServiceFieldSectionHighlighting, + getAgentCard, Services, } from '../../../utils/serviceIngestion'; import { sidebarClick } from '../../../utils/sidebar'; @@ -190,9 +191,9 @@ class RedshiftWithDBTIngestionClass extends ServiceBaseClass { // eslint-disable-next-line playwright/no-wait-for-timeout -- pipeline deployment settling time await page.waitForTimeout(3000); - await page.click( - `[data-row-key*="${response.data[0].name}"] [data-testid="more-actions"]` - ); + await getAgentCard(page, response.data[0].name) + .getByTestId('more-actions') + .click(); await page.getByTestId('run-button').click(); await toastNotification(page, `Pipeline triggered successfully!`); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts index d7f41e387728..c22b8a157b6b 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts @@ -25,11 +25,15 @@ import { executeWithRetry, getApiContext, } from '../../../utils/common'; -import { visitEntityPage } from '../../../utils/entity'; +import { + visitEntityPage, + waitForAllLoadersToDisappear, +} from '../../../utils/entity'; import { visitServiceDetailsPage } from '../../../utils/service'; import { advanceToServiceConnectionStep, deleteService, + getAgentCard, getServiceCategoryFromService, makeRetryRequest, selectServiceConnector, @@ -195,7 +199,7 @@ class ServiceBaseClass { await page.click('[data-testid="next-button"]'); // Go back and data should persist - await page.click('[data-testid="back-button"]'); + await page.click('[data-testid="previous-button"]'); await this.validateIngestionDetails(page); // Go Next @@ -278,7 +282,7 @@ class ServiceBaseClass { // Check validation error thrown for a cron that is too frequent // i.e. having interval less than 1 hour await page.locator('#schedular-form_cron').fill('* * * 2 6'); - await page.click('[data-testid="deploy-button"]'); + await page.click('[data-testid="next-button"]'); await expect( page.getByText( @@ -288,7 +292,7 @@ class ServiceBaseClass { // Check validation error thrown for a cron that is invalid await page.locator('#schedular-form_cron').clear(); - await page.click('[data-testid="deploy-button"]'); + await page.click('[data-testid="next-button"]'); await page.locator('#schedular-form_cron').fill('* * * 2 '); await expect( @@ -323,7 +327,7 @@ class ServiceBaseClass { `/api/v1/services/ingestionPipelines/deploy/**` ); - await page.click('[data-testid="deploy-button"]'); + await page.click('[data-testid="next-button"]'); await deployPipelinePromise; @@ -394,16 +398,11 @@ class ServiceBaseClass { await metadataTab2.click(); } await expect( - page - .locator(`[data-row-key*="${workflowData.name}"]`) - .getByTestId('pipeline-type') + getAgentCard(page, workflowData.name).getByTestId('pipeline-type') ).toContainText(startCase(ingestionType), { ignoreCase: true }); await expect( - page - .locator(`[data-row-key*="${workflowData.name}"]`) - .getByTestId('pipeline-status') - .last() + getAgentCard(page, workflowData.name).getByTestId('pipeline-status') ).toContainText('Success'); }; @@ -481,7 +480,7 @@ class ServiceBaseClass { .click(); // Deploy with schedule - await page.click('[data-testid="deploy-button"]'); + await page.click('[data-testid="next-button"]'); await page.click('[data-testid="view-service-button"]'); await expect(page.getByTestId('schedule-primary-details')).toHaveText( @@ -505,7 +504,7 @@ class ServiceBaseClass { await page.click('#minute-select_list + .rc-virtual-list [title="04"]'); // Deploy with schedule - await page.click('[data-testid="deploy-button"]'); + await page.click('[data-testid="next-button"]'); const getIngestionPipelines = page.waitForRequest( `/api/v1/services/ingestionPipelines?**` @@ -538,7 +537,7 @@ class ServiceBaseClass { await page.click('#minute-select_list + .rc-virtual-list [title="05"]'); // Deploy with schedule - await page.click('[data-testid="deploy-button"]'); + await page.click('[data-testid="next-button"]'); await page.click('[data-testid="view-service-button"]'); await expect(page.getByTestId('schedule-primary-details')).toHaveText( @@ -558,7 +557,7 @@ class ServiceBaseClass { // Schedule & Deploy await page.locator('#schedular-form_cron').fill('0 * * 2 6'); - await page.click('[data-testid="deploy-button"]'); + await page.click('[data-testid="next-button"]'); await page.click('[data-testid="view-service-button"]'); await expect(page.getByTestId('schedule-primary-details')).toHaveText( @@ -612,19 +611,14 @@ class ServiceBaseClass { false ); - const ingestionResponse = page.waitForResponse( - `/api/v1/services/ingestionPipelines/*/pipelineStatus?**` - ); await page.click('[data-testid="agents"]'); const metadataTab2 = page.locator('[data-testid="metadata-sub-tab"]'); if (await metadataTab2.isVisible()) { await metadataTab2.click(); } - await ingestionResponse; - await page - .getByRole('cell', { name: 'Pause Logs' }) - .waitFor({ state: 'visible' }); + await waitForAllLoadersToDisappear(page); + await page.getByTestId('logs-button').first().waitFor({ state: 'visible' }); // eslint-disable-next-line playwright/no-wait-for-timeout -- pipeline deployment settling time await page.waitForTimeout(3000); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/serviceIngestion.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/serviceIngestion.ts index fed07087cb07..ecde89a25669 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/serviceIngestion.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/serviceIngestion.ts @@ -29,6 +29,9 @@ export enum Services { API = GlobalSettingOptions.APIS, } +export const getAgentCard = (page: Page, pipelineName: string) => + page.locator(`[data-testid^="agent-card-"][data-testid*="${pipelineName}"]`); + export const getEntityTypeFromService = (service: Services) => { switch (service) { case Services.Dashboard: diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/lineage.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/lineage.svg new file mode 100644 index 000000000000..af2cbc816c19 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/lineage.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/play.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/play.svg new file mode 100644 index 000000000000..956b330e5ea5 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/play.svg @@ -0,0 +1,3 @@ + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-failed.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-failed.svg new file mode 100644 index 000000000000..a13df63f6ca6 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-failed.svg @@ -0,0 +1,4 @@ + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-partial.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-partial.svg new file mode 100644 index 000000000000..bb629cd5ba4e --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-partial.svg @@ -0,0 +1,4 @@ + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-running.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-running.svg new file mode 100644 index 000000000000..6121181f0161 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-running.svg @@ -0,0 +1,4 @@ + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-skipped.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-skipped.svg new file mode 100644 index 000000000000..98aa8aedbf68 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-skipped.svg @@ -0,0 +1,3 @@ + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-success.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-success.svg new file mode 100644 index 000000000000..b19ce036494b --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/run-success.svg @@ -0,0 +1,4 @@ + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/sparkle.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/sparkle.svg new file mode 100644 index 000000000000..92e7014ef091 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/agents/sparkle.svg @@ -0,0 +1,4 @@ + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/AgentsPage.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/AgentsPage.interface.ts new file mode 100644 index 000000000000..64c345a19ebd --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/AgentsPage.interface.ts @@ -0,0 +1,118 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PipelineType } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline'; + +export type AgentStatus = 'running' | 'success' | 'failed' | 'queued' | 'none'; + +export type RunStatus = + | 'success' + | 'partial' + | 'failed' + | 'running' + | 'skipped'; + +export type AgentTab = 'metadata' | 'ai'; + +export type LogLevel = 'info' | 'warn' | 'error' | 'debug'; + +export interface AgentRecentRun { + id: string; + status: RunStatus; +} + +export interface AgentActionPermissions { + trigger: boolean; + edit: boolean; + delete: boolean; +} + +export interface Agent { + id: string; + fqn: string; + pipelineType: PipelineType; + name: string; + type: string; + unit: string; + verb: string; + status: AgentStatus; + pct: number; + eta: number | null; + assets: number; + target: number; + errors: number; + warnings: number; + recentRuns: AgentRecentRun[]; + after?: string; + finishedAt?: string; + failStep?: string; +} + +export interface AgentsState { + metadata: Agent[]; + ai: Agent[]; +} + +export interface RunAttention { + severity: 'error' | 'warning'; + title: string; + message: string; + hint?: string; + stackTrace?: string; +} + +export interface RunStep { + name: string; + status: RunStatus; + records: number; + filtered: number; + updated: number; + warnings: number; + errors: number; + attention?: RunAttention; +} + +export interface RunTotals { + records: number; + filtered: number; + updated: number; + warnings: number; + errors: number; +} + +export interface AgentRun { + id: string; + status: RunStatus; + startedAt: string; + duration: number; + totals: RunTotals; + steps: RunStep[]; +} + +export interface LogLine { + time: string; + level: LogLevel; + text: string; +} + +export interface BreadcrumbItem { + label: string; + isLink: boolean; +} + +export interface ServiceInfo { + name: string; + typeLabel: string; + iconSrc: string; + breadcrumb: BreadcrumbItem[]; +} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/agents-preview.css b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/agents-preview.css new file mode 100644 index 000000000000..4bfc0c8f1225 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/agents-preview.css @@ -0,0 +1,33 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@keyframes rddrawer { + from { + transform: translateX(100%); + opacity: 0; + } + to { + transform: translateX(0); + opacity: 1; + } +} + +@keyframes agspin { + to { + transform: rotate(360deg); + } +} + +.agents-drawer { + animation: rddrawer 0.22s ease; +} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentCard.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentCard.component.tsx new file mode 100644 index 000000000000..82c74bb6d68c --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentCard.component.tsx @@ -0,0 +1,266 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Box, Button, Card } from '@openmetadata/ui-core-components'; +import { + AlertCircle, + AlertTriangle, + AlignLeft, + Clock, + Database01, + Terminal, +} from '@untitledui/icons'; +import { FC } from 'react'; +import { useTranslation } from 'react-i18next'; +import { ReactComponent as PlayIcon } from '../../../assets/svg/agents/play.svg'; +import { Agent, AgentActionPermissions } from '../AgentsPage.interface'; +import { + AGENT_ICON_CLASS, + AGENT_TYPE_ICON, + fmtNum, + formatEtaLong, + getAgentTypeLabelKey, + getEtaInfo, + getUnitLabelKey, + getUnitVerbLabelKey, + NO_AGENT_PERMISSIONS, + RUN_DOT_CLASS, + RUN_META, +} from '../utils/agents.utils'; +import AgentOverflowMenu from './AgentOverflowMenu.component'; +import Metric from './shared/Metric.component'; +import ProgressBar from './shared/ProgressBar.component'; +import StatusPill from './shared/StatusPill.component'; + +interface AgentCardProps { + agent: Agent; + permissions?: AgentActionPermissions; + onAction: (action: string, agent: Agent) => void; + onLogs: (agent: Agent) => void; + onRun: (agent: Agent) => void; + onRunDetails: (agent: Agent, runId?: string) => void; +} + +const AgentCard: FC = ({ + agent, + permissions = NO_AGENT_PERMISSIONS, + onAction, + onLogs, + onRun, + onRunDetails, +}) => { + const { t } = useTranslation(); + const Icon = AGENT_TYPE_ICON[agent.type] ?? AGENT_TYPE_ICON.Metadata; + const isRunning = agent.status === 'running'; + const isFailed = agent.status === 'failed'; + const isQueued = agent.status === 'queued'; + const isSuccess = agent.status === 'success'; + const isNone = agent.status === 'none'; + const showLastRunMetric = + isSuccess || (isNone && (agent.assets > 0 || Boolean(agent.finishedAt))); + const finishedSuffix = agent.finishedAt + ? ` · ${t('label.finished-lowercase')} ${agent.finishedAt}` + : ''; + const unitLabel = t(getUnitLabelKey(agent.unit)); + const unitVerbLabel = t(getUnitVerbLabelKey(agent.verb)); + const etaLabel = formatEtaLong(getEtaInfo(agent.eta), t); + const unitIcon = + agent.unit === 'queries' ? ( + + ) : ( + + ); + + return ( + + {isRunning && ( +
+ )} + + {/* identity */} + + + + +
+
+ {agent.name} +
+
+ {t(getAgentTypeLabelKey(agent.type))} +
+
+
+ + {/* live status zone */} +
+ + + {isRunning && ( + + )} + {isRunning && ( + } + value={etaLabel} + /> + )} + {showLastRunMetric && ( + + )} + {isQueued && agent.after && ( + + {t('label.starts-after')}{' '} + + {agent.after} + + + )} + {isFailed && agent.failStep && ( + } + label={`· ${fmtNum(agent.assets)} ${unitLabel} ${t( + 'label.before-error' + )}`} + tone="error" + value={`${t('label.failed-at')} ${agent.failStep}`} + /> + )} + + {agent.errors > 0 && ( + } + label={t('label.error-plural-lowercase')} + tone="error" + value={agent.errors} + /> + )} + {agent.warnings > 0 && ( + } + label={t('label.warning-plural-lowercase')} + tone="warn" + value={agent.warnings} + /> + )} + + {isRunning && ( +
+ +
+ )} + {!isRunning && agent.recentRuns.length > 0 && ( + + + {t('label.recent-runs-sentence')} + + + {agent.recentRuns.map((run, index) => ( + + + )} +
+ + {/* actions */} + + {isFailed ? ( + + ) : ( + + )} + {!isRunning && permissions.trigger && ( + + )} + onAction(action, agent)} + /> + +
+ + ); +}; + +export default AgentCard; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentCard.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentCard.test.tsx new file mode 100644 index 000000000000..abb070f011cb --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentCard.test.tsx @@ -0,0 +1,173 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { fireEvent, render, screen } from '@testing-library/react'; +import { PipelineType } from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { Agent, AgentActionPermissions } from '../AgentsPage.interface'; +import AgentCard from './AgentCard.component'; + +jest.mock('./AgentOverflowMenu.component', () => + jest.fn().mockImplementation(() =>

AgentOverflowMenu

) +); + +jest.mock('./shared/StatusPill.component', () => + jest.fn().mockImplementation(() =>

StatusPill

) +); + +jest.mock('./shared/ProgressBar.component', () => + jest.fn().mockImplementation(() =>

ProgressBar

) +); + +jest.mock('./shared/Metric.component', () => + jest.fn().mockImplementation(() =>

Metric

) +); + +const mockOnAction = jest.fn(); +const mockOnLogs = jest.fn(); +const mockOnRun = jest.fn(); +const mockOnRunDetails = jest.fn(); + +const baseAgent: Agent = { + id: 'agent-1', + fqn: 'service.agent-1', + pipelineType: PipelineType.Metadata, + name: 'Metadata Agent', + type: 'Metadata', + unit: 'assets', + verb: 'ingested', + status: 'success', + pct: 100, + eta: 0, + assets: 100, + target: 100, + errors: 0, + warnings: 0, + recentRuns: [ + { id: 'run-a', status: 'success' }, + { id: 'run-b', status: 'failed' }, + { id: 'run-c', status: 'partial' }, + ], + finishedAt: '1m ago', +}; + +const renderCard = (agent: Agent, permissions?: AgentActionPermissions) => + render( + + ); + +describe('AgentCard', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should render one dot per recent run', () => { + renderCard(baseAgent); + + expect(screen.getByText('label.recent-runs-sentence')).toBeInTheDocument(); + expect( + screen.getAllByTitle(/message.run-status-click-details/) + ).toHaveLength(3); + }); + + it('should show recent runs for a queued agent with run history', () => { + renderCard({ ...baseAgent, status: 'queued' }); + + expect(screen.getByText('label.recent-runs-sentence')).toBeInTheDocument(); + }); + + it('should hide the recent runs row when there is no run history', () => { + renderCard({ ...baseAgent, status: 'queued', recentRuns: [] }); + + expect( + screen.queryByText('label.recent-runs-sentence') + ).not.toBeInTheDocument(); + }); + + it('should hide the recent runs row while the agent is running', () => { + renderCard({ ...baseAgent, status: 'running' }); + + expect( + screen.queryByText('label.recent-runs-sentence') + ).not.toBeInTheDocument(); + }); + + it('should show the last-run metric for a successful agent with zero assets', () => { + renderCard({ ...baseAgent, unit: 'queries', assets: 0 }); + + expect(screen.getByText('Metric')).toBeInTheDocument(); + }); + + it('should show the last-run metric for a none agent that has run data', () => { + renderCard({ ...baseAgent, status: 'none', unit: 'queries', assets: 0 }); + + expect(screen.getByText('Metric')).toBeInTheDocument(); + }); + + it('should hide the last-run metric for a none agent without run data', () => { + renderCard({ + ...baseAgent, + status: 'none', + assets: 0, + recentRuns: [], + finishedAt: undefined, + }); + + expect(screen.queryByText('Metric')).not.toBeInTheDocument(); + }); + + it('should pass the clicked run id to onRunDetails', () => { + renderCard(baseAgent); + + const dots = screen.getAllByTitle(/message.run-status-click-details/); + fireEvent.click(dots[1]); + + expect(mockOnRunDetails).toHaveBeenCalledWith(baseAgent, 'run-b'); + }); + + it('should open the latest run when clicking view run history', () => { + renderCard(baseAgent); + + fireEvent.click(screen.getByText('label.view-run-history')); + + expect(mockOnRunDetails).toHaveBeenCalledWith(baseAgent); + }); + + it('should open the latest run when clicking diagnose on a failed agent', () => { + renderCard({ ...baseAgent, status: 'failed', failStep: 'Source' }); + + fireEvent.click(screen.getByText('label.diagnose')); + + expect(mockOnRunDetails).toHaveBeenCalledWith( + expect.objectContaining({ status: 'failed' }) + ); + }); + + it('should hide the run button while permissions are unresolved', () => { + renderCard(baseAgent); + + expect(screen.queryByTestId('run-agent-button')).not.toBeInTheDocument(); + }); + + it('should show the run button when the user has trigger permission', () => { + renderCard(baseAgent, { trigger: true, edit: false, delete: false }); + + expect(screen.getByTestId('run-agent-button')).toBeInTheDocument(); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentGroup.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentGroup.component.tsx new file mode 100644 index 000000000000..5215edb6e5e3 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentGroup.component.tsx @@ -0,0 +1,119 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Badge, Box, Button, Card } from '@openmetadata/ui-core-components'; +import { ChevronDown, Plus } from '@untitledui/icons'; +import { FC, ReactNode } from 'react'; +import { useTranslation } from 'react-i18next'; +import { Agent, AgentActionPermissions } from '../AgentsPage.interface'; +import AgentCard from './AgentCard.component'; + +interface AgentGroupProps { + addAgentSlot?: ReactNode; + agentPermissions?: Record; + agents: Agent[]; + canCreateAgent: boolean; + dataTestId?: string; + descKey: string; + emptyPlaceholder?: ReactNode; + icon: ReactNode; + titleKey: string; + onAction: (action: string, agent: Agent) => void; + onLogs: (agent: Agent) => void; + onRun: (agent: Agent) => void; + onRunDetails: (agent: Agent, runId?: string) => void; +} + +const AgentGroup: FC = ({ + addAgentSlot, + agentPermissions, + agents, + canCreateAgent, + dataTestId = 'agent-group', + descKey, + emptyPlaceholder, + icon, + onAction, + onLogs, + onRun, + onRunDetails, + titleKey, +}) => { + const { t } = useTranslation(); + const runningCount = agents.filter((a) => a.status === 'running').length; + + return ( + + + + {icon} + +
+
+ {t(titleKey)} +
+
+ {t(descKey)} +
+
+ {runningCount > 0 && ( + + + {t('label.count-running', { count: runningCount })} + + )} + {addAgentSlot ?? + (canCreateAgent && ( + + ))} +
+ {agents.length === 0 && emptyPlaceholder ? ( +
+ {emptyPlaceholder} +
+ ) : ( +
+ {agents.map((agent) => ( + + ))} +
+ )} +
+ ); +}; + +export default AgentGroup; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentGroup.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentGroup.test.tsx new file mode 100644 index 000000000000..fe952215f260 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentGroup.test.tsx @@ -0,0 +1,96 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { render, screen } from '@testing-library/react'; +import { PipelineType } from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { Agent } from '../AgentsPage.interface'; +import AgentGroup from './AgentGroup.component'; + +jest.mock('./AgentCard.component', () => + jest.fn().mockImplementation(() =>

AgentCard

) +); + +const mockOnAction = jest.fn(); +const mockOnLogs = jest.fn(); +const mockOnRun = jest.fn(); +const mockOnRunDetails = jest.fn(); + +const baseAgent: Agent = { + id: 'agent-1', + fqn: 'service.agent-1', + pipelineType: PipelineType.Metadata, + name: 'Metadata Agent', + type: 'Metadata', + unit: 'assets', + verb: 'ingested', + status: 'success', + pct: 100, + eta: 0, + assets: 100, + target: 100, + errors: 0, + warnings: 0, + recentRuns: [], + finishedAt: '1m ago', +}; + +const renderGroup = (agents: Agent[], emptyPlaceholder?: React.ReactNode) => + render( + icon} + titleKey="label.metadata-agent-plural" + onAction={mockOnAction} + onLogs={mockOnLogs} + onRun={mockOnRun} + onRunDetails={mockOnRunDetails} + /> + ); + +describe('AgentGroup', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should render a card per agent and no empty placeholder', () => { + renderGroup([baseAgent],

no agents

); + + expect(screen.getByText('AgentCard')).toBeInTheDocument(); + expect( + screen.queryByTestId('agent-group-empty-placeholder') + ).not.toBeInTheDocument(); + }); + + it('should render the empty placeholder inside the group when there are no agents', () => { + renderGroup([],

no agents

); + + expect( + screen.getByTestId('agent-group-empty-placeholder') + ).toBeInTheDocument(); + expect(screen.getByText('no agents')).toBeInTheDocument(); + expect(screen.getByTestId('agent-group')).toBeInTheDocument(); + expect(screen.queryByText('AgentCard')).not.toBeInTheDocument(); + }); + + it('should render nothing extra when there are no agents and no placeholder', () => { + renderGroup([]); + + expect( + screen.queryByTestId('agent-group-empty-placeholder') + ).not.toBeInTheDocument(); + expect(screen.queryByText('AgentCard')).not.toBeInTheDocument(); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentOverflowMenu.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentOverflowMenu.component.tsx new file mode 100644 index 000000000000..09d102706472 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentOverflowMenu.component.tsx @@ -0,0 +1,125 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Dropdown } from '@openmetadata/ui-core-components'; +import { DotsVertical } from '@untitledui/icons'; +import { FC } from 'react'; +import { Button as AriaButton } from 'react-aria-components'; +import { useTranslation } from 'react-i18next'; +import { AgentActionPermissions, AgentStatus } from '../AgentsPage.interface'; +import { NO_AGENT_PERMISSIONS } from '../utils/agents.utils'; + +interface AgentOverflowMenuProps { + permissions?: AgentActionPermissions; + status: AgentStatus; + onAction: (action: string) => void; +} + +interface MenuItem { + danger?: boolean; + id: string; + label: string; + testId: string; +} + +const AgentOverflowMenu: FC = ({ + onAction, + permissions = NO_AGENT_PERMISSIONS, + status, +}) => { + const { t } = useTranslation(); + const isActive = status === 'running' || status === 'queued'; + + const allItems: MenuItem[] = isActive + ? [ + { id: 'pause', label: t('label.pause'), testId: 'pause-button' }, + { id: 'kill', label: t('label.kill-run'), testId: 'kill-button' }, + { + id: 'edit', + label: t('label.edit-configuration'), + testId: 'edit-button', + }, + { + danger: true, + id: 'delete', + label: t('label.delete-agent'), + testId: 'delete-button', + }, + ] + : [ + { id: 'run', label: t('label.run-now'), testId: 'run-button' }, + { + id: 'redeploy', + label: t('label.re-deploy-sentence'), + testId: 're-deploy-button', + }, + { + id: 'edit', + label: t('label.edit-configuration'), + testId: 'edit-button', + }, + { + danger: true, + id: 'delete', + label: t('label.delete-agent'), + testId: 'delete-button', + }, + ]; + + const PERMISSION_BY_ITEM: Record = { + run: permissions.trigger, + redeploy: permissions.edit, + edit: permissions.edit, + kill: permissions.edit, + pause: permissions.edit, + delete: permissions.delete, + }; + + const items = allItems.filter((item) => PERMISSION_BY_ITEM[item.id]); + + if (items.length === 0) { + return null; + } + + return ( + + + + + + onAction(String(key))}> + {items.map((item) => ( + + + {item.label} + + + ))} + + + + ); +}; + +export default AgentOverflowMenu; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentOverflowMenu.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentOverflowMenu.test.tsx new file mode 100644 index 000000000000..38d1f3edf703 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/AgentOverflowMenu.test.tsx @@ -0,0 +1,122 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { render, screen } from '@testing-library/react'; +import { ReactNode } from 'react'; +import { AgentActionPermissions, AgentStatus } from '../AgentsPage.interface'; +import AgentOverflowMenu from './AgentOverflowMenu.component'; + +jest.mock('@openmetadata/ui-core-components', () => ({ + Dropdown: { + Root: ({ children }: { children: ReactNode }) =>
{children}
, + Popover: ({ + children, + ...props + }: { + children: ReactNode; + 'data-testid'?: string; + }) =>
{children}
, + Menu: ({ children }: { children: ReactNode }) =>
{children}
, + Item: ({ + children, + ...props + }: { + children: ReactNode; + 'data-testid'?: string; + }) => , + }, +})); + +const mockOnAction = jest.fn(); + +const FULL_PERMISSIONS: AgentActionPermissions = { + trigger: true, + edit: true, + delete: true, +}; + +const renderMenu = ( + status: AgentStatus, + permissions?: AgentActionPermissions +) => + render( + + ); + +describe('AgentOverflowMenu', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should render run, redeploy, edit and delete for an inactive agent', () => { + renderMenu('success', FULL_PERMISSIONS); + + expect(screen.getByTestId('more-actions')).toBeInTheDocument(); + expect(screen.getByTestId('run-button')).toBeInTheDocument(); + expect(screen.getByTestId('re-deploy-button')).toBeInTheDocument(); + expect(screen.getByTestId('edit-button')).toBeInTheDocument(); + expect(screen.getByTestId('delete-button')).toBeInTheDocument(); + }); + + it('should render pause, kill, edit and delete for an active agent', () => { + renderMenu('running', FULL_PERMISSIONS); + + expect(screen.getByTestId('pause-button')).toBeInTheDocument(); + expect(screen.getByTestId('kill-button')).toBeInTheDocument(); + expect(screen.getByTestId('edit-button')).toBeInTheDocument(); + expect(screen.getByTestId('delete-button')).toBeInTheDocument(); + expect(screen.queryByTestId('run-button')).not.toBeInTheDocument(); + }); + + it('should only render run when the user has trigger permission alone', () => { + renderMenu('success', { trigger: true, edit: false, delete: false }); + + expect(screen.getByTestId('run-button')).toBeInTheDocument(); + expect(screen.queryByTestId('re-deploy-button')).not.toBeInTheDocument(); + expect(screen.queryByTestId('edit-button')).not.toBeInTheDocument(); + expect(screen.queryByTestId('delete-button')).not.toBeInTheDocument(); + }); + + it('should hide run but keep edit actions for edit-only permission', () => { + renderMenu('success', { trigger: false, edit: true, delete: false }); + + expect(screen.queryByTestId('run-button')).not.toBeInTheDocument(); + expect(screen.getByTestId('re-deploy-button')).toBeInTheDocument(); + expect(screen.getByTestId('edit-button')).toBeInTheDocument(); + expect(screen.queryByTestId('delete-button')).not.toBeInTheDocument(); + }); + + it('should gate pause and kill behind edit permission for an active agent', () => { + renderMenu('running', { trigger: true, edit: false, delete: false }); + + expect(screen.queryByTestId('pause-button')).not.toBeInTheDocument(); + expect(screen.queryByTestId('kill-button')).not.toBeInTheDocument(); + expect(screen.queryByTestId('edit-button')).not.toBeInTheDocument(); + }); + + it('should render nothing when the user has no permissions', () => { + renderMenu('success', { trigger: false, edit: false, delete: false }); + + expect(screen.queryByTestId('more-actions')).not.toBeInTheDocument(); + }); + + it('should render nothing while permissions are unresolved', () => { + renderMenu('success'); + + expect(screen.queryByTestId('more-actions')).not.toBeInTheDocument(); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/DeploymentSummaryCard.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/DeploymentSummaryCard.component.tsx new file mode 100644 index 000000000000..02a3f3530ed2 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/DeploymentSummaryCard.component.tsx @@ -0,0 +1,180 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Box, ProgressBarBase } from '@openmetadata/ui-core-components'; +import { Check } from '@untitledui/icons'; +import { FC } from 'react'; +import { useTranslation } from 'react-i18next'; +import { ReactComponent as RunRunningIcon } from '../../../assets/svg/agents/run-running.svg'; +import { Agent } from '../AgentsPage.interface'; +import { fmtNum, formatEtaShort, getEtaInfo } from '../utils/agents.utils'; + +interface DeploymentSummaryCardProps { + agents: Agent[]; +} + +interface SummaryStatProps { + label: string; + testId?: string; + tone?: 'error' | 'ok' | 'neutral'; + value: string; +} + +const STAT_VALUE_CLASS: Record = { + error: 'tw:text-error-primary', + ok: 'tw:text-success-primary', + neutral: 'tw:text-primary', +}; + +const SummaryStat: FC = ({ + label, + testId, + tone = 'neutral', + value, +}) => ( +
+
+ {value} +
+
{label}
+
+); + +const DeploymentSummaryCard: FC = ({ agents }) => { + const { t } = useTranslation(); + // Agents with status 'none' have never run — they are not part of any + // deployment and must not surface as queued/in-progress in the banner. + const activeAgents = agents.filter((a) => a.status !== 'none'); + const total = activeAgents.length; + const running = activeAgents.filter((a) => a.status === 'running').length; + const done = activeAgents.filter((a) => a.status === 'success').length; + const failed = activeAgents.filter((a) => a.status === 'failed').length; + const queued = total - done - running - failed; + const assets = activeAgents + .filter((a) => a.unit === 'assets') + .reduce((sum, a) => sum + a.assets, 0); + const errors = activeAgents.reduce((sum, a) => sum + a.errors, 0); + const etas = activeAgents + .filter((a) => a.status === 'running' && a.eta !== null) + .map((a) => a.eta as number); + const maxEta = etas.length ? Math.max(...etas) : null; + const overall = + total > 0 + ? Math.round(activeAgents.reduce((sum, a) => sum + a.pct, 0) / total) + : 0; + const allDone = running === 0 && done + failed === total; + + if (total === 0) { + return null; + } + + const etaDisplay = formatEtaShort(getEtaInfo(maxEta), t); + + const failedSuffix = + failed > 0 ? ` · ${failed} ${t('label.failed-lowercase')}` : ''; + const attentionSuffix = + failed > 0 + ? ` · ${failed} ${t('label.need-attention')}` + : ` · ${t('message.everything-healthy')}`; + + const subtitle = allDone + ? t('message.agents-finished-summary', { attentionSuffix, done, total }) + : t('message.agents-deploy-progress', { + done, + failedSuffix, + queued, + running, + }); + + return ( +
+ + + {allDone ? ( + + ) : ( + + )} + + +
+
+ {allDone + ? t('label.deployment-complete') + : t('message.agents-deploying-ingesting')} +
+
+ {subtitle} +
+
+ + + + 0 ? 'error' : 'ok'} + value={fmtNum(errors)} + /> + {!allDone && ( + + )} + +
+ + {!allDone && ( +
+ + + + {t('message.percent-complete-all-agents', { percent: overall })} + + {t('message.leave-page-ingestion-continues')} + +
+ )} +
+ ); +}; + +export default DeploymentSummaryCard; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/DeploymentSummaryCard.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/DeploymentSummaryCard.test.tsx new file mode 100644 index 000000000000..b40bdf3c7486 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/DeploymentSummaryCard.test.tsx @@ -0,0 +1,180 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { render, screen } from '@testing-library/react'; +import { PipelineType } from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { Agent } from '../AgentsPage.interface'; +import DeploymentSummaryCard from './DeploymentSummaryCard.component'; + +const buildAgent = (overrides: Partial): Agent => ({ + id: 'agent-1', + fqn: 'service.agent-1', + pipelineType: PipelineType.Metadata, + name: 'Metadata Agent', + type: 'Metadata', + unit: 'assets', + verb: 'ingested', + status: 'success', + pct: 100, + eta: null, + assets: 0, + target: 0, + errors: 0, + warnings: 0, + recentRuns: [], + ...overrides, +}); + +describe('DeploymentSummaryCard', () => { + it('should render nothing when there are no agents', () => { + const { container } = render(); + + expect(container).toBeEmptyDOMElement(); + }); + + it('should show the in-progress title and progress bar while agents run', () => { + render( + + ); + + expect(screen.getByTestId('deployment-summary-title')).toHaveTextContent( + 'message.agents-deploying-ingesting' + ); + expect(screen.getByTestId('deployment-progress-bar')).toBeInTheDocument(); + expect(screen.getByTestId('summary-eta-remaining')).toBeInTheDocument(); + }); + + it('should show the completion title and hide progress when all agents finished', () => { + render( + + ); + + expect(screen.getByTestId('deployment-summary-title')).toHaveTextContent( + 'label.deployment-complete' + ); + expect( + screen.queryByTestId('deployment-progress-bar') + ).not.toBeInTheDocument(); + expect( + screen.queryByTestId('summary-eta-remaining') + ).not.toBeInTheDocument(); + }); + + it('should aggregate asset counts across asset-unit agents only', () => { + render( + + ); + + expect(screen.getByTestId('summary-assets-ingested')).toHaveTextContent( + '150' + ); + }); + + it('should render nothing when all agents have never run', () => { + const { container } = render( + + ); + + expect(container).toBeEmptyDOMElement(); + }); + + it('should ignore never-run agents and show completion when the rest finished', () => { + render( + + ); + + expect(screen.getByTestId('deployment-summary-title')).toHaveTextContent( + 'label.deployment-complete' + ); + expect( + screen.queryByTestId('deployment-progress-bar') + ).not.toBeInTheDocument(); + }); + + it('should exclude never-run agents from the overall progress percent', () => { + render( + + ); + + expect(screen.getByTestId('deployment-summary-title')).toHaveTextContent( + 'message.agents-deploying-ingesting' + ); + expect(screen.getByTestId('deployment-progress-bar')).toHaveTextContent( + 'message.percent-complete-all-agents' + ); + }); + + it('should aggregate error counts across all agents', () => { + render( + + ); + + expect(screen.getByTestId('summary-errors')).toHaveTextContent('5'); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/MetadataAgentsView.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/MetadataAgentsView.component.tsx new file mode 100644 index 000000000000..e532a484083b --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/MetadataAgentsView.component.tsx @@ -0,0 +1,265 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Code01 } from '@untitledui/icons'; +import { AxiosError } from 'axios'; +import { FC, ReactNode, useCallback, useMemo, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { useNavigate } from 'react-router-dom'; +import { DISABLED } from '../../../constants/constants'; +import { useAirflowStatus } from '../../../context/AirflowStatusProvider/AirflowStatusProvider'; +import { ServiceCategory } from '../../../enums/service.enum'; +import { + IngestionPipeline, + PipelineType, +} from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { useApplicationStore } from '../../../hooks/useApplicationStore'; +import { ServicesType } from '../../../interface/service.interface'; +import { deleteIngestionPipelineById } from '../../../rest/ingestionPipelineAPI'; +import connectionsRouterClassBase from '../../../utils/ConnectionsRouterClassBase'; +import { getEntityName } from '../../../utils/EntityNameUtils'; +import { downloadFile } from '../../../utils/Export/ExportUtils'; +import { + getErrorPlaceHolder, + getLogViewerStatusFromAgentStatus, +} from '../../../utils/IngestionUtils'; +import { showErrorToast } from '../../../utils/ToastUtils'; +import DeleteModal from '../../common/DeleteModal/DeleteModal'; +import LogViewerModal from '../../common/LogViewerModal/LogViewerModal.component'; +import AddIngestionButton from '../../Settings/Services/Ingestion/AddIngestionButton.component'; +import '../agents-preview.css'; +import { Agent } from '../AgentsPage.interface'; +import { useAgentActions } from '../hooks/useAgentActions'; +import { useAgentLogs } from '../hooks/useAgentLogs'; +import { useAgentPermissions } from '../hooks/useAgentPermissions'; +import AgentGroup from './AgentGroup.component'; +import RunHistoryDrawer from './RunHistoryDrawer.component'; + +interface MetadataAgentsViewProps { + addAgentSlot?: ReactNode; + agents: Agent[]; + ingestionPipelineList: IngestionPipeline[]; + serviceCategory: ServiceCategory; + serviceDetails: ServicesType; + serviceName: string; + showAddAgent: boolean; + onRefresh: () => void; +} + +const MetadataAgentsView: FC = ({ + addAgentSlot: addAgentSlotProp, + agents, + ingestionPipelineList, + serviceCategory, + serviceDetails, + serviceName, + showAddAgent, + onRefresh, +}) => { + const { t } = useTranslation(); + const navigate = useNavigate(); + const { platform } = useAirflowStatus(); + const { theme } = useApplicationStore(); + const { runAgent, redeployAgent, killAgent, toggleAgent } = + useAgentActions(onRefresh); + const agentFqns = useMemo(() => agents.map((agent) => agent.fqn), [agents]); + const { agentPermissions } = useAgentPermissions(agentFqns); + const [runsFor, setRunsFor] = useState<{ + agent: Agent; + runId?: string; + } | null>(null); + const [logsFor, setLogsFor] = useState(null); + const [deleteTarget, setDeleteTarget] = useState(null); + const [isDeleting, setIsDeleting] = useState(false); + + const { rawText, isLoading: isLogsLoading } = useAgentLogs( + logsFor?.id ?? '', + logsFor?.pipelineType ?? PipelineType.Metadata, + Boolean(logsFor) + ); + + const onLogs = useCallback((agent: Agent) => setLogsFor(agent), []); + const onRun = useCallback( + (agent: Agent) => { + void runAgent(agent); + }, + [runAgent] + ); + const onRunDetails = useCallback( + (agent: Agent, runId?: string) => setRunsFor({ agent, runId }), + [] + ); + + const confirmDelete = useCallback(async () => { + if (!deleteTarget) { + return; + } + setIsDeleting(true); + try { + await deleteIngestionPipelineById(deleteTarget.id); + onRefresh(); + } catch (err) { + showErrorToast(err as AxiosError); + } finally { + setIsDeleting(false); + setDeleteTarget(null); + } + }, [deleteTarget, onRefresh]); + + const onAction = useCallback( + (action: string, agent: Agent) => { + switch (action) { + case 'run': + void runAgent(agent); + + break; + case 'redeploy': + void redeployAgent(agent); + + break; + case 'kill': + void killAgent(agent); + + break; + case 'pause': + void toggleAgent(agent); + + break; + case 'edit': + navigate( + connectionsRouterClassBase.getEditIngestionPath( + serviceCategory, + serviceName, + agent.fqn, + agent.pipelineType + ) + ); + + break; + case 'delete': + setDeleteTarget(agent); + + break; + default: + break; + } + }, + [ + runAgent, + redeployAgent, + killAgent, + toggleAgent, + navigate, + serviceCategory, + serviceName, + ] + ); + + const handleDownloadLogs = useCallback(() => { + if (!logsFor) { + return; + } + try { + downloadFile(rawText, `${logsFor.name.replace(/\s+/g, '_')}_logs.txt`); + } catch (err) { + showErrorToast(err as AxiosError); + } + }, [logsFor, rawText]); + + const emptyPlaceholder = useMemo( + () => getErrorPlaceHolder(agents.length, platform === DISABLED, theme), + [agents.length, platform, theme] + ); + + const addAgentSlot = useMemo(() => { + if (addAgentSlotProp) { + return addAgentSlotProp; + } + + return showAddAgent ? ( + + ) : undefined; + }, [ + addAgentSlotProp, + showAddAgent, + ingestionPipelineList, + serviceCategory, + serviceDetails, + serviceName, + ]); + + return ( +
+ } + titleKey="label.metadata-agent-plural" + onAction={onAction} + onLogs={onLogs} + onRun={onRun} + onRunDetails={onRunDetails} + /> + {runsFor && ( + setRunsFor(null)} + onOpenLogs={(agent) => { + setLogsFor(agent); + }} + onRun={onRun} + /> + )} + {logsFor && ( + setLogsFor(null)} + onDownload={handleDownloadLogs} + /> + )} + {deleteTarget && ( + setDeleteTarget(null)} + onDelete={() => void confirmDelete()} + /> + )} +
+ ); +}; + +export default MetadataAgentsView; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunGlyph.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunGlyph.component.tsx new file mode 100644 index 000000000000..fb88def03526 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunGlyph.component.tsx @@ -0,0 +1,73 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import classNames from 'classnames'; +import { CSSProperties, FC } from 'react'; +import { ReactComponent as RunFailedIcon } from '../../../assets/svg/agents/run-failed.svg'; +import { ReactComponent as RunPartialIcon } from '../../../assets/svg/agents/run-partial.svg'; +import { ReactComponent as RunRunningIcon } from '../../../assets/svg/agents/run-running.svg'; +import { ReactComponent as RunSkippedIcon } from '../../../assets/svg/agents/run-skipped.svg'; +import { ReactComponent as RunSuccessIcon } from '../../../assets/svg/agents/run-success.svg'; +import { RunStatus } from '../AgentsPage.interface'; + +interface RunGlyphProps { + status: RunStatus; + size?: number; +} + +interface GlyphMeta { + Icon: SvgComponent; + colorClass: string; +} + +const GLYPH_META: Record = { + success: { + Icon: RunSuccessIcon, + colorClass: 'tw:text-utility-success-500', + }, + partial: { + Icon: RunPartialIcon, + colorClass: 'tw:text-utility-warning-500', + }, + failed: { + Icon: RunFailedIcon, + colorClass: 'tw:text-utility-error-600', + }, + running: { + Icon: RunRunningIcon, + colorClass: 'tw:text-utility-brand-600', + }, + skipped: { + Icon: RunSkippedIcon, + colorClass: 'tw:text-utility-gray-300', + }, +}; + +const SPIN_STYLE: CSSProperties = { + animation: 'agspin 1.1s linear infinite', +}; + +const RunGlyph: FC = ({ status, size = 16 }) => { + const { Icon, colorClass } = GLYPH_META[status] ?? GLYPH_META.skipped; + + return ( + + ); +}; + +export default RunGlyph; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunHistoryDrawer.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunHistoryDrawer.component.tsx new file mode 100644 index 000000000000..a13f1560a215 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunHistoryDrawer.component.tsx @@ -0,0 +1,306 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + Badge, + Box, + Button, + Card, + SlideoutMenu, +} from '@openmetadata/ui-core-components'; +import { AlignLeft } from '@untitledui/icons'; +import { FC, useCallback, useEffect, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { ReactComponent as PlayIcon } from '../../../assets/svg/agents/play.svg'; +import { getUtcOffsetLabel } from '../../../utils/date-time/DateTimeUtils'; +import { Agent, AgentRun, RunStatus } from '../AgentsPage.interface'; +import { useAgentRuns } from '../hooks/useAgentRuns'; +import { AGENT_TYPE_ICON, fmtNum, RUN_META } from '../utils/agents.utils'; +import RunGlyph from './RunGlyph.component'; +import RunStepRow from './RunStepRow.component'; + +// ---- stat tile ---- +interface StatTileProps { + value: string; + label: string; + testId?: string; + tone?: 'error' | 'warn' | 'ok'; +} + +const STAT_TONE_CLASS: Record = { + error: 'tw:text-error-primary', + warn: 'tw:text-utility-warning-700', + ok: 'tw:text-utility-success-700', +}; + +const StatTile: FC = ({ value, label, testId, tone }) => ( + +
+ {value} +
+
+ {label} +
+
+); + +// ---- run history rail ---- +interface RunHistoryProps { + runs: AgentRun[]; + selectedId?: string; + onSelect: (id: string) => void; +} + +const RunHistory: FC = ({ runs, selectedId, onSelect }) => { + const { t } = useTranslation(); + + return ( + + {runs.map((r) => { + const m = RUN_META[r.status]; + const label = t(m.labelKey); + const isSelected = r.id === selectedId; + const [startDate, startTime] = r.startedAt.split(' · '); + + return ( + + ); + })} + + ); +}; + +// ---- drawer ---- +interface RunHistoryDrawerProps { + agent: Agent; + open: boolean; + initialRunId?: string; + onClose: () => void; + onOpenLogs: (agent: Agent) => void; + onRun: (agent: Agent) => void; +} + +const RunHistoryDrawer: FC = ({ + agent, + open, + initialRunId, + onClose, + onOpenLogs, + onRun, +}) => { + const { t } = useTranslation(); + const { runs, isLoading } = useAgentRuns(agent.fqn, true); + const [selId, setSelId] = useState(); + const Icon = AGENT_TYPE_ICON[agent.type] ?? (() => null); + + useEffect(() => { + if (runs.length > 0 && !runs.some((r) => r.id === selId)) { + const initialRun = initialRunId + ? runs.find((r) => r.id === initialRunId) + : undefined; + setSelId((initialRun ?? runs[0]).id); + } + }, [runs, initialRunId, selId]); + + const run = runs.find((r) => r.id === selId) ?? runs[0]; + const m = run ? RUN_META[run.status] : undefined; + const runLabel = m ? t(m.labelKey) : ''; + const tot = run?.totals; + + const handleOpenChange = useCallback( + (isOpen: boolean) => { + if (!isOpen) { + onClose(); + } + }, + [onClose] + ); + + return ( + + + + + + +
+
+ {agent.name} +
+
+ {t('label.run-history-and-details')} +
+
+ + +
+
+ + + {/* run history rail */} +
+ {t('label.recent-run-plural')} +
+ + + {run && m && tot ? ( + <> + {/* selected run header */} + + +
+
+ {runLabel} +
+
+ {run.startedAt} ({getUtcOffsetLabel()}) ·{' '} + {t('message.ran-for-duration', { duration: run.duration })} +
+
+ + {runLabel} + +
+ + {/* stat strip */} + + + + + + + + + {/* steps card */} + + + + {t('label.steps')} + + + {run.steps.length} {t('label.steps-lowercase')} + + + {run.steps.map((s, idx) => ( + + ))} + + + ) : ( +
+ {isLoading + ? `${t('label.loading')}...` + : t('message.no-recent-runs')} +
+ )} +
+
+ ); +}; + +export default RunHistoryDrawer; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunHistoryDrawer.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunHistoryDrawer.test.tsx new file mode 100644 index 000000000000..8718b0f58f17 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunHistoryDrawer.test.tsx @@ -0,0 +1,137 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { fireEvent, render, screen } from '@testing-library/react'; +import { PipelineType } from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { Agent, AgentRun } from '../AgentsPage.interface'; +import RunHistoryDrawer from './RunHistoryDrawer.component'; + +jest.mock('./RunStepRow.component', () => + jest.fn().mockImplementation(() =>

RunStepRow

) +); + +jest.mock('../../../utils/date-time/DateTimeUtils', () => ({ + getUtcOffsetLabel: jest.fn().mockReturnValue('UTC+05:30'), +})); + +const emptyTotals = { + records: 0, + filtered: 0, + updated: 0, + warnings: 0, + errors: 0, +}; + +const mockRuns: AgentRun[] = [ + { + id: 'run-latest', + status: 'success', + startedAt: 'May 27, 2026 · 08:10', + duration: 3.8, + totals: emptyTotals, + steps: [], + }, + { + id: 'run-middle', + status: 'failed', + startedAt: 'May 26, 2026 · 08:10', + duration: 0.7, + totals: emptyTotals, + steps: [], + }, + { + id: 'run-oldest', + status: 'partial', + startedAt: 'May 25, 2026 · 08:10', + duration: 4.1, + totals: emptyTotals, + steps: [], + }, +]; + +jest.mock('../hooks/useAgentRuns', () => ({ + useAgentRuns: jest.fn().mockImplementation(() => ({ + runs: mockRuns, + isLoading: false, + })), +})); + +const agent: Agent = { + id: 'agent-1', + fqn: 'service.agent-1', + pipelineType: PipelineType.Metadata, + name: 'Metadata Agent', + type: 'Metadata', + unit: 'assets', + verb: 'ingested', + status: 'success', + pct: 100, + eta: 0, + assets: 100, + target: 100, + errors: 0, + warnings: 0, + recentRuns: [], +}; + +const mockOnRun = jest.fn(); + +const renderDrawer = (initialRunId?: string) => + render( + + ); + +describe('RunHistoryDrawer', () => { + beforeEach(() => { + mockOnRun.mockClear(); + }); + + it('should pre-select the run matching initialRunId', () => { + renderDrawer('run-middle'); + + expect( + screen.getByText(/May 26, 2026 · 08:10 \(UTC\+05:30\)/) + ).toBeInTheDocument(); + }); + + it('should select the latest run when no initialRunId is given', () => { + renderDrawer(); + + expect( + screen.getByText(/May 27, 2026 · 08:10 \(UTC\+05:30\)/) + ).toBeInTheDocument(); + }); + + it('should fall back to the latest run for an unknown initialRunId', () => { + renderDrawer('run-evicted'); + + expect( + screen.getByText(/May 27, 2026 · 08:10 \(UTC\+05:30\)/) + ).toBeInTheDocument(); + }); + + it('should trigger onRun when the Run now button is clicked', () => { + renderDrawer(); + + fireEvent.click(screen.getByText('label.run-now')); + + expect(mockOnRun).toHaveBeenCalledWith(agent); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunStepRow.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunStepRow.component.tsx new file mode 100644 index 000000000000..1c323a91a46d --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/RunStepRow.component.tsx @@ -0,0 +1,211 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Badge, Box } from '@openmetadata/ui-core-components'; +import { + AlertTriangle, + ChevronRight, + Copy01, + Lightbulb03, +} from '@untitledui/icons'; +import { FC, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { RunAttention, RunStep } from '../AgentsPage.interface'; +import { fmtNum } from '../utils/agents.utils'; +import RunGlyph from './RunGlyph.component'; + +interface AttentionCardProps { + att: RunAttention; +} + +const AttentionCard: FC = ({ att }) => { + const { t } = useTranslation(); + const [copied, setCopied] = useState(false); + const [showLog, setShowLog] = useState(false); + const stackLines = att.stackTrace ? att.stackTrace.split('\n') : []; + const isError = att.severity === 'error'; + const surfaceClass = isError + ? 'tw:bg-error-primary tw:border-utility-error-200' + : 'tw:bg-warning-primary tw:border-utility-warning-200'; + const dividerClass = isError + ? 'tw:border-utility-error-200' + : 'tw:border-utility-warning-200'; + const accentClass = isError + ? 'tw:text-utility-error-700' + : 'tw:text-utility-warning-700'; + const accentIconClass = isError + ? 'tw:text-fg-error-primary' + : 'tw:text-fg-warning-primary'; + + const handleCopy = async () => { + if (!navigator.clipboard?.writeText) { + return; + } + try { + await navigator.clipboard.writeText(att.message); + setCopied(true); + setTimeout(() => setCopied(false), 1400); + } catch { + // clipboard write rejected (permission denied / non-secure context) + } + }; + + const toggleLog = () => setShowLog((s) => !s); + + return ( +
+ + + + {att.title} + + + {isError ? t('label.error') : t('label.warning')} + + + + +
+
+ {att.message} +
+ {att.hint && ( + + + + + {t('label.how-to-fix')} ·{' '} + + {att.hint} + + + )} + {stackLines.length > 0 && ( + <> + + {showLog && ( +
+ {stackLines.map((line, idx) => ( +
+ {line} +
+ ))} +
+ )} + + )} +
+
+ ); +}; + +interface RunStepRowProps { + step: RunStep; + isLast: boolean; +} + +const RunStepRow: FC = ({ step, isLast }) => { + const { t } = useTranslation(); + const secondary: string[] = []; + + if (step.filtered) { + secondary.push(`${fmtNum(step.filtered)} ${t('label.filtered-lowercase')}`); + } + + if (step.updated) { + secondary.push(`${fmtNum(step.updated)} ${t('label.updated-lowercase')}`); + } + + if (step.warnings) { + secondary.push(`${step.warnings} ${t('label.warning-plural-lowercase')}`); + } + + return ( +
+ + +
+
+ {step.name} +
+ {secondary.length > 0 && ( +
+ {secondary.join(' · ')} +
+ )} +
+ {step.status === 'skipped' ? ( + + {t('label.did-not-run')} + + ) : ( +
+
+ {fmtNum(step.records)} +
+
+ {t('label.records')} +
+
+ )} + {step.errors > 0 && ( + + {step.errors} {t('label.error-plural-lowercase')} + + )} +
+ {step.attention && } +
+ ); +}; + +export default RunStepRow; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/Metric.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/Metric.component.tsx new file mode 100644 index 000000000000..98d4116aac90 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/Metric.component.tsx @@ -0,0 +1,58 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Box } from '@openmetadata/ui-core-components'; +import { FC, ReactNode } from 'react'; + +interface MetricProps { + dataTestId?: string; + icon: ReactNode; + label?: string; + tone?: 'error' | 'warn'; + value: ReactNode; +} + +const VALUE_CLASS: Record = { + error: 'tw:text-utility-error-700', + warn: 'tw:text-utility-warning-700', +}; + +const ICON_CLASS: Record = { + error: 'tw:text-fg-error-secondary', + warn: 'tw:text-fg-warning-secondary', +}; + +const Metric: FC = ({ dataTestId, icon, label, tone, value }) => { + const valueClass = (tone && VALUE_CLASS[tone]) ?? 'tw:text-primary'; + const iconClass = (tone && ICON_CLASS[tone]) ?? 'tw:text-quaternary'; + + return ( + + + {icon} + + + {value} + + {label && ( + + {label} + + )} + + ); +}; + +export default Metric; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/ProgressBar.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/ProgressBar.component.tsx new file mode 100644 index 000000000000..23702d810427 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/ProgressBar.component.tsx @@ -0,0 +1,38 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProgressBarBase } from '@openmetadata/ui-core-components'; +import { FC } from 'react'; +import { AgentStatus } from '../../AgentsPage.interface'; + +interface ProgressBarProps { + pct: number; + status: AgentStatus; +} + +const FILL_CLASS: Record = { + failed: 'tw:bg-utility-error-500', + success: 'tw:bg-utility-success-500', +}; + +const ProgressBar: FC = ({ pct, status }) => ( + +); + +export default ProgressBar; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/StatusPill.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/StatusPill.component.tsx new file mode 100644 index 000000000000..0abf59e24cd8 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/components/shared/StatusPill.component.tsx @@ -0,0 +1,65 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Badge } from '@openmetadata/ui-core-components'; +import { FC } from 'react'; +import { useTranslation } from 'react-i18next'; +import { AgentStatus } from '../../AgentsPage.interface'; +import { STATUS_PILL_META } from '../../utils/agents.utils'; + +interface StatusPillProps { + dataTestId?: string; + status: AgentStatus; +} + +const STATUS_LABEL_KEY: Record = { + failed: 'label.failed', + queued: 'label.queued', + running: 'label.running', + success: 'label.success', + none: 'label.no-status', +}; + +const DOT_CLASS: Record = { + failed: 'tw:bg-utility-error-500', + queued: 'tw:bg-utility-gray-400', + running: 'tw:bg-utility-brand-500', + success: 'tw:bg-utility-success-500', + none: 'tw:bg-utility-gray-400', +}; + +const StatusPill: FC = ({ + dataTestId = 'pipeline-status', + status, +}) => { + const { t } = useTranslation(); + const meta = STATUS_PILL_META[status]; + + return ( + + + {t(STATUS_LABEL_KEY[status])} + + ); +}; + +export default StatusPill; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentActions.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentActions.ts new file mode 100644 index 000000000000..376bcf89fa8c --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentActions.ts @@ -0,0 +1,105 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AxiosError } from 'axios'; +import { useCallback } from 'react'; +import { useTranslation } from 'react-i18next'; +import { + deployIngestionPipelineById, + enableDisableIngestionPipelineById, + postKillIngestionPipelineById, + triggerIngestionPipelineById, +} from '../../../rest/ingestionPipelineAPI'; +import { showErrorToast, showSuccessToast } from '../../../utils/ToastUtils'; +import { Agent } from '../AgentsPage.interface'; + +type AgentAction = (agent: Agent) => Promise; + +interface UseAgentActionsResult { + runAgent: AgentAction; + redeployAgent: AgentAction; + killAgent: AgentAction; + toggleAgent: AgentAction; +} + +/** + * Wraps the ingestion-pipeline action APIs (trigger / deploy / kill / toggle) + * with success + error toasts. `onChanged` is invoked after a successful action + * so the caller can refresh the list. + */ +export const useAgentActions = ( + onChanged?: () => void +): UseAgentActionsResult => { + const { t } = useTranslation(); + + const runAction = useCallback( + async ( + apiCall: (id: string) => Promise, + agent: Agent, + actionLabel: string + ) => { + try { + await apiCall(agent.id); + showSuccessToast( + t('message.pipeline-action-success-message', { action: actionLabel }) + ); + onChanged?.(); + } catch (err) { + showErrorToast(err as AxiosError); + } + }, + [onChanged, t] + ); + + const runAgent = useCallback( + (agent: Agent) => + runAction( + triggerIngestionPipelineById, + agent, + t('label.triggered-lowercase') + ), + [runAction, t] + ); + + const redeployAgent = useCallback( + (agent: Agent) => + runAction( + deployIngestionPipelineById, + agent, + t('label.deployed-lowercase') + ), + [runAction, t] + ); + + const killAgent = useCallback( + (agent: Agent) => + runAction( + postKillIngestionPipelineById, + agent, + t('label.stopped-lowercase') + ), + [runAction, t] + ); + + const toggleAgent = useCallback( + (agent: Agent) => + runAction( + enableDisableIngestionPipelineById, + agent, + t('label.updated-lowercase') + ), + [runAction, t] + ); + + return { runAgent, redeployAgent, killAgent, toggleAgent }; +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentLogs.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentLogs.ts new file mode 100644 index 000000000000..c72b6d858cb2 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentLogs.ts @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AxiosError } from 'axios'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { PipelineType } from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { getIngestionPipelineLogById } from '../../../rest/ingestionPipelineAPI'; +import { showErrorToast } from '../../../utils/ToastUtils'; +import { LogLine } from '../AgentsPage.interface'; +import { + getLogTaskFieldForType, + parseLogLines, +} from '../utils/agentsDataMapper'; + +interface UseAgentLogsResult { + lines: LogLine[]; + rawText: string; + isLoading: boolean; + hasMore: boolean; + loadMore: () => void; +} + +/** + * Streams the raw logs for a pipeline run via `getIngestionPipelineLogById`, + * picking the task field for the pipeline type and paginating through the + * `after`/`total` cursor. Parses the accumulated text into LogLine[]. + */ +export const useAgentLogs = ( + id: string, + pipelineType: PipelineType, + enabled: boolean +): UseAgentLogsResult => { + const [rawText, setRawText] = useState(''); + const [after, setAfter] = useState(); + const [total, setTotal] = useState(); + const [isLoading, setIsLoading] = useState(false); + const requestIdRef = useRef(0); + + const fetchLogs = useCallback( + (cursor?: string) => { + const requestId = requestIdRef.current; + const isCurrent = () => requestId === requestIdRef.current; + setIsLoading(true); + getIngestionPipelineLogById(id, cursor) + .then((res) => { + if (!isCurrent()) { + return; + } + const chunk = getLogTaskFieldForType(res.data, pipelineType); + setRawText((prev) => (cursor ? prev + chunk : chunk)); + setAfter(res.data.after); + setTotal(res.data.total); + }) + .catch((err) => { + if (isCurrent()) { + showErrorToast(err as AxiosError); + } + }) + .finally(() => { + if (isCurrent()) { + setIsLoading(false); + } + }); + }, + [id, pipelineType] + ); + + useEffect(() => { + if (!enabled || !id) { + return; + } + requestIdRef.current += 1; + setRawText(''); + setAfter(undefined); + setTotal(undefined); + fetchLogs(); + + return () => { + requestIdRef.current += 1; + }; + }, [id, enabled, fetchLogs]); + + const lines = useMemo(() => parseLogLines(rawText), [rawText]); + const hasMore = + after !== undefined && total !== undefined && Number(after) < Number(total); + const loadMore = useCallback(() => { + if (hasMore) { + fetchLogs(after); + } + }, [hasMore, after, fetchLogs]); + + return { lines, rawText, isLoading, hasMore, loadMore }; +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentPermissions.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentPermissions.ts new file mode 100644 index 000000000000..0fb612230361 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentPermissions.ts @@ -0,0 +1,79 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { useEffect, useMemo, useState } from 'react'; +import { usePermissionProvider } from '../../../context/PermissionProvider/PermissionProvider'; +import { ResourceEntity } from '../../../context/PermissionProvider/PermissionProvider.interface'; +import { Operation } from '../../../generated/entity/policies/accessControl/resourceDescriptor'; +import { AgentActionPermissions } from '../AgentsPage.interface'; + +const FQN_KEY_SEPARATOR = '|'; + +export const useAgentPermissions = (agentFqns: string[]) => { + const { getEntityPermissionByFqn } = usePermissionProvider(); + const [agentPermissions, setAgentPermissions] = useState< + Record + >({}); + + // Agent lists are re-mapped on every SSE progress tick; keying on the joined + // FQNs keeps the effect from refetching permissions when only run state changed. + const fqnKey = agentFqns.filter(Boolean).join(FQN_KEY_SEPARATOR); + const fqns = useMemo( + () => (fqnKey ? fqnKey.split(FQN_KEY_SEPARATOR) : []), + [fqnKey] + ); + + useEffect(() => { + if (fqns.length === 0) { + setAgentPermissions({}); + + return; + } + + let isMounted = true; + + Promise.allSettled( + fqns.map((fqn) => + getEntityPermissionByFqn(ResourceEntity.INGESTION_PIPELINE, fqn) + ) + ).then((results) => { + if (!isMounted) { + return; + } + + setAgentPermissions( + results.reduce>( + (acc, result, index) => { + const permissions = + result.status === 'fulfilled' ? result.value : undefined; + + acc[fqns[index]] = { + trigger: permissions?.[Operation.Trigger] ?? false, + edit: permissions?.[Operation.EditAll] ?? false, + delete: permissions?.[Operation.Delete] ?? false, + }; + + return acc; + }, + {} + ) + ); + }); + + return () => { + isMounted = false; + }; + }, [fqns]); + + return { agentPermissions }; +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentRuns.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentRuns.ts new file mode 100644 index 000000000000..1d54301fda13 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useAgentRuns.ts @@ -0,0 +1,60 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AxiosError } from 'axios'; +import { useEffect, useState } from 'react'; +import { getRunHistoryForPipeline } from '../../../rest/ingestionPipelineAPI'; +import { showErrorToast } from '../../../utils/ToastUtils'; +import { AgentRun } from '../AgentsPage.interface'; +import { mapPipelineStatusToRun } from '../utils/agentsDataMapper'; + +const RUN_HISTORY_LIMIT = 10; + +/** + * Fetches the recent run history for a pipeline (by FQN) and maps it to the + * AgentRun view-model. Only fetches while `enabled` (e.g. the drawer is open). + */ +export const useAgentRuns = ( + fqn: string, + enabled: boolean +): { runs: AgentRun[]; isLoading: boolean } => { + const [runs, setRuns] = useState([]); + const [isLoading, setIsLoading] = useState(false); + + useEffect(() => { + if (!enabled || !fqn) { + return; + } + + let isActive = true; + setIsLoading(true); + getRunHistoryForPipeline(fqn, { limit: RUN_HISTORY_LIMIT }) + .then((res) => { + if (isActive) { + setRuns(res.data.map(mapPipelineStatusToRun)); + } + }) + .catch((err) => showErrorToast(err as AxiosError)) + .finally(() => { + if (isActive) { + setIsLoading(false); + } + }); + + return () => { + isActive = false; + }; + }, [fqn, enabled]); + + return { runs, isLoading }; +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useMetadataAgents.test.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useMetadataAgents.test.ts new file mode 100644 index 000000000000..a19ff12d7ce2 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useMetadataAgents.test.ts @@ -0,0 +1,249 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { act, renderHook } from '@testing-library/react-hooks'; +import { ServiceCategory } from '../../../enums/service.enum'; +import { + IngestionPipeline, + PipelineType, +} from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { + ProgressUpdateType, + ServiceProgressEvent, +} from '../../../generated/entity/services/ingestionPipelines/serviceProgressEvent'; +import { useMetadataAgents } from './useMetadataAgents'; + +let capturedOnEvent: (event: ServiceProgressEvent) => void; + +jest.mock('./useServiceProgressStream', () => ({ + useServiceProgressStream: jest.fn( + (options: { onEvent: (event: ServiceProgressEvent) => void }) => { + capturedOnEvent = options.onEvent; + + return { streamHealth: 'live' }; + } + ), +})); + +const mockGetIngestionPipelineByFqn = jest.fn(); + +jest.mock('../../../rest/ingestionPipelineAPI', () => ({ + getIngestionPipelineByFqn: jest.fn((...args) => + mockGetIngestionPipelineByFqn(...args) + ), +})); + +const buildPipeline = (name: string): IngestionPipeline => + ({ + id: `id-${name}`, + name, + fullyQualifiedName: `testSnowflake.${name}`, + pipelineType: PipelineType.Metadata, + } as IngestionPipeline); + +const buildEvent = ( + pipelineFqn: string, + overrides: Partial = {}, + eventOverrides: Partial = {} +): ServiceProgressEvent => ({ + pipelineFqn, + runId: 'run-1', + event: { + runId: 'run-1', + timestamp: 1751500000000, + updateType: ProgressUpdateType.Processing, + ...eventOverrides, + }, + ...overrides, +}); + +const renderAgentsHook = (pipelines: IngestionPipeline[]) => + renderHook( + ({ pipelines: currentPipelines }) => + useMetadataAgents( + currentPipelines, + ServiceCategory.DATABASE_SERVICES, + 'testSnowflake' + ), + { initialProps: { pipelines } } + ); + +describe('useMetadataAgents', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockGetIngestionPipelineByFqn.mockResolvedValue( + buildPipeline('metadata_agent') + ); + }); + + it('maps the pipelines prop to agents', () => { + const { result } = renderAgentsHook([buildPipeline('metadata_agent')]); + + expect(result.current.agents).toHaveLength(1); + expect(result.current.agents[0].fqn).toBe('testSnowflake.metadata_agent'); + }); + + it('applies progress events to known agents', () => { + const { result } = renderAgentsHook([buildPipeline('metadata_agent')]); + + act(() => { + capturedOnEvent( + buildEvent( + 'testSnowflake.metadata_agent', + {}, + { + totalAssetsIngested: 42, + } + ) + ); + }); + + expect(result.current.agents[0].status).toBe('running'); + expect(result.current.agents[0].assets).toBe(42); + }); + + it('drops events for unknown agents without an attached pipeline', () => { + const { result } = renderAgentsHook([buildPipeline('metadata_agent')]); + + act(() => { + capturedOnEvent(buildEvent('testSnowflake.autopilot_agent')); + }); + + expect(result.current.agents).toHaveLength(1); + }); + + it('adds an unknown agent from a DISCOVERY event carrying the pipeline', () => { + const { result } = renderAgentsHook([buildPipeline('metadata_agent')]); + + act(() => { + capturedOnEvent( + buildEvent( + 'testSnowflake.autopilot_agent', + { ingestionPipeline: buildPipeline('autopilot_agent') }, + { updateType: ProgressUpdateType.Discovery } + ) + ); + }); + + expect(result.current.agents).toHaveLength(2); + + const discovered = result.current.agents.find( + (agent) => agent.fqn === 'testSnowflake.autopilot_agent' + ); + + expect(discovered?.status).toBe('running'); + }); + + it('applies later progress frames to a discovered agent', () => { + const { result } = renderAgentsHook([buildPipeline('metadata_agent')]); + + act(() => { + capturedOnEvent( + buildEvent( + 'testSnowflake.autopilot_agent', + { ingestionPipeline: buildPipeline('autopilot_agent') }, + { updateType: ProgressUpdateType.Discovery } + ) + ); + capturedOnEvent( + buildEvent( + 'testSnowflake.autopilot_agent', + {}, + { + timestamp: 1751500001000, + totalAssetsIngested: 7, + } + ) + ); + }); + + const discovered = result.current.agents.find( + (agent) => agent.fqn === 'testSnowflake.autopilot_agent' + ); + + expect(discovered?.assets).toBe(7); + }); + + it('keeps a discovered agent when the pipelines prop lags behind', () => { + const initial = [buildPipeline('metadata_agent')]; + const { result, rerender } = renderAgentsHook(initial); + + act(() => { + capturedOnEvent( + buildEvent( + 'testSnowflake.autopilot_agent', + { ingestionPipeline: buildPipeline('autopilot_agent') }, + { updateType: ProgressUpdateType.Discovery } + ) + ); + }); + + rerender({ pipelines: [...initial] }); + + expect( + result.current.agents.some( + (agent) => agent.fqn === 'testSnowflake.autopilot_agent' + ) + ).toBe(true); + }); + + it('tracks stream-discovered agents in discoveredCount until the prop catches up', () => { + const initial = [buildPipeline('metadata_agent')]; + const { result, rerender } = renderAgentsHook(initial); + + expect(result.current.discoveredCount).toBe(0); + + act(() => { + capturedOnEvent( + buildEvent( + 'testSnowflake.autopilot_agent', + { ingestionPipeline: buildPipeline('autopilot_agent') }, + { updateType: ProgressUpdateType.Discovery } + ) + ); + }); + + expect(result.current.discoveredCount).toBe(1); + + rerender({ pipelines: [...initial] }); + + expect(result.current.discoveredCount).toBe(1); + + rerender({ pipelines: [...initial, buildPipeline('autopilot_agent')] }); + + expect(result.current.discoveredCount).toBe(0); + }); + + it('does not duplicate a discovered agent once the prop includes it', () => { + const initial = [buildPipeline('metadata_agent')]; + const { result, rerender } = renderAgentsHook(initial); + + act(() => { + capturedOnEvent( + buildEvent( + 'testSnowflake.autopilot_agent', + { ingestionPipeline: buildPipeline('autopilot_agent') }, + { updateType: ProgressUpdateType.Discovery } + ) + ); + }); + + rerender({ pipelines: [...initial, buildPipeline('autopilot_agent')] }); + + expect( + result.current.agents.filter( + (agent) => agent.fqn === 'testSnowflake.autopilot_agent' + ) + ).toHaveLength(1); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useMetadataAgents.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useMetadataAgents.ts new file mode 100644 index 000000000000..796b877843a7 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useMetadataAgents.ts @@ -0,0 +1,210 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { useCallback, useEffect, useRef, useState } from 'react'; +import { TabSpecificField } from '../../../enums/entity.enum'; +import { ServiceCategory } from '../../../enums/service.enum'; +import { IngestionPipeline } from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { ServiceProgressEvent } from '../../../generated/entity/services/ingestionPipelines/serviceProgressEvent'; +import { getIngestionPipelineByFqn } from '../../../rest/ingestionPipelineAPI'; +import { + applyProgressToAgent, + isTerminalProgressUpdate, + resetAgentProgress, +} from '../../../utils/AgentsProgressPureUtils'; +import { Agent } from '../AgentsPage.interface'; +import { mapPipelineToAgent } from '../utils/agentsDataMapper'; +import { useServiceProgressStream } from './useServiceProgressStream'; + +interface LastRunEvent { + runId: string; + timestamp: number; +} + +/** + * Derives the Agent view-model from the ingestion pipelines and keeps running + * agents live via one service-scoped SSE connection + * (`/services/ingestionPipelines/progress/service/{serviceType}/{serviceFqn}/stream`). + * The backend replays active-run snapshots on connect and pushes every + * subsequent ProgressUpdate, so no polling is needed. + * + * Progress events carry no error/warning counts, so once the LAST running + * agent reaches a terminal event, every agent that completed during the + * session is refetched once to reconcile errors/warnings/finishedAt from + * pipelineStatuses. + */ +export const useMetadataAgents = ( + pipelines: IngestionPipeline[], + serviceCategory: ServiceCategory, + serviceFqn?: string +): { agents: Agent[]; discoveredCount: number } => { + const [agents, setAgents] = useState(() => + pipelines.map(mapPipelineToAgent) + ); + const [discoveredCount, setDiscoveredCount] = useState(0); + const agentsRef = useRef(agents); + agentsRef.current = agents; + + const liveOverridesRef = useRef>(new Map()); + const discoveredPipelinesRef = useRef>( + new Map() + ); + const lastRunEventRef = useRef>(new Map()); + const completedThisSessionRef = useRef>(new Set()); + const isMountedRef = useRef(true); + + useEffect(() => { + isMountedRef.current = true; + + return () => { + isMountedRef.current = false; + }; + }, []); + + useEffect(() => { + // Stream-discovered pipelines live here only until a parent refetch + // returns them; after that the prop is the source of truth. + pipelines.forEach((pipeline) => { + discoveredPipelinesRef.current.delete( + pipeline.fullyQualifiedName ?? pipeline.name + ); + }); + setDiscoveredCount(discoveredPipelinesRef.current.size); + const merged = [ + ...pipelines, + ...Array.from(discoveredPipelinesRef.current.values()), + ]; + setAgents( + merged.map((pipeline) => { + const base = mapPipelineToAgent(pipeline); + const live = liveOverridesRef.current.get(base.fqn); + + return live?.status === 'running' + ? { + ...base, + status: live.status, + pct: live.pct, + assets: live.assets, + target: live.target, + eta: live.eta, + } + : base; + }) + ); + }, [pipelines]); + + const refetchAgent = useCallback(async (fqn: string) => { + try { + const fresh = await getIngestionPipelineByFqn(fqn, { + fields: TabSpecificField.PIPELINE_STATUSES, + }); + const mapped = mapPipelineToAgent(fresh); + if (isMountedRef.current) { + setAgents((prev) => + prev.map((a) => (a.fqn === mapped.fqn ? mapped : a)) + ); + } + } catch { + // A transient status fetch failure must not disrupt the list. + } + }, []); + + const syncCompletedAgents = useCallback(() => { + const completedFqns = Array.from(completedThisSessionRef.current); + completedThisSessionRef.current.clear(); + completedFqns.forEach((fqn) => { + void refetchAgent(fqn); + }); + }, [refetchAgent]); + + const isStaleEvent = useCallback((event: ServiceProgressEvent): boolean => { + const lastEvent = lastRunEventRef.current.get(event.pipelineFqn); + + return Boolean( + lastEvent?.runId === event.runId && + event.event.timestamp <= lastEvent.timestamp + ); + }, []); + + const handleProgressEvent = useCallback( + (event: ServiceProgressEvent) => { + const known = agentsRef.current.some( + (agent) => agent.fqn === event.pipelineFqn + ); + if (!known) { + // A DISCOVERY event carries the pipeline entity so a newly created + // agent (e.g. autopilot) becomes visible straight from the stream. + if (!event.ingestionPipeline) { + return; + } + discoveredPipelinesRef.current.set( + event.pipelineFqn, + event.ingestionPipeline + ); + agentsRef.current = [ + ...agentsRef.current, + mapPipelineToAgent(event.ingestionPipeline), + ]; + setDiscoveredCount(discoveredPipelinesRef.current.size); + } + if (isStaleEvent(event)) { + return; + } + + const lastEvent = lastRunEventRef.current.get(event.pipelineFqn); + const isNewRun = lastEvent?.runId !== event.runId; + lastRunEventRef.current.set(event.pipelineFqn, { + runId: event.runId, + timestamp: event.event.timestamp, + }); + + const isTerminal = isTerminalProgressUpdate(event.event.updateType); + const nextAgents = agentsRef.current.map((agent) => { + if (agent.fqn !== event.pipelineFqn) { + return agent; + } + const base = isNewRun ? resetAgentProgress(agent) : agent; + const next = applyProgressToAgent(base, event.event); + if (isTerminal) { + liveOverridesRef.current.delete(agent.fqn); + } else { + liveOverridesRef.current.set(agent.fqn, next); + } + + return next; + }); + + agentsRef.current = nextAgents; + setAgents(nextAgents); + + if (isTerminal) { + completedThisSessionRef.current.add(event.pipelineFqn); + const anyRunning = nextAgents.some( + (agent) => agent.status === 'running' + ); + if (!anyRunning) { + syncCompletedAgents(); + } + } + }, + [isStaleEvent, syncCompletedAgents] + ); + + useServiceProgressStream({ + serviceCategory, + serviceFqn, + onEvent: handleProgressEvent, + }); + + return { agents, discoveredCount }; +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useServiceProgressStream.test.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useServiceProgressStream.test.ts new file mode 100644 index 000000000000..55b319edc15d --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useServiceProgressStream.test.ts @@ -0,0 +1,248 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { fetchEventSource } from '@microsoft/fetch-event-source'; +import { act, renderHook } from '@testing-library/react-hooks'; +import { ServiceCategory } from '../../../enums/service.enum'; +import { useServiceProgressStream } from './useServiceProgressStream'; + +jest.mock('@microsoft/fetch-event-source', () => ({ + fetchEventSource: jest.fn(), +})); + +jest.mock('../../../utils/SwTokenStorageUtils', () => ({ + getOidcToken: jest.fn().mockResolvedValue('test-jwt-token'), +})); + +const mockRefreshToken = jest.fn().mockResolvedValue(undefined); + +jest.mock('../../../utils/Auth/TokenService/TokenServiceUtil', () => ({ + __esModule: true, + default: { + getInstance: () => ({ refreshToken: mockRefreshToken }), + }, +})); + +jest.mock('../../../utils/HistoryUtils', () => ({ + getBasePath: jest.fn().mockReturnValue(''), +})); + +const mockFetchEventSource = fetchEventSource as jest.MockedFunction< + typeof fetchEventSource +>; + +type StreamOptions = Parameters[1]; + +const flushAsync = async () => { + await act(async () => { + await Promise.resolve(); + await Promise.resolve(); + await Promise.resolve(); + }); +}; + +const neverResolve = () => new Promise(() => undefined); + +describe('useServiceProgressStream', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('connects with the service stream URL and bearer token', async () => { + mockFetchEventSource.mockImplementation(() => neverResolve()); + + renderHook(() => + useServiceProgressStream({ + serviceCategory: ServiceCategory.DATABASE_SERVICES, + serviceFqn: 'testSnowflake', + onEvent: jest.fn(), + }) + ); + + await flushAsync(); + + expect(mockFetchEventSource).toHaveBeenCalledTimes(1); + + const [url, options] = mockFetchEventSource.mock.calls[0]; + + expect(url).toBe( + '/api/v1/services/ingestionPipelines/progress/service/databaseService/testSnowflake/stream' + ); + expect(options?.headers).toEqual({ + Authorization: 'Bearer test-jwt-token', + }); + }); + + it('does not connect without a service fqn', async () => { + renderHook(() => + useServiceProgressStream({ + serviceCategory: ServiceCategory.DATABASE_SERVICES, + serviceFqn: undefined, + onEvent: jest.fn(), + }) + ); + + await flushAsync(); + + expect(mockFetchEventSource).not.toHaveBeenCalled(); + }); + + it('reports live health and dispatches parsed events', async () => { + const onEvent = jest.fn(); + let capturedOptions: StreamOptions; + mockFetchEventSource.mockImplementation(async (_url, options) => { + capturedOptions = options; + await options?.onopen?.({ + ok: true, + status: 200, + } as Response); + + return neverResolve(); + }); + + const { result } = renderHook(() => + useServiceProgressStream({ + serviceCategory: ServiceCategory.DATABASE_SERVICES, + serviceFqn: 'testSnowflake', + onEvent, + }) + ); + + await flushAsync(); + + expect(result.current.streamHealth).toBe('live'); + + const payload = { + pipelineFqn: 'testSnowflake.metadata_agent', + runId: 'run-1', + event: { runId: 'run-1', timestamp: 1, updateType: 'PROCESSING' }, + }; + act(() => { + capturedOptions?.onmessage?.({ + data: JSON.stringify(payload), + event: '', + id: '', + retry: undefined, + }); + }); + + expect(onEvent).toHaveBeenCalledWith(payload); + }); + + it('ignores malformed frames without killing the stream', async () => { + const onEvent = jest.fn(); + let capturedOptions: StreamOptions; + mockFetchEventSource.mockImplementation(async (_url, options) => { + capturedOptions = options; + await options?.onopen?.({ ok: true, status: 200 } as Response); + + return neverResolve(); + }); + + renderHook(() => + useServiceProgressStream({ + serviceCategory: ServiceCategory.DATABASE_SERVICES, + serviceFqn: 'testSnowflake', + onEvent, + }) + ); + + await flushAsync(); + + expect(() => + capturedOptions?.onmessage?.({ + data: 'not-json', + event: '', + id: '', + retry: undefined, + }) + ).not.toThrow(); + expect(onEvent).not.toHaveBeenCalled(); + }); + + it('stops permanently with unavailable health on 503', async () => { + mockFetchEventSource.mockImplementation(async (_url, options) => { + await options?.onopen?.({ ok: false, status: 503 } as Response); + }); + + const { result } = renderHook(() => + useServiceProgressStream({ + serviceCategory: ServiceCategory.DATABASE_SERVICES, + serviceFqn: 'testSnowflake', + onEvent: jest.fn(), + }) + ); + + await flushAsync(); + + expect(result.current.streamHealth).toBe('unavailable'); + expect(mockFetchEventSource).toHaveBeenCalledTimes(1); + }); + + it('refreshes the token once on 401 and reconnects', async () => { + jest.useFakeTimers(); + try { + mockFetchEventSource + .mockImplementationOnce(async (_url, options) => { + await options?.onopen?.({ ok: false, status: 401 } as Response); + }) + .mockImplementation(() => neverResolve()); + + renderHook(() => + useServiceProgressStream({ + serviceCategory: ServiceCategory.DATABASE_SERVICES, + serviceFqn: 'testSnowflake', + onEvent: jest.fn(), + }) + ); + + await flushAsync(); + + expect(mockRefreshToken).toHaveBeenCalledTimes(1); + + await act(async () => { + jest.advanceTimersByTime(1000); + }); + await flushAsync(); + + expect(mockFetchEventSource).toHaveBeenCalledTimes(2); + } finally { + jest.useRealTimers(); + } + }); + + it('aborts the connection on unmount', async () => { + let capturedSignal: AbortSignal | undefined; + mockFetchEventSource.mockImplementation((_url, options) => { + capturedSignal = options?.signal ?? undefined; + + return neverResolve(); + }); + + const { unmount } = renderHook(() => + useServiceProgressStream({ + serviceCategory: ServiceCategory.DATABASE_SERVICES, + serviceFqn: 'testSnowflake', + onEvent: jest.fn(), + }) + ); + + await flushAsync(); + + expect(capturedSignal?.aborted).toBe(false); + + unmount(); + + expect(capturedSignal?.aborted).toBe(true); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useServiceProgressStream.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useServiceProgressStream.ts new file mode 100644 index 000000000000..ca457f453d16 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/hooks/useServiceProgressStream.ts @@ -0,0 +1,189 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { fetchEventSource } from '@microsoft/fetch-event-source'; +import { useEffect, useRef, useState } from 'react'; +import { ServiceCategory } from '../../../enums/service.enum'; +import { ServiceProgressEvent } from '../../../generated/entity/services/ingestionPipelines/serviceProgressEvent'; +import TokenService from '../../../utils/Auth/TokenService/TokenServiceUtil'; +import { getBasePath } from '../../../utils/HistoryUtils'; +import { getEntityTypeFromServiceCategory } from '../../../utils/ServicePureUtils'; +import { getEncodedFqn } from '../../../utils/StringUtils'; +import { getOidcToken } from '../../../utils/SwTokenStorageUtils'; + +export type StreamHealth = 'connecting' | 'live' | 'unavailable' | 'down'; + +interface UseServiceProgressStreamProps { + serviceCategory: ServiceCategory; + serviceFqn?: string; + onEvent: (event: ServiceProgressEvent) => void; +} + +const MAX_ATTEMPTS_BEFORE_DOWN = 5; +const MAX_BACKOFF_MS = 30000; +const BASE_BACKOFF_MS = 1000; + +class FatalStreamError extends Error { + constructor(public readonly health: StreamHealth) { + super(`Stream terminated: ${health}`); + } +} + +class RetriableStreamError extends Error {} + +const getBackoffDelay = (attempt: number): number => + Math.min(BASE_BACKOFF_MS * 2 ** (attempt - 1), MAX_BACKOFF_MS); + +const abortableSleep = (ms: number, signal: AbortSignal): Promise => + new Promise((resolve) => { + const timeoutId = setTimeout(resolve, ms); + signal.addEventListener( + 'abort', + () => { + clearTimeout(timeoutId); + resolve(); + }, + { once: true } + ); + }); + +export const getServiceProgressStreamUrl = ( + serviceCategory: ServiceCategory, + serviceFqn: string +): string => { + const serviceType = getEntityTypeFromServiceCategory(serviceCategory); + + return `${getBasePath()}/api/v1/services/ingestionPipelines/progress/service/${serviceType}/${getEncodedFqn( + serviceFqn + )}/stream`; +}; + +/** + * Holds one SSE connection per service page to the backend progress stream. + * The backend replays a snapshot of every active run on connect, then pushes + * live ServiceProgressEvent frames; heartbeat comments keep the connection + * warm. Native EventSource cannot send the Authorization header the JWT + * filter requires, hence the fetch-based client. + * + * Reconnects with exponential backoff on transient failures; a 503 means + * progress tracking is not configured on the backend and stops the stream + * for the session. A 401 triggers one token refresh before retrying. + */ +export const useServiceProgressStream = ({ + serviceCategory, + serviceFqn, + onEvent, +}: UseServiceProgressStreamProps): { streamHealth: StreamHealth } => { + const [streamHealth, setStreamHealth] = useState('connecting'); + const onEventRef = useRef(onEvent); + onEventRef.current = onEvent; + + useEffect(() => { + if (!serviceFqn) { + return; + } + + const controller = new AbortController(); + const { signal } = controller; + const url = getServiceProgressStreamUrl(serviceCategory, serviceFqn); + + const updateHealth = (health: StreamHealth) => { + if (!signal.aborted) { + setStreamHealth(health); + } + }; + + let attempt = 0; + let consecutiveUnauthorized = 0; + + const handleOpen = async (response: Response): Promise => { + if (response.ok) { + attempt = 0; + consecutiveUnauthorized = 0; + updateHealth('live'); + + return; + } + if (response.status === 503) { + throw new FatalStreamError('unavailable'); + } + if (response.status === 401) { + consecutiveUnauthorized += 1; + if (consecutiveUnauthorized > 1) { + throw new FatalStreamError('down'); + } + await TokenService.getInstance().refreshToken(); + } + + throw new RetriableStreamError(); + }; + + const handleMessage = (data: string) => { + if (!data) { + return; + } + try { + onEventRef.current(JSON.parse(data) as ServiceProgressEvent); + } catch { + // A malformed frame must not kill the stream. + } + }; + + const connectOnce = async () => { + const token = await getOidcToken(); + await fetchEventSource(url, { + signal, + headers: { + Authorization: `Bearer ${token}`, + }, + onopen: handleOpen, + onmessage: (message) => handleMessage(message.data), + onerror: (error) => { + // Rethrow so the outer loop owns retry timing and token refresh. + throw error; + }, + }); + }; + + const streamForever = async () => { + while (!signal.aborted) { + try { + await connectOnce(); + + // Resolved: server closed the stream cleanly; reconnect. + throw new RetriableStreamError(); + } catch (error) { + if (signal.aborted) { + return; + } + if (error instanceof FatalStreamError) { + updateHealth(error.health); + + return; + } + attempt += 1; + updateHealth( + attempt >= MAX_ATTEMPTS_BEFORE_DOWN ? 'down' : 'connecting' + ); + await abortableSleep(getBackoffDelay(attempt), signal); + } + } + }; + + void streamForever(); + + return () => controller.abort(); + }, [serviceCategory, serviceFqn]); + + return { streamHealth }; +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agents.utils.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agents.utils.ts new file mode 100644 index 000000000000..17329e4c1595 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agents.utils.ts @@ -0,0 +1,214 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + BookClosed, + Code01, + Database01, + Grid01, + LayersThree01, + Shield01, + Zap, +} from '@untitledui/icons'; +import { TFunction } from 'i18next'; +import { ReactComponent as LineageIcon } from '../../../assets/svg/agents/lineage.svg'; +import { ReactComponent as SparkleIcon } from '../../../assets/svg/agents/sparkle.svg'; +import { + AgentActionPermissions, + AgentStatus, + RunStatus, +} from '../AgentsPage.interface'; + +// Safe default while permissions are unresolved — actions stay hidden until an +// explicit permission set is provided. +export const NO_AGENT_PERMISSIONS: AgentActionPermissions = { + trigger: false, + edit: false, + delete: false, +}; + +export const ALL_AGENT_PERMISSIONS: AgentActionPermissions = { + trigger: true, + edit: true, + delete: true, +}; + +export const fmtNum = (n: number): string => n.toLocaleString(); + +export type EtaState = 'idle' | 'wrapping' | 'seconds' | 'minutes'; + +export interface EtaInfo { + state: EtaState; + value?: number; +} + +export const getEtaInfo = (s: number | null): EtaInfo => { + let result: EtaInfo = { state: 'idle' }; + if (s !== null) { + if (s <= 0) { + result = { state: 'wrapping' }; + } else if (s < 60) { + result = { state: 'seconds', value: s }; + } else { + result = { state: 'minutes', value: Math.round(s / 60) }; + } + } + + return result; +}; + +export const UNIT_LABEL_KEY: Record = { + queries: 'label.query-plural-lowercase', + assets: 'label.asset-plural-lowercase', + models: 'label.model-plural-lowercase', +}; + +export const UNIT_VERB_LABEL_KEY: Record = { + scanned: 'label.queries-scanned', + processed: 'label.queries-processed', + ingested: 'label.assets-ingested', + profiled: 'label.assets-profiled', + parsed: 'label.models-parsed', +}; + +export const getUnitLabelKey = (unit: string): string => + UNIT_LABEL_KEY[unit] ?? 'label.asset-plural-lowercase'; + +export const getUnitVerbLabelKey = (verb: string): string => + UNIT_VERB_LABEL_KEY[verb] ?? 'label.assets-ingested'; + +const EM_DASH = '—'; + +export const formatEtaLong = (info: EtaInfo, t: TFunction): string => { + const byState: Record = { + idle: EM_DASH, + wrapping: t('label.wrapping-up'), + seconds: t('message.seconds-left', { count: info.value }), + minutes: t('message.minutes-left', { count: info.value }), + }; + + return byState[info.state]; +}; + +export const formatEtaShort = (info: EtaInfo, t: TFunction): string => { + const byState: Record = { + idle: EM_DASH, + wrapping: t('label.wrapping-up'), + seconds: t('message.seconds-short', { count: info.value }), + minutes: t('message.minutes-short', { count: info.value }), + }; + + return byState[info.state]; +}; + +export const AGENT_TYPE_ICON: Record = { + Metadata: Database01, + Usage: Zap, + Profiler: Grid01, + Lineage: LineageIcon, + 'Auto Classification': SparkleIcon, + dbt: Code01, + Tier: LayersThree01, + Documentation: BookClosed, + 'Data Quality': Shield01, +}; + +export const AGENT_TYPE_LABEL_KEY: Record = { + Metadata: 'label.metadata', + Usage: 'label.usage', + Profiler: 'label.profiler', + Lineage: 'label.lineage', + 'Auto Classification': 'label.auto-classification', + dbt: 'label.dbt-lowercase', + Tier: 'label.tier', + Documentation: 'label.documentation', + 'Data Quality': 'label.data-quality', +}; + +export const getAgentTypeLabelKey = (type: string): string => + AGENT_TYPE_LABEL_KEY[type] ?? 'label.metadata'; + +export type AgentBadgeColor = + | 'brand' + | 'error' + | 'gray' + | 'success' + | 'warning'; + +export interface PillMeta { + color: AgentBadgeColor; + pulse?: boolean; +} + +export const STATUS_PILL_META: Record = { + running: { color: 'brand', pulse: true }, + success: { color: 'success' }, + failed: { color: 'error' }, + queued: { color: 'gray' }, + none: { color: 'gray' }, +}; + +export interface RunMeta { + labelKey: string; + color: AgentBadgeColor; + barClassName: string; + textClassName: string; +} + +export const RUN_META: Record = { + success: { + labelKey: 'label.success', + color: 'success', + barClassName: 'tw:bg-utility-success-500', + textClassName: 'tw:text-utility-success-700', + }, + partial: { + labelKey: 'label.partial-success', + color: 'warning', + barClassName: 'tw:bg-utility-warning-500', + textClassName: 'tw:text-utility-warning-700', + }, + failed: { + labelKey: 'label.failed', + color: 'error', + barClassName: 'tw:bg-utility-error-500', + textClassName: 'tw:text-utility-error-700', + }, + running: { + labelKey: 'label.running', + color: 'brand', + barClassName: 'tw:bg-utility-brand-500', + textClassName: 'tw:text-utility-brand-700', + }, + skipped: { + labelKey: 'label.did-not-run', + color: 'gray', + barClassName: 'tw:bg-utility-gray-300', + textClassName: 'tw:text-quaternary', + }, +}; + +export const RUN_DOT_CLASS: Record = { + failed: 'tw:bg-utility-error-500', + partial: 'tw:bg-utility-warning-500', + success: 'tw:bg-utility-success-500', + skipped: 'tw:bg-utility-gray-300', +}; + +export const AGENT_ICON_CLASS: Record = { + running: 'tw:text-fg-brand-primary', + failed: 'tw:text-fg-error-primary', + success: 'tw:text-fg-success-primary', + queued: 'tw:text-fg-quaternary', + none: 'tw:text-fg-quaternary', +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agentsDataMapper.test.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agentsDataMapper.test.ts new file mode 100644 index 000000000000..d779a80c0d2c --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agentsDataMapper.test.ts @@ -0,0 +1,621 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AgentStatus } from '../../../enums/ServiceInsights.enum'; +import { + IngestionPipeline, + PipelineState, + PipelineStatus, + PipelineType, + StepSummary, +} from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { IngestionPipelineLogByIdInterface } from '../../../pages/LogsViewerPage/LogsViewerPage.interfaces'; +import { + getAgentTypeFromPipelineType, + getAgentUnitVerb, + getLogTaskFieldForType, + mapPipelineStatusToRun, + mapPipelineToAgent, + mapStepSummaryToRunStep, + parseLogLines, + toRunStatus, + toUiAgentStatus, +} from './agentsDataMapper'; + +describe('agentsDataMapper', () => { + describe('getAgentTypeFromPipelineType', () => { + it('should map Metadata pipeline type to Metadata agent type', () => { + expect(getAgentTypeFromPipelineType(PipelineType.Metadata)).toBe( + 'Metadata' + ); + }); + + it('should map Usage pipeline type to Usage agent type', () => { + expect(getAgentTypeFromPipelineType(PipelineType.Usage)).toBe('Usage'); + }); + + it('should map Lineage pipeline type to Lineage agent type', () => { + expect(getAgentTypeFromPipelineType(PipelineType.Lineage)).toBe( + 'Lineage' + ); + }); + + it('should map Profiler pipeline type to Profiler agent type', () => { + expect(getAgentTypeFromPipelineType(PipelineType.Profiler)).toBe( + 'Profiler' + ); + }); + + it('should map AutoClassification pipeline type to Auto Classification agent type', () => { + expect( + getAgentTypeFromPipelineType(PipelineType.AutoClassification) + ).toBe('Auto Classification'); + }); + + it('should map Dbt pipeline type to dbt agent type', () => { + expect(getAgentTypeFromPipelineType(PipelineType.Dbt)).toBe('dbt'); + }); + + it('should fall back to Metadata for an unknown pipeline type', () => { + expect(getAgentTypeFromPipelineType('unknownType' as PipelineType)).toBe( + 'Metadata' + ); + }); + }); + + describe('getAgentUnitVerb', () => { + it('should return queries/scanned for Usage', () => { + expect(getAgentUnitVerb(PipelineType.Usage)).toEqual({ + unit: 'queries', + verb: 'scanned', + }); + }); + + it('should return queries/processed for Lineage', () => { + expect(getAgentUnitVerb(PipelineType.Lineage)).toEqual({ + unit: 'queries', + verb: 'processed', + }); + }); + + it('should return assets/ingested for Metadata', () => { + expect(getAgentUnitVerb(PipelineType.Metadata)).toEqual({ + unit: 'assets', + verb: 'ingested', + }); + }); + + it('should return assets/profiled for Profiler', () => { + expect(getAgentUnitVerb(PipelineType.Profiler)).toEqual({ + unit: 'assets', + verb: 'profiled', + }); + }); + + it('should return models/parsed for dbt', () => { + expect(getAgentUnitVerb(PipelineType.Dbt)).toEqual({ + unit: 'models', + verb: 'parsed', + }); + }); + + it('should default to assets/ingested for an unmapped type', () => { + expect(getAgentUnitVerb(PipelineType.TestSuite)).toEqual({ + unit: 'assets', + verb: 'ingested', + }); + }); + }); + + describe('toUiAgentStatus', () => { + it('should map Running to running', () => { + expect(toUiAgentStatus(AgentStatus.Running)).toBe('running'); + }); + + it('should map Successful to success', () => { + expect(toUiAgentStatus(AgentStatus.Successful)).toBe('success'); + }); + + it('should map Failed to failed', () => { + expect(toUiAgentStatus(AgentStatus.Failed)).toBe('failed'); + }); + + it('should map Pending to queued', () => { + expect(toUiAgentStatus(AgentStatus.Pending)).toBe('queued'); + }); + }); + + describe('toRunStatus', () => { + it('should map success to success', () => { + expect(toRunStatus(PipelineState.Success)).toBe('success'); + }); + + it('should map partialSuccess to partial', () => { + expect(toRunStatus(PipelineState.PartialSuccess)).toBe('partial'); + }); + + it('should map failed to failed', () => { + expect(toRunStatus(PipelineState.Failed)).toBe('failed'); + }); + + it('should map running to running', () => { + expect(toRunStatus(PipelineState.Running)).toBe('running'); + }); + + it('should map queued to skipped', () => { + expect(toRunStatus(PipelineState.Queued)).toBe('skipped'); + }); + + it('should map stopped to skipped', () => { + expect(toRunStatus(PipelineState.Stopped)).toBe('skipped'); + }); + + it('should map undefined to skipped', () => { + expect(toRunStatus(undefined)).toBe('skipped'); + }); + }); + + describe('mapPipelineToAgent', () => { + const basePipeline: IngestionPipeline = { + id: 'pipeline-1', + name: 'metadata_pipeline', + displayName: 'Metadata Pipeline', + pipelineType: PipelineType.Metadata, + airflowConfig: {}, + sourceConfig: {}, + }; + + it('should aggregate progress for a running pipeline', () => { + const pipeline: IngestionPipeline = { + ...basePipeline, + pipelineStatuses: [ + { + pipelineState: PipelineState.Running, + runId: 'run-1', + status: [ + { + name: 'Source', + progress: { + tables: { + processed: 40, + total: 100, + estimatedRemainingSeconds: 30, + }, + schemas: { + processed: 5, + total: 10, + estimatedRemainingSeconds: 10, + }, + }, + }, + ], + }, + ], + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.status).toBe('running'); + expect(agent.assets).toBe(45); + expect(agent.target).toBe(110); + expect(agent.pct).toBe(Math.round((45 / 110) * 100)); + expect(agent.eta).toBe(30); + }); + + it('should mark a successful pipeline with pct 100 and a finishedAt string', () => { + const now = Date.now(); + const pipeline: IngestionPipeline = { + ...basePipeline, + pipelineStatuses: [ + { + pipelineState: PipelineState.Success, + runId: 'run-2', + startDate: now - 60000, + endDate: now, + status: [ + { + name: 'Source', + records: 120, + errors: 0, + warnings: 0, + }, + ], + }, + ], + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.status).toBe('success'); + expect(agent.pct).toBe(100); + expect(agent.assets).toBe(120); + expect(agent.finishedAt).toBeTruthy(); + }); + + it('should return none status with zeros when there are no runs', () => { + const agent = mapPipelineToAgent(basePipeline); + + expect(agent.status).toBe('none'); + expect(agent.pct).toBe(0); + expect(agent.assets).toBe(0); + expect(agent.target).toBe(0); + expect(agent.eta).toBeNull(); + expect(agent.errors).toBe(0); + expect(agent.warnings).toBe(0); + expect(agent.recentRuns).toEqual([]); + }); + + it('should return none status but keep last-run data when the state is missing', () => { + const now = Date.now(); + const pipeline: IngestionPipeline = { + ...basePipeline, + pipelineStatuses: [ + { + runId: 'run-3', + startDate: now - 60000, + endDate: now, + status: [ + { + name: 'Source', + records: 75, + errors: 0, + warnings: 0, + }, + ], + }, + ], + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.status).toBe('none'); + expect(agent.assets).toBe(75); + expect(agent.finishedAt).toBeTruthy(); + }); + + it('should build recentRuns latest-first from pipeline statuses', () => { + const pipeline: IngestionPipeline = { + ...basePipeline, + pipelineStatuses: [ + { pipelineState: PipelineState.Failed, runId: 'run-a' }, + { pipelineState: PipelineState.Success, runId: 'run-b' }, + { pipelineState: PipelineState.PartialSuccess, runId: 'run-c' }, + ], + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.recentRuns).toEqual([ + { id: 'run-a', status: 'failed' }, + { id: 'run-b', status: 'success' }, + { id: 'run-c', status: 'partial' }, + ]); + }); + + it('should exclude in-flight queued and running statuses from recentRuns', () => { + const pipeline: IngestionPipeline = { + ...basePipeline, + pipelineStatuses: [ + { pipelineState: PipelineState.Queued, runId: 'run-q' }, + { pipelineState: PipelineState.Running, runId: 'run-x' }, + { pipelineState: PipelineState.Success, runId: 'run-y' }, + ], + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.status).toBe('queued'); + expect(agent.recentRuns).toEqual([{ id: 'run-y', status: 'success' }]); + }); + + it('should keep stopped runs in recentRuns as skipped', () => { + const pipeline: IngestionPipeline = { + ...basePipeline, + pipelineStatuses: [ + { pipelineState: PipelineState.Stopped, runId: 'run-s' }, + { pipelineState: PipelineState.Success, runId: 'run-t' }, + ], + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.recentRuns).toEqual([ + { id: 'run-s', status: 'skipped' }, + { id: 'run-t', status: 'success' }, + ]); + }); + + it('should fall back to the timestamp for recentRuns ids when runId is missing', () => { + const pipeline: IngestionPipeline = { + ...basePipeline, + pipelineStatuses: [ + { + pipelineState: PipelineState.Success, + timestamp: 1_700_000_000_000, + }, + ], + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.recentRuns).toEqual([ + { id: '1700000000000', status: 'success' }, + ]); + }); + + it('should cap recentRuns at five entries', () => { + const pipeline: IngestionPipeline = { + ...basePipeline, + pipelineStatuses: Array.from({ length: 7 }, (_, index) => ({ + pipelineState: PipelineState.Success, + runId: `run-${index}`, + })), + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.recentRuns).toHaveLength(5); + expect(agent.recentRuns[0].id).toBe('run-0'); + expect(agent.recentRuns[4].id).toBe('run-4'); + }); + + it('should sum errors and warnings across steps and set failStep on failure', () => { + const pipeline: IngestionPipeline = { + ...basePipeline, + pipelineStatuses: [ + { + pipelineState: PipelineState.Failed, + runId: 'run-3', + status: [ + { name: 'Source', records: 10, errors: 0, warnings: 2 }, + { name: 'Sink', records: 0, errors: 3, warnings: 1 }, + ], + }, + ], + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.status).toBe('failed'); + expect(agent.errors).toBe(3); + expect(agent.warnings).toBe(3); + expect(agent.failStep).toBe('Sink'); + }); + + it('should fall back to id/name when displayName is missing', () => { + const pipeline: IngestionPipeline = { + ...basePipeline, + displayName: undefined, + }; + + const agent = mapPipelineToAgent(pipeline); + + expect(agent.name).toBe('metadata_pipeline'); + expect(agent.type).toBe('Metadata'); + expect(agent.unit).toBe('assets'); + expect(agent.verb).toBe('ingested'); + }); + }); + + describe('mapPipelineStatusToRun', () => { + it('should sum totals across steps and map nested steps', () => { + const status: PipelineStatus = { + runId: 'run-1', + pipelineState: PipelineState.PartialSuccess, + startDate: 1_700_000_000_000, + endDate: 1_700_000_090_000, + status: [ + { + name: 'Source', + records: 10, + filtered: 1, + updated_records: 2, + warnings: 1, + errors: 0, + }, + { + name: 'Sink', + records: 5, + filtered: 0, + updated_records: 1, + warnings: 0, + errors: 1, + failures: [ + { + name: 'table.customers', + error: 'Connection timeout', + }, + ], + }, + ], + }; + + const run = mapPipelineStatusToRun(status); + + expect(run.id).toBe('run-1'); + expect(run.status).toBe('partial'); + expect(run.totals).toEqual({ + records: 15, + filtered: 1, + updated: 3, + warnings: 1, + errors: 1, + }); + expect(run.duration).toBe(1.5); + expect(run.steps).toHaveLength(2); + expect(run.steps[1].attention).toEqual({ + severity: 'error', + title: 'table.customers', + message: 'Connection timeout', + hint: undefined, + }); + }); + + it('should fall back to timestamp-derived id when runId is missing', () => { + const status: PipelineStatus = { + timestamp: 1_700_000_000_000, + pipelineState: PipelineState.Running, + }; + + const run = mapPipelineStatusToRun(status); + + expect(run.id).toBe('1700000000000'); + expect(run.duration).toBe(0); + expect(run.steps).toEqual([]); + }); + }); + + describe('mapStepSummaryToRunStep', () => { + it('should mark a step with errors and no records as failed', () => { + const step: StepSummary = { name: 'Sink', records: 0, errors: 2 }; + + expect(mapStepSummaryToRunStep(step).status).toBe('failed'); + }); + + it('should mark a step with errors and records as partial', () => { + const step: StepSummary = { name: 'Sink', records: 5, errors: 2 }; + + expect(mapStepSummaryToRunStep(step).status).toBe('partial'); + }); + + it('should mark a step with warnings only as partial', () => { + const step: StepSummary = { name: 'Source', records: 10, warnings: 1 }; + + expect(mapStepSummaryToRunStep(step).status).toBe('partial'); + }); + + it('should mark a zero step as skipped', () => { + const step: StepSummary = { name: 'Source', records: 0 }; + const runStep = mapStepSummaryToRunStep(step); + + expect(runStep.status).toBe('skipped'); + expect(runStep.records).toBe(0); + expect(runStep.filtered).toBe(0); + expect(runStep.updated).toBe(0); + expect(runStep.warnings).toBe(0); + expect(runStep.errors).toBe(0); + }); + + it('should mark a clean step with records as success', () => { + const step: StepSummary = { name: 'Source', records: 10 }; + + expect(mapStepSummaryToRunStep(step).status).toBe('success'); + }); + + it('should build an attention block from the first failure', () => { + const step: StepSummary = { + name: 'Sink', + records: 0, + errors: 1, + failures: [ + { name: 'table.orders', error: 'Timeout while writing' }, + { name: 'table.other', error: 'Should be ignored' }, + ], + }; + + expect(mapStepSummaryToRunStep(step).attention).toEqual({ + severity: 'error', + title: 'table.orders', + message: 'Timeout while writing', + hint: undefined, + }); + }); + + it('should leave attention undefined when there are no failures', () => { + const step: StepSummary = { name: 'Source', records: 10 }; + + expect(mapStepSummaryToRunStep(step).attention).toBeUndefined(); + }); + }); + + describe('parseLogLines', () => { + it('should parse levels, timestamps and text, and drop blank lines', () => { + const raw = [ + '2024-01-01 10:00:00,123 INFO Starting ingestion', + '', + '2024-01-01 10:00:01,456 WARN Slow query detected', + ' ', + '2024-01-01 10:00:02,789 ERROR Connection refused', + ].join('\n'); + + const lines = parseLogLines(raw); + + expect(lines).toHaveLength(3); + expect(lines[0]).toEqual({ + time: '2024-01-01 10:00:00,123', + level: 'info', + text: 'Starting ingestion', + }); + expect(lines[1]).toEqual({ + time: '2024-01-01 10:00:01,456', + level: 'warn', + text: 'Slow query detected', + }); + expect(lines[2]).toEqual({ + time: '2024-01-01 10:00:02,789', + level: 'error', + text: 'Connection refused', + }); + }); + + it('should default to info level when no level token is present', () => { + const lines = parseLogLines('just a plain line with no metadata'); + + expect(lines).toHaveLength(1); + expect(lines[0].level).toBe('info'); + expect(lines[0].time).toBe(''); + expect(lines[0].text).toBe('just a plain line with no metadata'); + }); + + it('should return an empty array for an empty string', () => { + expect(parseLogLines('')).toEqual([]); + }); + }); + + describe('getLogTaskFieldForType', () => { + it('should pick the ingestion_task field for Metadata', () => { + const log: IngestionPipelineLogByIdInterface = { + ingestion_task: 'metadata logs', + profiler_task: 'profiler logs', + }; + + expect(getLogTaskFieldForType(log, PipelineType.Metadata)).toBe( + 'metadata logs' + ); + }); + + it('should pick the usage_task field for Usage', () => { + const log: IngestionPipelineLogByIdInterface = { + usage_task: 'usage logs', + }; + + expect(getLogTaskFieldForType(log, PipelineType.Usage)).toBe( + 'usage logs' + ); + }); + + it('should pick the dbt_task field for Dbt', () => { + const log: IngestionPipelineLogByIdInterface = { + dbt_task: 'dbt logs', + }; + + expect(getLogTaskFieldForType(log, PipelineType.Dbt)).toBe('dbt logs'); + }); + + it('should return an empty string when the field is missing', () => { + const log: IngestionPipelineLogByIdInterface = {}; + + expect(getLogTaskFieldForType(log, PipelineType.Lineage)).toBe(''); + }); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agentsDataMapper.ts b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agentsDataMapper.ts new file mode 100644 index 000000000000..b5c78e15df57 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ServiceAgents/utils/agentsDataMapper.ts @@ -0,0 +1,413 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AgentStatus } from '../../../enums/ServiceInsights.enum'; +import { + IngestionPipeline, + PipelineState, + PipelineStatus, + PipelineType, + StepSummary, +} from '../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { IngestionPipelineLogByIdInterface } from '../../../pages/LogsViewerPage/LogsViewerPage.interfaces'; +import { getAgentStatusLabelFromStatus } from '../../../utils/AgentsStatusWidgetPureUtils'; +import { + customFormatDateTime, + getShortRelativeTime, +} from '../../../utils/date-time/DateTimeUtils'; +import { + Agent, + AgentRecentRun, + AgentRun, + AgentStatus as UiAgentStatus, + LogLevel, + LogLine, + RunAttention, + RunStatus, + RunStep, + RunTotals, +} from '../AgentsPage.interface'; + +const RUN_STARTED_AT_FORMAT = 'MMM dd, yyyy · HH:mm'; + +// Stable machine keys (icon lookup via AGENT_TYPE_ICON); display strings are +// localized separately through getAgentTypeLabelKey in agents.utils.ts. +const PIPELINE_TYPE_TO_AGENT_TYPE: Record = { + [PipelineType.Metadata]: 'Metadata', + [PipelineType.Usage]: 'Usage', + [PipelineType.Lineage]: 'Lineage', + [PipelineType.Profiler]: 'Profiler', + [PipelineType.AutoClassification]: 'Auto Classification', + [PipelineType.Dbt]: 'dbt', + [PipelineType.Application]: 'Metadata', + [PipelineType.DataInsight]: 'Metadata', + [PipelineType.ElasticSearchReindex]: 'Metadata', + [PipelineType.PolicyAgent]: 'Metadata', + [PipelineType.TestSuite]: 'Data Quality', +}; + +const PIPELINE_TYPE_TO_UNIT_VERB: Record< + string, + { unit: string; verb: string } +> = { + [PipelineType.Usage]: { unit: 'queries', verb: 'scanned' }, + [PipelineType.Lineage]: { unit: 'queries', verb: 'processed' }, + [PipelineType.Metadata]: { unit: 'assets', verb: 'ingested' }, + [PipelineType.Profiler]: { unit: 'assets', verb: 'profiled' }, + [PipelineType.Dbt]: { unit: 'models', verb: 'parsed' }, +}; + +const DEFAULT_UNIT_VERB = { unit: 'assets', verb: 'ingested' }; + +const AGENT_STATUS_TO_UI_STATUS: Record = { + [AgentStatus.Running]: 'running', + [AgentStatus.Successful]: 'success', + [AgentStatus.Failed]: 'failed', + [AgentStatus.Pending]: 'queued', +}; + +const COMPLETED_PIPELINE_STATES = new Set([ + PipelineState.Success, + PipelineState.PartialSuccess, + PipelineState.Failed, + PipelineState.Stopped, +]); + +const RECENT_RUNS_LIMIT = 5; + +const PIPELINE_STATE_TO_RUN_STATUS: Record = { + [PipelineState.Success]: 'success', + [PipelineState.PartialSuccess]: 'partial', + [PipelineState.Failed]: 'failed', + [PipelineState.Running]: 'running', + [PipelineState.Queued]: 'skipped', + [PipelineState.Stopped]: 'skipped', +}; + +const LOG_LEVEL_PATTERN = /\b(INFO|WARNING|WARN|ERROR|DEBUG)\b/i; +const LOG_TIMESTAMP_PATTERN = + /^\[?(\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:[.,]\d+)?)\]?/; + +const LOG_LEVEL_TOKEN_TO_LEVEL: Record = { + INFO: 'info', + WARN: 'warn', + WARNING: 'warn', + ERROR: 'error', + DEBUG: 'debug', +}; + +const PIPELINE_TYPE_TO_LOG_TASK_FIELD: Record< + PipelineType, + keyof IngestionPipelineLogByIdInterface +> = { + [PipelineType.Metadata]: 'ingestion_task', + [PipelineType.Application]: 'application_task', + [PipelineType.Profiler]: 'profiler_task', + [PipelineType.Usage]: 'usage_task', + [PipelineType.Lineage]: 'lineage_task', + [PipelineType.Dbt]: 'dbt_task', + [PipelineType.TestSuite]: 'test_suite_task', + [PipelineType.DataInsight]: 'data_insight_task', + [PipelineType.ElasticSearchReindex]: 'elasticsearch_reindex_task', + [PipelineType.AutoClassification]: 'auto_classification_task', + [PipelineType.PolicyAgent]: 'ingestion_task', +}; + +export const getAgentTypeFromPipelineType = ( + pipelineType: PipelineType +): string => PIPELINE_TYPE_TO_AGENT_TYPE[pipelineType] ?? 'Metadata'; + +export const getAgentUnitVerb = ( + pipelineType: PipelineType +): { unit: string; verb: string } => + PIPELINE_TYPE_TO_UNIT_VERB[pipelineType] ?? DEFAULT_UNIT_VERB; + +export const toUiAgentStatus = (status: AgentStatus): UiAgentStatus => + AGENT_STATUS_TO_UI_STATUS[status] ?? 'queued'; + +export const toRunStatus = (state?: PipelineState): RunStatus => + state ? PIPELINE_STATE_TO_RUN_STATUS[state] ?? 'skipped' : 'skipped'; + +interface ProgressAggregate { + assets: number; + target: number; + eta: number | null; +} + +const aggregateProgress = (steps: StepSummary[]): ProgressAggregate => { + let assets = 0; + let target = 0; + let eta: number | null = null; + + for (const step of steps) { + const progressByEntity = Object.values(step.progress ?? {}); + for (const progress of progressByEntity) { + assets += progress.processed ?? 0; + target += progress.total ?? 0; + if (progress.estimatedRemainingSeconds !== undefined) { + eta = Math.max(eta ?? 0, progress.estimatedRemainingSeconds); + } + } + } + + return { assets, target: target > 0 ? target : Math.max(assets, 1), eta }; +}; + +interface StepTotalsAggregate { + assets: number; + errors: number; + warnings: number; +} + +const aggregateStepTotals = (steps: StepSummary[]): StepTotalsAggregate => { + let assets = 0; + let errors = 0; + let warnings = 0; + + for (const step of steps) { + assets += step.records ?? 0; + errors += step.errors ?? 0; + warnings += step.warnings ?? 0; + } + + return { assets, errors, warnings }; +}; + +const findFirstFailedStepName = (steps: StepSummary[]): string | undefined => { + const failedStep = steps.find((step) => (step.errors ?? 0) > 0); + + return failedStep?.name; +}; + +const buildRunningAgentFields = ( + steps: StepSummary[] +): Pick => { + const { assets, target, eta } = aggregateProgress(steps); + const pct = target > 0 ? Math.round((assets / target) * 100) : 0; + + return { pct, assets, target, eta }; +}; + +const buildFinishedAgentFields = ( + steps: StepSummary[], + endDate?: number +): Pick => { + const { assets } = aggregateStepTotals(steps); + + return { + pct: 100, + assets, + target: Math.max(assets, 1), + eta: 0, + finishedAt: endDate ? getShortRelativeTime(endDate) : undefined, + }; +}; + +const emptyAgentProgressFields = (): Pick< + Agent, + 'pct' | 'assets' | 'target' | 'eta' +> => ({ + pct: 0, + assets: 0, + target: 0, + eta: null, +}); + +const buildRecentRuns = (statuses: PipelineStatus[]): AgentRecentRun[] => + statuses + .filter( + (status) => + status.pipelineState && + COMPLETED_PIPELINE_STATES.has(status.pipelineState) + ) + .slice(0, RECENT_RUNS_LIMIT) + .map((status) => ({ + id: status.runId ?? String(status.timestamp), + status: toRunStatus(status.pipelineState), + })); + +export const mapPipelineToAgent = (pipeline: IngestionPipeline): Agent => { + const agentType = getAgentTypeFromPipelineType(pipeline.pipelineType); + const { unit, verb } = getAgentUnitVerb(pipeline.pipelineType); + const latestStatus = pipeline.pipelineStatuses?.[0]; + const agentStatus = getAgentStatusLabelFromStatus( + latestStatus?.pipelineState + ); + const uiStatus: UiAgentStatus = latestStatus?.pipelineState + ? toUiAgentStatus(agentStatus) + : 'none'; + const steps = latestStatus?.status ?? []; + + let progressFields: Pick< + Agent, + 'pct' | 'assets' | 'target' | 'eta' | 'finishedAt' + >; + let failStep: string | undefined; + let errors = 0; + let warnings = 0; + + if (!latestStatus) { + progressFields = emptyAgentProgressFields(); + } else if (uiStatus === 'running') { + progressFields = buildRunningAgentFields(steps); + } else { + progressFields = buildFinishedAgentFields(steps, latestStatus.endDate); + } + + if (latestStatus) { + const totals = aggregateStepTotals(steps); + errors = totals.errors; + warnings = totals.warnings; + if (uiStatus === 'failed') { + failStep = findFirstFailedStepName(steps); + } + } + + return { + id: pipeline.id ?? pipeline.fullyQualifiedName ?? pipeline.name, + fqn: pipeline.fullyQualifiedName ?? pipeline.name, + pipelineType: pipeline.pipelineType, + name: pipeline.displayName ?? pipeline.name, + type: agentType, + unit, + verb, + status: uiStatus, + errors, + warnings, + failStep, + recentRuns: buildRecentRuns(pipeline.pipelineStatuses ?? []), + ...progressFields, + }; +}; + +const sumStepField = (steps: StepSummary[], field: keyof StepSummary): number => + steps.reduce((sum, step) => sum + ((step[field] as number) ?? 0), 0); + +const buildRunTotals = (steps: StepSummary[]): RunTotals => ({ + records: sumStepField(steps, 'records'), + filtered: sumStepField(steps, 'filtered'), + updated: sumStepField(steps, 'updated_records'), + warnings: sumStepField(steps, 'warnings'), + errors: sumStepField(steps, 'errors'), +}); + +const resolveRunStepStatus = ( + records: number, + filtered: number, + errors: number, + warnings: number +): RunStatus => { + let result: RunStatus; + if (errors > 0) { + result = records > 0 ? 'partial' : 'failed'; + } else if (warnings > 0) { + result = 'partial'; + } else if (records === 0 && filtered === 0) { + result = 'skipped'; + } else { + result = 'success'; + } + + return result; +}; + +const buildStepAttention = (step: StepSummary): RunAttention | undefined => { + const firstFailure = step.failures?.[0]; + let result: RunAttention | undefined; + + if (firstFailure) { + result = { + severity: 'error', + title: firstFailure.name, + message: firstFailure.error, + hint: undefined, + ...(firstFailure.stackTrace + ? { stackTrace: firstFailure.stackTrace } + : {}), + }; + } + + return result; +}; + +export const mapStepSummaryToRunStep = (step: StepSummary): RunStep => { + const records = step.records ?? 0; + const filtered = step.filtered ?? 0; + const updated = step.updated_records ?? 0; + const warnings = step.warnings ?? 0; + const errors = step.errors ?? 0; + + return { + name: step.name, + status: resolveRunStepStatus(records, filtered, errors, warnings), + records, + filtered, + updated, + warnings, + errors, + attention: buildStepAttention(step), + }; +}; + +export const mapPipelineStatusToRun = (status: PipelineStatus): AgentRun => { + const steps = status.status ?? []; + const startedAtMillis = status.startDate ?? status.timestamp; + const duration = + status.endDate && status.startDate + ? Math.round(((status.endDate - status.startDate) / 60000) * 10) / 10 + : 0; + + return { + id: status.runId ?? String(status.timestamp), + status: toRunStatus(status.pipelineState), + startedAt: startedAtMillis + ? customFormatDateTime(startedAtMillis, RUN_STARTED_AT_FORMAT) + : '', + duration, + totals: buildRunTotals(steps), + steps: steps.map(mapStepSummaryToRunStep), + }; +}; + +const LOG_LEADING_LEVEL_PATTERN = /^\[?(INFO|WARNING|WARN|ERROR|DEBUG)\]?\s*/i; + +const parseLogLine = (line: string): LogLine => { + const timestampMatch = line.match(LOG_TIMESTAMP_PATTERN); + const time = timestampMatch ? timestampMatch[1] : ''; + const levelMatch = line.match(LOG_LEVEL_PATTERN); + const level: LogLevel = levelMatch + ? LOG_LEVEL_TOKEN_TO_LEVEL[levelMatch[1].toUpperCase()] ?? 'info' + : 'info'; + const afterTimestamp = timestampMatch + ? line.slice(timestampMatch[0].length).trim() + : line.trim(); + const remainder = afterTimestamp.replace(LOG_LEADING_LEVEL_PATTERN, ''); + + return { time, level, text: remainder || line }; +}; + +export const parseLogLines = (raw: string): LogLine[] => + raw + .split('\n') + .filter((line) => line.trim().length > 0) + .map(parseLogLine); + +export const getLogTaskFieldForType = ( + log: IngestionPipelineLogByIdInterface, + pipelineType: PipelineType +): string => { + const fieldKey = + PIPELINE_TYPE_TO_LOG_TASK_FIELD[pipelineType] ?? 'ingestion_task'; + + return log[fieldKey] ?? ''; +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/AddIngestionButton.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/AddIngestionButton.component.tsx index d51152bb4add..9fb9256ba09d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/AddIngestionButton.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/AddIngestionButton.component.tsx @@ -11,7 +11,9 @@ * limitations under the License. */ -import { Button, Dropdown } from 'antd'; +import { Button } from '@openmetadata/ui-core-components'; +import { Plus } from '@untitledui/icons'; +import { Dropdown } from 'antd'; import { isEmpty } from 'lodash'; import { useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -86,10 +88,12 @@ function AddIngestionButton({ placement="bottomRight" trigger={['click']}> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/Ingestion.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/Ingestion.component.tsx index a95024dc2287..bd2b0639e70b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/Ingestion.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/Ingestion.component.tsx @@ -11,55 +11,35 @@ * limitations under the License. */ -import { ReloadOutlined } from '@ant-design/icons'; -import { - Button, - Col, - Radio, - RadioChangeEvent, - Row, - Tooltip, - Typography, -} from 'antd'; +import { Tabs } from '@openmetadata/ui-core-components'; import { isUndefined } from 'lodash'; -import { useCallback, useMemo, useState } from 'react'; +import { ComponentType, Key, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { ReactComponent as MetadataAgentIcon } from '../../../../assets/svg/ic-collapse.svg'; import { ReactComponent as CollateAI } from '../../../../assets/svg/ic-suggestions.svg'; +import { DISABLED } from '../../../../constants/constants'; +import { usePermissionProvider } from '../../../../context/PermissionProvider/PermissionProvider'; import { ServiceAgentSubTabs, ServiceCategory, } from '../../../../enums/service.enum'; import { useFqn } from '../../../../hooks/useFqn'; -import { getCountBadge } from '../../../../utils/EntityDisplayPureUtils'; -import { getTypeAndStatusMenuItems } from '../../../../utils/IngestionConfigUtils'; import { getServiceDetailsPath } from '../../../../utils/RouterUtils'; import { getDefaultAgentsTabWidgets } from '../../../../utils/ServiceInsightsWidgets'; import serviceUtilClassBase from '../../../../utils/ServiceUtilClassBase'; import { useRequiredParams } from '../../../../utils/useRequiredParams'; import ErrorPlaceHolderIngestion from '../../../common/ErrorWithPlaceholder/ErrorPlaceHolderIngestion'; -import Searchbar from '../../../common/SearchBarComponent/SearchBar.component'; -import SearchDropdown from '../../../SearchDropdown/SearchDropdown'; +import DeploymentSummaryCard from '../../../ServiceAgents/components/DeploymentSummaryCard.component'; +import MetadataAgentsView from '../../../ServiceAgents/components/MetadataAgentsView.component'; import { IngestionProps } from './ingestion.interface'; import './ingestion.less'; const Ingestion: React.FC = ({ + agents, serviceDetails, ingestionPipelineList, - ingestionPagingInfo, - onIngestionWorkflowsUpdate, - pipelineType, - isLoading, - handleIngestionListUpdate, - searchText, - handleSearchChange, - onPageChange, airflowInformation, - handleTypeFilterChange, - handleStatusFilterChange, - statusFilter, - typeFilter, isCollateAgentLoading, collateAgentsList, collateAgentPagingInfo, @@ -76,27 +56,28 @@ const Ingestion: React.FC = ({ tab: string; subTab: string; }>(); + const { permissions } = usePermissionProvider(); - const { typeMenuItems, statusMenuItems } = useMemo( - () => getTypeAndStatusMenuItems(), - [] - ); const isDBService = useMemo( () => serviceCategory === ServiceCategory.DATABASE_SERVICES, [serviceCategory] ); - const [statusFilters, setStatusFilters] = - useState>(statusMenuItems); - const [typeFilters, setTypeFilters] = - useState>(typeMenuItems); - const { CollateAIAgentsWidget, MetadataAgentsWidget } = useMemo( + const { CollateAIAgentsWidget } = useMemo( () => ({ ...getDefaultAgentsTabWidgets(), ...serviceUtilClassBase.getAgentsTabWidgets(), }), [serviceCategory] ); + + // The community widget registry types every entry as the metadata widget; + // the Collate edition overrides it with the real Collate AI widget. Treat it + // as a props-bag component so the Collate sub-tab can render either. + const CollateAgentsWidget = CollateAIAgentsWidget as unknown as ComponentType< + Record + >; + const isCollateAIWidgetSupported = useMemo( () => !isUndefined(CollateAIAgentsWidget) && isDBService, [CollateAIAgentsWidget, isDBService] @@ -104,55 +85,41 @@ const Ingestion: React.FC = ({ const isCollateSubTabSelected = subTab === ServiceAgentSubTabs.COLLATE_AI; - const { isAirflowAvailable } = useMemo( + const { isAirflowAvailable, platform } = useMemo( () => airflowInformation, [airflowInformation] ); - const handleStatusFilterSearch = useCallback( - (searchValue: string) => { - setStatusFilters( - statusMenuItems.filter((item) => - item.label.toLowerCase().includes(searchValue.toLowerCase()) - ) - ); - }, - [statusMenuItems] - ); - - const handleTypeFilterSearch = useCallback( - (searchValue: string) => { - setTypeFilters( - typeMenuItems.filter((item) => - item.label.toLowerCase().includes(searchValue.toLowerCase()) - ) - ); - }, - [typeMenuItems] + const showAddAgent = useMemo( + () => + Boolean(permissions['ingestionPipeline']?.Create) && + platform !== DISABLED, + [permissions, platform] ); const handleSubTabChange = useCallback( - (e: RadioChangeEvent) => { - const key = e.target.value; - + (key: Key) => { navigate( { pathname: getServiceDetailsPath( decodedServiceFQN, serviceCategory, tab, - key + String(key) ), }, - { - replace: true, - } + { replace: true } ); }, - [history, decodedServiceFQN, serviceCategory, tab] + [decodedServiceFQN, serviceCategory, tab, navigate] + ); + + const handleRefresh = useCallback( + () => refreshAgentsList(subTab as ServiceAgentSubTabs), + [refreshAgentsList, subTab] ); - const subTabOptions = useMemo(() => { + const subTabItems = useMemo(() => { return Object.values(ServiceAgentSubTabs).map((tabName) => { const Icon = tabName === ServiceAgentSubTabs.COLLATE_AI @@ -163,22 +130,18 @@ const Ingestion: React.FC = ({ ? t('label.collate-ai') : t('label.metadata'); - return { - label: ( -
- - {label} - {getCountBadge( - agentCounts?.[tabName], - 'flex-center h-5', - subTab === tabName - )} -
- ), - value: tabName, - }; + return ( + + + {label} + + ); }); - }, [subTab, agentCounts]); + }, [agentCounts, t]); if (!isAirflowAvailable) { return ; @@ -186,94 +149,37 @@ const Ingestion: React.FC = ({ return (
- - - {isCollateAIWidgetSupported && ( - - )} - - - - -
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/Ingestion.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/Ingestion.test.tsx index 277e3a97df74..6cbc35e121db 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/Ingestion.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/Ingestion.test.tsx @@ -11,35 +11,14 @@ * limitations under the License. */ -import { act, fireEvent, render, screen } from '@testing-library/react'; +import { act, render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { DISABLED } from '../../../../constants/constants'; import { usePermissionProvider } from '../../../../context/PermissionProvider/PermissionProvider'; import { ingestionProps } from '../../../../mocks/Ingestion.mock'; import { ENTITY_PERMISSIONS } from '../../../../mocks/Permissions.mock'; -import { - deployIngestionPipelineById, - enableDisableIngestionPipelineById, - triggerIngestionPipelineById, -} from '../../../../rest/ingestionPipelineAPI'; import Ingestion from './Ingestion.component'; -jest.mock('../../../common/SearchBarComponent/SearchBar.component', () => { - return jest - .fn() - .mockImplementation(({ onSearch }) => ( - - )); -}); - -jest.mock('../../../Modals/EntityDeleteModal/EntityDeleteModal', () => { - return jest - .fn() - .mockImplementation(({ onConfirm }) => ( - - )); -}); - jest.mock( '../../../common/ErrorWithPlaceholder/ErrorPlaceHolderIngestion', () => { @@ -49,70 +28,26 @@ jest.mock( } ); -jest.mock( - '../../../Modals/KillIngestionPipelineModal/KillIngestionPipelineModal', - () => { - return jest.fn().mockImplementation(() =>
KillIngestionModal
); - } -); - jest.mock('./AddIngestionButton.component', () => { return jest.fn().mockImplementation(() =>
AddIngestionButton
); }); -jest.mock('./IngestionRecentRun/IngestionRecentRuns.component', () => ({ - IngestionRecentRuns: jest - .fn() - .mockImplementation(() =>

IngestionRecentRuns

), -})); - -jest.mock('./IngestionListTable/IngestionListTable', () => - jest - .fn() - .mockImplementation( - ({ triggerIngestion, deployIngestion, handleEnableDisableIngestion }) => ( -
-

IngestionListTable

- - - -
- ) - ) -); - -jest.mock( - '../../../common/Skeleton/CommonSkeletons/ControlElements/ControlElements.component', - () => jest.fn().mockImplementation(() =>
ButtonSkeleton
) -); - jest.mock('../../../../context/PermissionProvider/PermissionProvider', () => ({ usePermissionProvider: jest.fn().mockImplementation(() => ({ permissions: { ingestionPipeline: ENTITY_PERMISSIONS, }, + getEntityPermissionByFqn: jest.fn().mockResolvedValue(ENTITY_PERMISSIONS), })), })); jest.mock('../../../../rest/ingestionPipelineAPI', () => ({ - deleteIngestionPipelineById: jest - .fn() - .mockImplementation(() => Promise.resolve({})), - deployIngestionPipelineById: jest - .fn() - .mockImplementation(() => Promise.resolve({})), - enableDisableIngestionPipelineById: jest - .fn() - .mockImplementation(() => Promise.resolve({})), - triggerIngestionPipelineById: jest - .fn() - .mockImplementation(() => Promise.resolve({})), + deleteIngestionPipelineById: jest.fn().mockResolvedValue({}), + deployIngestionPipelineById: jest.fn().mockResolvedValue({}), + enableDisableIngestionPipelineById: jest.fn().mockResolvedValue({}), + getIngestionPipelineByFqn: jest.fn().mockResolvedValue({}), + postKillIngestionPipelineById: jest.fn().mockResolvedValue({}), + triggerIngestionPipelineById: jest.fn().mockResolvedValue({}), })); jest.mock('../../../../hoc/LimitWrapper', () => { @@ -132,32 +67,19 @@ describe('Ingestion', () => { isAirflowAvailable: false, }} />, - { - wrapper: MemoryRouter, - } + { wrapper: MemoryRouter } ); }); expect(screen.getByText('ErrorPlaceHolderIngestion')).toBeInTheDocument(); }); - it('should render the ButtonSkeleton if airflow status is being fetched', async () => { + it('should render the AddIngestionButton when create permission is granted', async () => { await act(async () => { - render( - , - { - wrapper: MemoryRouter, - } - ); + render(, { wrapper: MemoryRouter }); }); - expect(screen.getByText('ButtonSkeleton')).toBeInTheDocument(); + expect(screen.getByText('AddIngestionButton')).toBeInTheDocument(); }); it('should not render the AddIngestionButton if platform is disabled', async () => { @@ -170,9 +92,7 @@ describe('Ingestion', () => { platform: DISABLED, }} />, - { - wrapper: MemoryRouter, - } + { wrapper: MemoryRouter } ); }); @@ -187,80 +107,12 @@ describe('Ingestion', () => { Create: false, }, }, + getEntityPermissionByFqn: jest.fn().mockResolvedValue(ENTITY_PERMISSIONS), })); await act(async () => { - render(, { - wrapper: MemoryRouter, - }); + render(, { wrapper: MemoryRouter }); }); expect(screen.queryByText('AddIngestionButton')).toBeNull(); }); - - it('should call handleSearchChange when searched', async () => { - await act(async () => { - render(, { - wrapper: MemoryRouter, - }); - }); - - const searchBar = screen.getByText('Searchbar'); - - fireEvent.click(searchBar); - - expect(ingestionProps.handleSearchChange).toHaveBeenCalledTimes(1); - }); - - it('should call triggerIngestionPipelineById after pipeline triggered', async () => { - (triggerIngestionPipelineById as jest.Mock).mockImplementationOnce(() => - Promise.resolve({}) - ); - await act(async () => { - render(, { - wrapper: MemoryRouter, - }); - }); - - const triggerPipeline = screen.getByText('triggerIngestion'); - - fireEvent.click(triggerPipeline); - - expect(triggerIngestionPipelineById).toHaveBeenCalledWith('test-id'); - }); - - it('should call deployIngestionPipelineById after pipeline deployed', async () => { - (deployIngestionPipelineById as jest.Mock).mockImplementationOnce(() => - Promise.resolve({}) - ); - await act(async () => { - render(, { - wrapper: MemoryRouter, - }); - }); - - const deployIngestion = screen.getByText('deployIngestion'); - - fireEvent.click(deployIngestion); - - expect(deployIngestionPipelineById).toHaveBeenCalledWith('test-id'); - }); - - it('should call enableDisableIngestionPipelineById after pipeline deployed', async () => { - (enableDisableIngestionPipelineById as jest.Mock).mockImplementationOnce( - () => Promise.resolve({ data: { id: 'test-id', enabled: true } }) - ); - await act(async () => { - render(, { - wrapper: MemoryRouter, - }); - }); - - const handleEnableDisableIngestion = screen.getByText( - 'handleEnableDisableIngestion' - ); - - fireEvent.click(handleEnableDisableIngestion); - - expect(enableDisableIngestionPipelineById).toHaveBeenCalledWith('test-id'); - }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/ingestion.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/ingestion.interface.ts index 76e90bdffdee..5bd63231f59c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/ingestion.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/ingestion.interface.ts @@ -20,8 +20,10 @@ import { Paging } from '../../../../generated/type/paging'; import { UsePagingInterface } from '../../../../hooks/paging/usePaging'; import { ServicesType } from '../../../../interface/service.interface'; import { PagingHandlerParams } from '../../../common/NextPrevious/NextPrevious.interface'; +import { Agent } from '../../../ServiceAgents/AgentsPage.interface'; export interface IngestionProps { + agents: Agent[]; ingestionPagingInfo: UsePagingInterface; serviceDetails: ServicesType; ingestionPipelineList: Array; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/ingestion.less b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/ingestion.less index ca81bf51feda..4c38cacaffd3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/ingestion.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/ingestion.less @@ -33,13 +33,6 @@ width: 350px; } - .reload-button { - border-color: @grey-15; - .anticon.reload-button-icon { - font-size: 14px; - } - } - .quick-filter-dropdown-trigger-btn { display: flex; align-items: center; @@ -52,60 +45,4 @@ font-weight: 500; background-color: var(--tw-color-bg-primary); } - - .agents-sub-tabs-switch { - .ant-radio-button-wrapper, - .ant-radio-button-wrapper-checked:not( - [class*=' ant-radio-button-wrapper-disabled'] - ).ant-radio-button-wrapper:first-child { - font-size: 14px; - font-weight: 500; - } - .ant-radio-button-wrapper-checked:not( - .ant-radio-button-wrapper-disabled - )::before { - background-color: @grey-15; - } - .ant-radio-button-wrapper:first-child { - border-color: @grey-15; - border-radius: 8px 0 0 8px; - } - .ant-radio-button-wrapper:last-child { - border-color: @grey-15; - border-radius: 0 8px 8px 0; - } - .ant-radio-button-wrapper:hover { - .tab-label { - color: @primary-color; - .ant-typography { - color: @primary-color; - } - } - } - .ant-radio-button-wrapper-checked { - background-color: @primary-button-background; - .tab-label { - color: @primary-color; - .ant-typography { - color: @primary-color; - } - } - } - .ant-radio-button-wrapper:focus-within { - box-shadow: none; - } - .ant-radio-button-wrapper { - box-shadow: none; - .tab-label { - display: flex; - align-items: center; - gap: 8px; - } - } - .ant-radio-button-wrapper-checked:not( - .ant-radio-button-wrapper-disabled - ):hover { - background-color: @primary-button-background; - } - } } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/LogViewerModal.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/LogViewerModal.component.tsx index 107c430a8f0a..7f73a126a5c7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/LogViewerModal.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/LogViewerModal.component.tsx @@ -16,7 +16,13 @@ import { Modal, ModalOverlay, } from '@openmetadata/ui-core-components'; -import { Copy01, Download01, File02, SearchMd } from '@untitledui/icons'; +import { + AlignLeft, + Copy01, + Download01, + File02, + SearchMd, +} from '@untitledui/icons'; import classNames from 'classnames'; import { ChangeEvent, FunctionComponent, useMemo, useState } from 'react'; import { Dialog as AriaDialog } from 'react-aria-components'; @@ -48,6 +54,7 @@ const LogViewerModal: FunctionComponent = (props) => { const { t } = useTranslation(); const [searchText, setSearchText] = useState(''); + const [wrap, setWrap] = useState(false); const isStream = props.mode === 'stream'; const fqn = isStream ? props.fqn : ''; @@ -197,6 +204,17 @@ const LogViewerModal: FunctionComponent = (props) => { )} + {onDownload && (
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/LogViewerModal.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/LogViewerModal.test.tsx index b5c55b953e29..87fd1045724b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/LogViewerModal.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/LogViewerModal.test.tsx @@ -94,6 +94,7 @@ jest.mock('react-aria-components', () => ({ })); jest.mock('@untitledui/icons', () => ({ + AlignLeft: () => , Copy01: () => , Download01: () => , File02: () => , @@ -169,6 +170,17 @@ describe('LogViewerModal', () => { expect(onDownload).toHaveBeenCalledTimes(1); }); + it('toggles the wrap button pressed state on click', () => { + render(); + const wrapButton = screen.getByTestId('log-viewer-wrap'); + + expect(wrapButton).toHaveAttribute('aria-pressed', 'false'); + + fireEvent.click(wrapButton); + + expect(wrapButton).toHaveAttribute('aria-pressed', 'true'); + }); + it('shows the loader instead of logs when loading', () => { render(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/log-viewer-modal.less b/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/log-viewer-modal.less index 01a514d957ef..8c78fe834501 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/log-viewer-modal.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/LogViewerModal/log-viewer-modal.less @@ -208,6 +208,11 @@ background-color: var(--lvm-surface-2); color: var(--lvm-text); } + + &--active { + background-color: var(--lvm-surface-2); + color: var(--lvm-text); + } } .lvm-icon { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnectionModal/TestConnectionModal.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnectionModal/TestConnectionModal.test.tsx index 3727281dad44..b3680c11cc30 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnectionModal/TestConnectionModal.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnectionModal/TestConnectionModal.test.tsx @@ -23,16 +23,16 @@ const onConfirmMock = jest.fn(); const testConnectionStep = [ { - name: 'Step 1', + name: 'CheckAccess', description: 'Description 1', mandatory: true, }, - { name: 'Step 2', description: 'Description 2', mandatory: true }, + { name: 'GetSchemas', description: 'Description 2', mandatory: true }, ]; const testConnectionStepResult = [ - { name: 'Step 1', passed: true, mandatory: true }, + { name: 'CheckAccess', passed: true, mandatory: true }, { - name: 'Step 2', + name: 'GetSchemas', passed: false, message: 'Error message', mandatory: true, @@ -70,7 +70,7 @@ describe('TestConnectionModal', () => { render(); expect(screen.getByText('label.establish-connection')).toBeInTheDocument(); - expect(screen.getAllByText('Step 2').length).toBeGreaterThan(0); + expect(screen.getAllByText('GetSchemas').length).toBeGreaterThan(0); }); it('Should render the success icon for a passing step', () => { @@ -104,7 +104,7 @@ describe('TestConnectionModal', () => { isTestingConnection testConnectionStepResult={[ { - name: 'Step 2', + name: 'GetSchemas', passed: false, mandatory: true, status: Status.Running, @@ -158,7 +158,7 @@ describe('TestConnectionModal', () => { isTestingConnection progress={90} testConnectionStepResult={[ - { name: 'Step 1', passed: true, mandatory: true }, + { name: 'CheckAccess', passed: true, mandatory: true }, ]} /> ); @@ -243,6 +243,29 @@ describe('TestConnectionModal', () => { ).toBeInTheDocument(); }); + it('should show all steps as capability checks when no step is a connection gate', () => { + render( + + ); + + expect( + screen.queryByTestId('connection-gate-phase') + ).not.toBeInTheDocument(); + expect( + screen.getByTestId('test-connection-step-Step 1') + ).toBeInTheDocument(); + expect( + screen.getByTestId('test-connection-step-Step 2') + ).toBeInTheDocument(); + }); + it('should mark capability checks as "Didn\'t run" when the gate fails', () => { render( { it('should let the user expand and collapse a capability step log', () => { render(); - const step = screen.getByTestId('test-connection-step-Step 2'); + const step = screen.getByTestId('test-connection-step-GetSchemas'); const stepToggle = step.querySelector('button') as HTMLButtonElement; expect(screen.queryByText('Error message')).not.toBeInTheDocument(); @@ -404,7 +427,7 @@ describe('TestConnectionModal', () => { expect(rawLog).toHaveTextContent('Error message'); - expect(rawLog).not.toHaveTextContent('> Step 2'); + expect(rawLog).not.toHaveTextContent('> GetSchemas'); fireEvent.click(screen.getByText('message.hide-raw-connection-log-lines')); @@ -417,7 +440,7 @@ describe('TestConnectionModal', () => { {...commonProps} testConnectionStepResult={[ { - name: 'Step 1', + name: 'CheckAccess', passed: true, mandatory: true, executedCommand: 'SELECT 1', @@ -433,7 +456,7 @@ describe('TestConnectionModal', () => { expect(rawLog).toHaveTextContent('> SELECT 1'); expect(rawLog).toHaveTextContent('Connected (12 ms)'); - expect(rawLog).not.toHaveTextContent('> Step 1'); + expect(rawLog).not.toHaveTextContent('> CheckAccess'); }); it('should render all lines of a SQLAlchemy multi-line errorLog in error color', () => { @@ -452,7 +475,7 @@ describe('TestConnectionModal', () => { {...commonProps} testConnectionStepResult={[ { - name: 'Step 1', + name: 'CheckAccess', passed: false, mandatory: true, errorLog: multiLineError, @@ -480,13 +503,13 @@ describe('TestConnectionModal', () => { {...commonProps} testConnectionStepResult={[ { - name: 'Step 1', + name: 'CheckAccess', passed: false, mandatory: true, errorLog: 'ConnectionError: refused', }, { - name: 'Step 2', + name: 'GetSchemas', passed: true, mandatory: true, message: 'Connection successful', @@ -879,7 +902,7 @@ describe('TestConnectionModal', () => { {...commonProps} isTestingConnection testConnectionStepResult={[ - { name: 'Step 1', passed: true, mandatory: true }, + { name: 'CheckAccess', passed: true, mandatory: true }, ]} /> ); diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json index 2ad2cb619064..a2d0e4cb8580 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json @@ -97,6 +97,7 @@ "advanced-configuration": "تكوين متقدم", "advanced-entity": "{{entity}} متقدم", "advanced-search": "بحث متقدم", + "agent": "الوكيل", "agent-activity": "نشاط الوكيل", "agent-plural": "الوكلاء", "agent-setup": "إعداد الوكيل", @@ -189,6 +190,8 @@ "asset-plural": "أصول", "asset-plural-lowercase": "أصول", "asset-type": "نوع الأصل", + "assets-ingested": "الأصول المُستوعَبة", + "assets-profiled": "الأصول المُحلَّلة", "assigned": "مُعيَّن", "assigned-entity": "{{entity}} مُعيَّن", "assigned-to-me": "مُعيَّن لي", @@ -248,6 +251,7 @@ "basic-configuration": "التكوين الأساسي", "batch-size": "حجم الدفعة", "bearer-hmac-signature": "Bearer (توقيع HMAC)", + "before-error": "قبل الخطأ", "before-number-of-day-plural": "قبل {{numberOfDays}} يوم", "belongs-to": "ينتمي إلى", "belongs-to-database": "ينتمي إلى قاعدة البيانات", @@ -369,6 +373,7 @@ "collapse": "طي", "collapse-all": "طي الكل", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "وكلاء Collate AI", "collection": "مجموعة", "collection-plural": "مجموعات", "color": "اللون", @@ -492,7 +497,7 @@ "cost-analysis": "تحليل التكلفة", "count": "العدد", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} قيد التشغيل", "cover-image": "غلاف", "covered": "مغطى", "create": "إنشاء", @@ -664,12 +669,14 @@ "dbt-source": "مصدر dbt", "dbt-source-project": "مشروع مصدر dbt", "deactivated": "تم إلغاء التفعيل", + "debug": "تصحيح", "december": "ديسمبر", "decision": "قرار", "default": "افتراضي", "default-persona": "شخصية افتراضية", "default-role": "دور افتراضي", "delete": "حذف", + "delete-agent": "حذف الوكيل", "delete-all-nodes": "حذف جميع العقد", "delete-boost": "حذف التعزيز", "delete-data-asset-rule": "حذف قاعدة أصل البيانات", @@ -697,6 +704,7 @@ "deployed": "تم النشر", "deployed-lowercase": "تم النشر", "deploying-lowercase": "جاري النشر", + "deployment-complete": "اكتمل النشر", "deprecate": "Deprecate", "depth": "عمق", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "التفاصيل", "details": "التفاصيل", "developed-by-developer": "تم تطويره بواسطة {{developer}}", + "diagnose": "تشخيص", "diagnostic-info": "معلومات التشخيص", "did-not-run": "لم يتم التشغيل", "dimension": "البعد", @@ -784,6 +793,7 @@ "drive-plural": "محركات الأقراص", "duplicate": "تكرار", "duration": "المدة", + "duration-in-minute": "{{duration}} دقيقة", "dynamic": "ديناميكي", "dynamic-assertion": "تأكيد ديناميكي", "edge": "حافة", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "تعديل وقبول الاقتراح", "edit-an-announcement": "تعديل إعلان", "edit-chart-name": "تعديل المخطط: \"{{name}}\"", + "edit-configuration": "تعديل الإعدادات", "edit-connection": "تحرير الاتصال", "edit-data-asset-rule": "تعديل قاعدة أصل البيانات", "edit-description-for": "تعديل الوصف لـ {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "تكافؤ", "error": "خطأ", "error-plural": "أخطاء", + "error-plural-lowercase": "أخطاء", "esc": "Esc", + "est-remaining": "المتبقي المُقدَّر", "establish-connection": "Establish Connection", "evaluate": "تقييم", "evaluate-permission": "تقييم الصلاحية", @@ -972,8 +985,10 @@ "factor": "عامل", "fail-on-conflict": "الفشل عند التعارض", "failed": "فشل", + "failed-at": "فشل عند", "failed-entity": "{{entity}} فاشل", "failed-event-plural": "الأحداث الفاشلة", + "failed-lowercase": "فشل", "failed-rows": "صفوف فاشلة", "failed-slash-aborted-reason": "سبب الفشل/الإحباط", "failed-to-upload-file": "فشل في تحميل الملف", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "أنماط التصفية", "filter-plural": "مرشحات", "filtered": "تمت التصفية", + "filtered-lowercase": "مُصفّى", "filtering-condition": "شرط التصفية", "filters-configuration": "تكوين المرشحات", + "finished": "انتهى", + "finished-lowercase": "انتهى", "first": "الأول", "first-lowercase": "الأول", "first-name": "الاسم الأول", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "إخفاء إعدادات انتحال الشخصية ({{count}})", "hide-meta-details": "إخفاء تفاصيل الميتا", "hide-property-plural": "إخفاء الخصائص", + "hide-raw-logs": "إخفاء السجلات الأولية", "hierarchical": "هرمي", "hierarchy": "التسلسل الهرمي", "hierarchy-depth": "عمق التسلسل الهرمي", @@ -1170,6 +1189,7 @@ "homepage": "الصفحة الرئيسية", "hour": "ساعة", "hourly": "كل ساعة", + "how-to-fix": "كيفية الإصلاح", "http-config-source": "مصدر تكوين HTTP", "http-method": "طريقة HTTP", "hybrid-search-weight-plural": "أوزان البحث الهجين", @@ -1226,6 +1246,7 @@ "index-name": "اسم الفهرس", "index-states": "إحصائيات الفهرس", "indirect": "غير مباشر", + "info": "معلومات", "ingest-sample-data": "استيعاب بيانات العينة", "ingestion": "الاستيعاب", "ingestion-lowercase": "الاستيعاب", @@ -1297,6 +1318,7 @@ "keyword": "كلمة مفتاحية", "keyword-lowercase-plural": "كلمات مفتاحية", "kill": "إيقاف قسري", + "kill-run": "إنهاء التشغيل", "knowledge": "المعرفة", "knowledge-article-plural": "مقالات المعرفة", "knowledge-center": "مركز المعرفة", @@ -1508,7 +1530,9 @@ "model": "نموذج", "model-name": "اسم النموذج", "model-plural": "نماذج", + "model-plural-lowercase": "نماذج", "model-store": "متجر النماذج", + "models-parsed": "النماذج المُحلَّلة", "modified-time": "وقت التعديل", "modifier": "المعدِّل", "monday": "الاثنين", @@ -1517,6 +1541,7 @@ "monthly": "شهري", "more": "المزيد", "more-action": "المزيد من الإجراءات", + "more-action-plural": "المزيد من الإجراءات", "more-actions": "المزيد من الإجراءات", "more-help": "مزيد من المساعدة", "more-lowercase": "المزيد", @@ -1554,6 +1579,7 @@ "native-field-plural": "الحقول الأصلية", "navigation": "التنقل", "navigation-menu-plural": "قوائم التنقل", + "need-attention": "تحتاج إلى انتباه", "need-help": "هل تحتاج مساعدة", "needs-attention": "يتطلب الاهتمام", "needs-review": "بحاجة للمراجعة", @@ -1605,6 +1631,7 @@ "no-records": "لا توجد سجلات", "no-result-found": "لم يتم العثور على نتائج", "no-reviewer": "لا يوجد مراجع", + "no-status": "لا توجد حالة", "no-tags-added": "لم تتم إضافة أي وسوم", "no-tasks-yet": "لا توجد مهام بعد", "no-tests-run": "لم يتم تشغيل أي اختبارات", @@ -1741,6 +1768,7 @@ "part-of": "جزء من", "part-of-domain": "جزء من نطاق", "partial-coverage": "تغطية جزئية", + "partial-success": "نجاح جزئي", "partition-lowercase-plural": "أقسام", "partition-plural": "الأقسام", "partitioned": "مقسم", @@ -1885,12 +1913,15 @@ "public-team": "فريق عام", "published": "منشور", "quality": "الجودة", + "queries-processed": "الاستعلامات المُعالَجة", + "queries-scanned": "الاستعلامات المفحوصة", "query": "استعلام", "query-log-duration": "مدة سجل الاستعلام", "query-lowercase": "استعلام", "query-lowercase-plural": "استعلامات", "query-parameter-plural": "معلمات الاستعلام", "query-plural": "استعلامات", + "query-plural-lowercase": "استعلامات", "query-used-in": "الاستعلام المستخدم في", "queued": "في قائمة الانتظار", "quick-add": "إضافة سريعة", @@ -1902,11 +1933,13 @@ "range": "نطاق", "range-condition": "شرط النطاق", "raw-connection-log": "Raw Connection Log", + "raw-logs": "السجلات الأولية", "rdf-predicate": "محمول RDF", "rdf-store": "مخزن RDF", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "إعادة التعيين", "re-deploy": "إعادة النشر", + "re-deploy-sentence": "إعادة النشر", "re-enter-new-password": "إعادة إدخال كلمة المرور الجديدة", "re-index-all": "إعادة فهرسة الكل", "re-index-elasticsearch": "إعادة فهرسة Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "الأخيرة", "recent-event-plural": "الأحداث الأخيرة", "recent-run-plural": "عمليات التشغيل الأخيرة", + "recent-runs-sentence": "عمليات التشغيل الأخيرة", "recent-search-term-plural": "مصطلحات البحث الأخيرة", "recent-views": "المشاهدات الأخيرة", "recently-created": "تم إنشاؤه حديثًا", @@ -1931,6 +1965,8 @@ "recently-updated": "تم تحديثه حديثًا", "recently-viewed": "تمت مشاهدته مؤخرًا", "record-plural": "سجلات", + "records": "سجلات", + "records-processed": "السجلات المُعالَجة", "recreate-index-plural": "إعادة إنشاء الفهارس", "reference-plural": "مراجع", "refocused-to-home": "إعادة التركيز إلى الصفحة الرئيسية", @@ -2071,6 +2107,7 @@ "run": "تشغيل", "run-agent-plural": "تشغيل الوكلاء", "run-at": "تشغيل في", + "run-history-and-details": "سجل التشغيل والتفاصيل", "run-in-background": "Run in background", "run-now": "تشغيل الآن", "run-type": "نوع التشغيل", @@ -2138,6 +2175,7 @@ "search-index-plural": "فهارس البحث", "search-index-setting-plural": "إعدادات فهرس البحث", "search-insights": "رؤى البحث", + "search-logs": "البحث في السجلات", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "البحث في الذكريات حسب المحتوى...", @@ -2248,6 +2286,7 @@ "show-nested": "إظهار المتداخل", "show-or-hide-advanced-config": "{{showAdv}} التكوين المتقدم", "show-or-hide-column-plural": "إظهار / إخفاء الأعمدة", + "show-raw-logs": "إظهار السجلات الأولية", "showing-count-of-total-assets": "عرض {{count}} من أصل {{total}} أصل", "showing-total-failure-plural": "إجمالي {{total}} حالات فشل", "sign-in": "تسجيل الدخول", @@ -2313,6 +2352,7 @@ "started": "بدأ", "started-following": "بدأ المتابعة", "starting-offset": "إزاحة البدء", + "starts-after": "يبدأ بعد", "starts-with": "يبدأ بـ", "state": "الحالة", "static": "ثابت", @@ -2322,10 +2362,13 @@ "status-success": "نجح", "stay-up-to-date": "ابقَ على اطلاع", "step": "خطوة", + "steps": "الخطوات", + "steps-lowercase": "خطوات", "steward": "Steward", "stop": "إيقاف", "stop-re-index-all": "إيقاف إعادة الفهرسة", "stopped": "متوقف", + "stopped-lowercase": "متوقف", "storage": "التخزين", "storage-plural": "وحدات التخزين", "storage-service": "خدمة التخزين", @@ -2500,6 +2543,7 @@ "to-perform": "لأداء", "to-service-name": "إلى اسم الخدمة", "to-service-type": "إلى نوع الخدمة", + "toggle-wrap": "تبديل الالتفاف", "token": "Token", "token-end-point": "نقطة نهاية الرمز المميز", "token-expiration": "انتهاء صلاحية الرمز المميز", @@ -2673,6 +2717,7 @@ "view-plural": "مشاهدات", "view-property-plural": "عرض الخصائص", "view-reindex-failure-plural": "عرض حالات فشل إعادة الفهرسة", + "view-run-history": "عرض سجل التشغيل", "view-selected": "عرض المحدد", "visibility": "الرؤية", "visibility-dataspace": "مساحة البيانات", @@ -2685,8 +2730,10 @@ "volume-change": "تغيير الحجم", "wall-clock": "الوقت الفعلي", "wants-to-access-your-account": "يريد الوصول إلى حسابك {{username}}", + "warn": "تحذير", "warning": "تحذير", "warning-plural": "تحذيرات", + "warning-plural-lowercase": "تحذيرات", "web-analytic-entity-view-report-data": "بيانات تقرير عرض كيان تحليلات الويب", "web-analytic-user-activity-report-data": "بيانات تقرير نشاط مستخدم تحليلات الويب", "web-analytics-report": "تقرير تحليلات الويب", @@ -2722,6 +2769,8 @@ "workflow-plural": "سير العمل", "worksheet": "ورقة عمل", "worksheet-plural": "أوراق عمل", + "wrap": "التفاف", + "wrapping-up": "قيد الإنهاء", "year": "السنة", "yes": "نعم", "yes-comma-confirm": "نعم، تأكيد", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "اكتشف أصول البيانات الصحيحة باستخدام محرر بناء الجملة وشروط 'و'/'أو'.", "agent-setup-description": "قم بتكوين المعاملات الأساسية لهذا الوكيل.", + "agents-deploy-progress": "{{done}} مكتمل · {{running}} قيد التشغيل · {{queued}} في قائمة الانتظار{{failedSuffix}} — يعمل الوكلاء وفق جدولهم بعد هذه المرحلة الأولى", + "agents-deploying-ingesting": "الوكلاء يقومون بالنشر واستيعاب البيانات الوصفية", + "agents-finished-summary": "انتهى {{done}} من {{total}} وكيل{{attentionSuffix}}", "aggregate-domain-type-description": "النطاقات الأقرب إلى الخدمات عبر الإنترنت وقواعد البيانات للمعاملات التي تتضمن الأحداث وبيانات المعاملات.", "airflow-guide-message": "تستخدم {{brandName}} Airflow لتشغيل موصلات الاستيعاب. لقد قمنا بتطوير واجهات برمجة تطبيقات مُدارة لنشر موصلات الاستيعاب. يرجى استخدام مثيل {{brandName}} Airflow أو الرجوع إلى الدليل أدناه لتثبيت واجهات برمجة التطبيقات المُدارة في تثبيت Airflow الخاص بك.", "airflow-host-ip-address": "ستتصل {{brandName}} بموردك من عنوان IP <0>{{hostIp}}. تأكد من السماح لحركة المرور الواردة في إعدادات أمان الشبكة الخاصة بك.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "انقر على <0>{{text}} لعرض التفاصيل.", "closed-this-task": "أغلق هذه المهمة", "collaborate-with-other-user": "للتعاون مع المستخدمين الآخرين.", + "collate-ai-agents-description": "صنّف تلقائيًا ووثّق وافحص جودة أصولك باستخدام الذكاء الاصطناعي.", "collate-ai-widget-description": "نظرة عامة على البيانات التي تم إنشاؤها بواسطة Collate AI للخدمة. <0>تعلم المزيد.", "column-bulk-operations-description": "إدارة وتعديل البيانات الوصفية لأعمدة متعددة في آنٍ واحد. البحث والتصفية وتحديث أسماء العرض والأوصاف والوسوم ومصطلحات المسرد عبر أصول البيانات الخاصة بك.", "column-filter-help-text": "تصفية النسب حسب علامات الأعمدة أو الأسماء. استخدم 'tag:اسم_العلامة' لتصفية العلامات أو أدخل اسم العمود فقط.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "خطأ أثناء جلب رمز الوصول المميز.", "establishing-connection-ellipsis": "جارٍ إنشاء الاتصال…", "events-matching-search-query": "الأحداث المطابقة لاستعلام البحث", + "everything-healthy": "كل شيء سليم", "example-value": "مثال: {{value}}", "exclude-system-entity-description": "عند التعطيل، يتم تطبيق الأنماط الافتراضية المحددة في المخطط لـ {{entity}} تلقائيًا.", "excludes-regex-line": "يستثني += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "ملاحظة: لم يتم تحقيق هدف مؤشر أداء الوصف بعد، ولكن لا يزال هناك وقت – بقي {{count}} يومًا لمؤسستك. للبقاء على المسار الصحيح، يرجى تفعيل تقرير رؤى البيانات. سيسمح لنا هذا بإرسال تحديثات أسبوعية إلى جميع الفرق، مما يعزز التعاون والتركيز نحو تحقيق مؤشرات الأداء الرئيسية لمؤسستنا.", "latency-sla-description": "<0>{{label}}: يجب أن تكون استجابة الاستعلام أقل من <0>{{data}}", "latest-offset-description": "أحدث إزاحة للحدث في النظام.", + "latest-run-lines": "أحدث تشغيل · {{count}} سطر", "ldap-group-dn-placeholder": "مثال: cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "هذا DN لمجموعة LDAP مُعيَّن بالفعل. يمكن تعيين كل مجموعة LDAP مرة واحدة فقط.", "learning-resources-management-description": "استكشف ميزات المنتج وتعلم كيفية عملها من خلال مواردنا", + "leave-page-ingestion-continues": "يمكنك مغادرة هذه الصفحة — يستمر الاستيعاب في الخلفية", "leave-the-team-team-name": "مغادرة الفريق {{teamName}}", "length-validator-error": "مطلوب ما لا يقل عن {{length}} {{field}}", "lineage-ingestion-description": "يمكن تكوين ونشر سير عمل سلسلة البيانات بعد إعداد استيعاب البيانات الوصفية. يحصل سير عمل استيعاب سلسلة البيانات على سجل الاستعلام ويحلل استعلامات CREATE، INSERT، MERGE... ويجهز سلسلة البيانات بين الكيانات المعنية. يمكن أن يحتوي استيعاب سلسلة البيانات على سير عمل واحد فقط لخدمة قاعدة بيانات. حدد مدة سجل الاستعلام (بالأيام) وحد النتائج للبدء.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "ماذا تريد أن تحلل اليوم؟", "mcp-chat-placeholder": "اسأل أي شيء...", "mentioned-you-on-the-lowercase": "أشار إليك في الـ", + "metadata-agents-description": "استخرج البيانات الوصفية والاستخدام والمسار والتحليل من المصدر.", "metadata-agents-table-description": "تُستخدم وكلاء البيانات الوصفية لاستخراج البيانات الوصفية من الخدمات المصدر.", "metadata-ingestion-description": "بناءً على نوع الخدمة المحدد، أدخل تفاصيل نمط المرشح للمخطط أو الجدول (قاعدة البيانات)، أو الموضوع (المراسلة)، أو لوحة المعلومات. يمكنك تضمين أو استبعاد أنماط المرشح. اختر تضمين العروض، وتفعيل أو تعطيل محلل البيانات، واستيعاب بيانات العينة، حسب الاقتضاء.", "metadata-status-complete-description": "البيانات الوصفية مكتملة ومتسقة عبر جميع الأعمدة", @@ -3392,6 +3449,8 @@ "minimum-count-error": "يجب تحديد {{count}} {{field}} على الأقل.", "minimum-value-error": "يجب أن تكون القيمة الدنيا أصغر من القيمة القصوى.", "minute": "دقيقة", + "minutes-left": "~{{count}} دقيقة متبقية", + "minutes-short": "{{count}} دقيقة", "missing-config-value": "قيمة التكوين مفقودة: {{field}}", "missing-description": "وصف مفقود", "modified-time-ago-by": "تم التعديل قبل {{time}} بواسطة {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "لم يتم تكوين تعيينات أدوار LDAP.", "no-learning-resources-available": "لا توجد موارد تعليمية متاحة لهذا السياق.", "no-lineage-available": "لم يتم العثور على روابط النسب", + "no-lines-match": "لا توجد أسطر مطابقة.", "no-match-found": "لم يتم العثور على تطابق", "no-mentions": "يبدو أنك وفريقك واضحون تمامًا - لا توجد إشارات في أي أنشطة بعد. استمروا في العمل الرائع!", "no-native-fields": "لا توجد حقول أصلية قابلة للتكوين لنوع الكيان هذا.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "استكشف مقاييس جدولك بتشغيل سير عمل المُحلل (profiler). سترى عدد الصفوف، وتحديثات الجدول، وتغيرات الحجم، والمزيد. تفضل بزيارة وثائقنا لخطوات الإعداد.", "no-profiler-title": "شغّل محلل البيانات لفتح رؤى الجدول", "no-properties-added": "No properties added.", + "no-recent-runs": "لم يتم العثور على عمليات تشغيل حديثة.", "no-recently-viewed-data": "لم تقم بعرض أي أصول بيانات مؤخرًا. استكشف للعثور على شيء مثير للاهتمام!", "no-reference-available": "لا توجد مراجع متاحة.", "no-related-terms-available": "لا توجد مصطلحات ذات صلة متاحة.", @@ -3638,6 +3699,7 @@ "password-error-message": "يجب أن تتراوح كلمة المرور بين 8 و 56 حرفًا كحد أدنى وأقصى وأن تحتوي على حرف كبير واحد على الأقل (A-Z)، وحرف صغير واحد (a-z)، ورقم واحد، وحرف خاص واحد (مثل !, %، @، أو #)", "password-pattern-error": "يجب أن تكون كلمة المرور بحد أدنى 8 وأقصى 56 حرفًا، مع حرف خاص واحد، وحرف كبير واحد، وحرف صغير واحد", "path-of-the-dbt-files-stored": "مسار المجلد الذي يتم فيه تخزين ملفات dbt", + "percent-complete-all-agents": "{{percent}}% مكتمل عبر جميع الوكلاء", "permanently-delete-common-message": "حذف هذا {{entity}} وجميع بياناته الوصفية نهائيًا. لا يمكن التراجع عن هذا الإجراء.", "permanently-delete-ingestion-pipeline": "سيؤدي الحذف الدائم لـ <0>{{entityName}} إلى فقدان تكوين المسار (pipeline)، ولا يمكن استعادته.", "permanently-delete-metadata": "سيؤدي الحذف الدائم لـ <0>{{entityName}} إلى إزالة بياناته الوصفية من {{brandName}}، ولا يمكن استعادته.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "تكوين لضبط المدة التي نريد النظر إليها في سجلات الاستعلام لمعالجة بيانات الاستخدام.", "query-used-by-other-tables": "استعلام مستخدم من قبل جداول أخرى", "quick-add-tip": "استخدم الإضافة السريعة لإنشاء علاقات مصطلحات المسرد دون مغادرة الرسم البياني.", + "ran-for-duration": "استمر لمدة {{duration}} دقيقة", "rdf-not-enabled-for-export": "يجب تمكين RDF لتصدير الأنطولوجيا. يرجى تمكين RDF في إعدادات الخادم.", "rdf-predicate-tooltip": "معرف URI لمحمول RDF لنوع العلاقة هذا (مثال: skos:broader, skos:exactMatch).", "reacted-with-emoji": "تفاعل باستخدام رمز {{type}} التعبيري", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: يجب الاحتفاظ بالبيانات لمدة <0>{{data}}", "run-sample-data-to-ingest-sample-data": "'شغل عينة البيانات لاستيعاب أصول البيانات النموذجية في {{brandName}} الخاص بك.'", "run-status-at-timestamp": "حالة التشغيل: {{status}} في {{timestamp}}", + "run-status-click-details": "تشغيل {{status}} · انقر للتفاصيل", "run-successful-test-to-continue": "أجرِ اختباراً ناجحاً للمتابعة.", "sample-data-ingestion-config-description": "يحدد هذا المخطط المعلمات التي يمكن تمريرها لجمع بيانات العينة.", "schedule-description": "جدولة الاستيعاب ليتم تشغيله في وقت وتكرار محددين.", @@ -3740,6 +3804,8 @@ "search-insights-description": "اعرض إحصائيات عنقود البحث وتفاصيل الفهرس وأدر الفهارس اليتيمة.", "search-settings-description": "إعدادات البحث لكل كيان بناءً على التصنيفات.", "search-settings-for-entity": "إعدادات البحث بناءً على التصنيف لـ {{entity}}", + "seconds-left": "~{{count}} ثانية متبقية", + "seconds-short": "{{count}} ثانية", "see-also": "انظر أيضاً", "see-how-to-get-started": "شاهد كيف تبدأ", "select-alert-type": "الرجاء تحديد نوع تنبيه", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json index 35c0c7378e8b..b881b21aa0dc 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json @@ -97,6 +97,7 @@ "advanced-configuration": "Erweiterte Konfiguration", "advanced-entity": "Erweitertes {{entity}}", "advanced-search": "Erweiterte Suche", + "agent": "Agent", "agent-activity": "Agentenaktivität", "agent-plural": "Agenten", "agent-setup": "Agent-Einrichtung", @@ -189,6 +190,8 @@ "asset-plural": "Vermögenswerte", "asset-plural-lowercase": "vermögenswerte", "asset-type": "Asset-Typ", + "assets-ingested": "Assets aufgenommen", + "assets-profiled": "Assets profiliert", "assigned": "Zugewiesen", "assigned-entity": "Zugewiesen zu {{entity}}", "assigned-to-me": "Mir zugewiesen", @@ -248,6 +251,7 @@ "basic-configuration": "Grundkonfiguration", "batch-size": "Batchgröße", "bearer-hmac-signature": "Bearer (HMAC-Signatur)", + "before-error": "vor Fehler", "before-number-of-day-plural": "Vor {{numberOfDays}} Tagen", "belongs-to": "Gehört zu", "belongs-to-database": "Gehört zur Datenbank", @@ -369,6 +373,7 @@ "collapse": "Zusammenklappen", "collapse-all": "Alle minimieren", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Collate AI Agenten", "collection": "Sammlung", "collection-plural": "Sammlungen", "color": "Farbe", @@ -492,7 +497,7 @@ "cost-analysis": "Kostenanalyse", "count": "Anzahl", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} in Ausführung", "cover-image": "Abdeckung", "covered": "Bedeckt", "create": "Erstellen", @@ -664,12 +669,14 @@ "dbt-source": "dbt-Quelle", "dbt-source-project": "dbt-Quellprojekt", "deactivated": "Deaktiviert", + "debug": "Debug", "december": "Dezember", "decision": "Entscheidung", "default": "Standard", "default-persona": "Standard-Persona", "default-role": "Standardrolle", "delete": "Löschen", + "delete-agent": "Agent löschen", "delete-all-nodes": "Alle Knoten löschen", "delete-boost": "Boost löschen", "delete-data-asset-rule": "Datenasset-Regel löschen", @@ -697,6 +704,7 @@ "deployed": "Bereitgestellt", "deployed-lowercase": "bereitgestellt", "deploying-lowercase": "am bereitstellen", + "deployment-complete": "Bereitstellung abgeschlossen", "deprecate": "Deprecate", "depth": "Tiefe", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Einzelheiten", "details": "Einzelheiten", "developed-by-developer": "Entwickelt von {{developer}}", + "diagnose": "Diagnostizieren", "diagnostic-info": "Diagnoseinformationen", "did-not-run": "Nicht ausgeführt", "dimension": "Dimension", @@ -784,6 +793,7 @@ "drive-plural": "Laufwerke", "duplicate": "Duplikat", "duration": "Dauer", + "duration-in-minute": "{{duration}} Min.", "dynamic": "Dynamisch", "dynamic-assertion": "Dynamische Assertion", "edge": "Kante", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Bearbeiten und Vorschlag annehmen", "edit-an-announcement": "Ankündigung bearbeiten", "edit-chart-name": "Diagramm bearbeiten: \"{{name}}\"", + "edit-configuration": "Konfiguration bearbeiten", "edit-connection": "Verbindung bearbeiten", "edit-data-asset-rule": "Datenasset-Regel bearbeiten", "edit-description-for": "Beschreibung für {{entityName}} aktualisieren", @@ -909,7 +920,9 @@ "equivalence": "Äquivalenz", "error": "Fehler", "error-plural": "Fehler", + "error-plural-lowercase": "Fehler", "esc": "Esc", + "est-remaining": "gesch. verbleibend", "establish-connection": "Establish Connection", "evaluate": "Bewerten", "evaluate-permission": "Berechtigung bewerten", @@ -972,8 +985,10 @@ "factor": "Faktor", "fail-on-conflict": "Bei Konflikt fehlschlagen", "failed": "Fehlgeschlagen", + "failed-at": "Fehlgeschlagen bei", "failed-entity": "{{entity}} fehlgeschlagen", "failed-event-plural": "Fehlgeschlagene Ereignisse", + "failed-lowercase": "fehlgeschlagen", "failed-rows": "Fehlgeschlagene Zeilen", "failed-slash-aborted-reason": "Fehler-/Abbruchgrund", "failed-to-upload-file": "Fehler beim Hochladen der Datei", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Filtermuster", "filter-plural": "Filter", "filtered": "gefiltert", + "filtered-lowercase": "gefiltert", "filtering-condition": "Filterbedingung", "filters-configuration": "Filter-Konfiguration", + "finished": "Abgeschlossen", + "finished-lowercase": "abgeschlossen", "first": "Erster", "first-lowercase": "erster", "first-name": "Vorname", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Identitätswechsel-Einstellungen ausblenden ({{count}})", "hide-meta-details": "Meta-Details ausblenden", "hide-property-plural": "Eigenschaften verbergen", + "hide-raw-logs": "Rohprotokolle ausblenden", "hierarchical": "Hierarchisch", "hierarchy": "Hierarchie", "hierarchy-depth": "Hierarchietiefe", @@ -1170,6 +1189,7 @@ "homepage": "Startseite", "hour": "Stunde", "hourly": "Stündlich", + "how-to-fix": "So beheben Sie das Problem", "http-config-source": "HTTP-Konfigurationsquelle", "http-method": "HTTP Methode", "hybrid-search-weight-plural": "Hybride Suchgewichte", @@ -1226,6 +1246,7 @@ "index-name": "Indexname", "index-states": "Indexstatus", "indirect": "Indirekt", + "info": "Info", "ingest-sample-data": "Beispieldaten einlesen", "ingestion": "Erfassung", "ingestion-lowercase": "erfassung", @@ -1297,6 +1318,7 @@ "keyword": "Schlüsselwort", "keyword-lowercase-plural": "Schlüsselwörter", "kill": "Beenden", + "kill-run": "Ausführung abbrechen", "knowledge": "Wissen", "knowledge-article-plural": "Wissensartikel", "knowledge-center": "Wissenscenter", @@ -1508,7 +1530,9 @@ "model": "Modell", "model-name": "Modellname", "model-plural": "Modelle", + "model-plural-lowercase": "Modelle", "model-store": "Modellspeicher", + "models-parsed": "Modelle geparst", "modified-time": "Änderungszeit", "modifier": "Modifikator", "monday": "Montag", @@ -1517,6 +1541,7 @@ "monthly": "Monatlich", "more": "Mehr", "more-action": "Mehr Action", + "more-action-plural": "Weitere Aktionen", "more-actions": "Weitere Aktionen", "more-help": "Mehr Hilfe", "more-lowercase": "mehr", @@ -1554,6 +1579,7 @@ "native-field-plural": "Native Felder", "navigation": "Navigation", "navigation-menu-plural": "Navigationsmenüs", + "need-attention": "erfordern Aufmerksamkeit", "need-help": "Brauche Hilfe", "needs-attention": "Erfordert Aufmerksamkeit", "needs-review": "Muss überprüft werden", @@ -1605,6 +1631,7 @@ "no-records": "Keine Aufzeichnungen", "no-result-found": "Keine Ergebnisse gefunden", "no-reviewer": "Kein Prüfer", + "no-status": "Kein Status", "no-tags-added": "Keine Tags hinzugefügt", "no-tasks-yet": "Noch keine Aufgaben", "no-tests-run": "Keine Tests ausgeführt", @@ -1741,6 +1768,7 @@ "part-of": "Teil von", "part-of-domain": "Teil des Bereichs", "partial-coverage": "Teilweise Abdeckung", + "partial-success": "Teilweiser Erfolg", "partition-lowercase-plural": "Partitionen", "partition-plural": "Partitionen", "partitioned": "Partitioniert", @@ -1885,12 +1913,15 @@ "public-team": "Öffentliches Team", "published": "Veröffentlicht", "quality": "Qualität", + "queries-processed": "Abfragen verarbeitet", + "queries-scanned": "Abfragen gescannt", "query": "Abfrage", "query-log-duration": "Abfrageprotokolldauer", "query-lowercase": "abfrage", "query-lowercase-plural": "abfragen", "query-parameter-plural": "Abfrageparameter", "query-plural": "Abfragen", + "query-plural-lowercase": "Abfragen", "query-used-in": "Verwendete Abfragen in", "queued": "Eingereiht", "quick-add": "Schnellhinzufügen", @@ -1902,11 +1933,13 @@ "range": "Bereich", "range-condition": "Bereichsbedingung", "raw-connection-log": "Raw Connection Log", + "raw-logs": "Rohprotokolle", "rdf-predicate": "RDF-Prädikat", "rdf-store": "RDF-Speicher", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Neu zuweisen", "re-deploy": "Erneut bereitstellen", + "re-deploy-sentence": "Erneut bereitstellen", "re-enter-new-password": "Neues Passwort erneut eingeben", "re-index-all": "Alle neu indizieren", "re-index-elasticsearch": "Elasticsearch neu indizieren", @@ -1924,6 +1957,7 @@ "recent-chat": "Letzte", "recent-event-plural": "Letzte Ereignisse", "recent-run-plural": "Aktuelle Ausführungen", + "recent-runs-sentence": "Letzte Ausführungen", "recent-search-term-plural": "Aktuelle Suchbegriffe", "recent-views": "Aktuelle Ansichten", "recently-created": "Kürzlich erstellt", @@ -1931,6 +1965,8 @@ "recently-updated": "Kürzlich aktualisiert", "recently-viewed": "Kürzlich angesehen", "record-plural": "Einträge", + "records": "Datensätze", + "records-processed": "Datensätze verarbeitet", "recreate-index-plural": "Indizes neu erstellen", "reference-plural": "Verweise", "refocused-to-home": "Konzentriert sich wieder auf die Heimat", @@ -2071,6 +2107,7 @@ "run": "Ausführen", "run-agent-plural": "Agenten ausführen", "run-at": "Ausführen um", + "run-history-and-details": "Ausführungsverlauf & Details", "run-in-background": "Run in background", "run-now": "Jetzt ausführen", "run-type": "Ausführart", @@ -2138,6 +2175,7 @@ "search-index-plural": "Suchindizes", "search-index-setting-plural": "Suchindexeinstellungen", "search-insights": "Sucheinblicke", + "search-logs": "Protokolle durchsuchen", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Erinnerungen nach Inhalt durchsuchen...", @@ -2248,6 +2286,7 @@ "show-nested": "Verschachtelte anzeigen", "show-or-hide-advanced-config": "{{showAdv}} Erweiterte Konfiguration anzeigen/ausblenden", "show-or-hide-column-plural": "Spalten anzeigen/verbergen", + "show-raw-logs": "Rohprotokolle anzeigen", "showing-count-of-total-assets": "{{count}} von {{total}} Assets werden angezeigt", "showing-total-failure-plural": "Insgesamt {{total}} Ausfälle", "sign-in": "Anmelden", @@ -2313,6 +2352,7 @@ "started": "Gestartet", "started-following": "Hat begonnen zu folgen", "starting-offset": "Start-Offset", + "starts-after": "Startet nach", "starts-with": "beginnt mit", "state": "Zustand", "static": "Statisch", @@ -2322,10 +2362,13 @@ "status-success": "Erfolgreich", "stay-up-to-date": "Bleiben Sie auf dem neuesten Stand", "step": "Schritt", + "steps": "Schritte", + "steps-lowercase": "Schritte", "steward": "Steward", "stop": "Stopp", "stop-re-index-all": "Stoppen Sie die erneute Indexierung aller", "stopped": "Gestoppt", + "stopped-lowercase": "gestoppt", "storage": "Speicher", "storage-plural": "Speicher", "storage-service": "Speicherdienst", @@ -2500,6 +2543,7 @@ "to-perform": "durchführen", "to-service-name": "Zu Servicename", "to-service-type": "Zum Servicetyp", + "toggle-wrap": "Zeilenumbruch umschalten", "token": "Token", "token-end-point": "Token-Endpunkt", "token-expiration": "Token-Ablauf", @@ -2673,6 +2717,7 @@ "view-plural": "Ansichten", "view-property-plural": "Eigenschaften anzeigen", "view-reindex-failure-plural": "Neuindizierungsfehler anzeigen", + "view-run-history": "Ausführungsverlauf anzeigen", "view-selected": "Ausgewählte anzeigen", "visibility": "Sichtbarkeit", "visibility-dataspace": "Datenraum", @@ -2685,8 +2730,10 @@ "volume-change": "Volumenänderung", "wall-clock": "Echtzeit", "wants-to-access-your-account": "möchte auf deinen Account {{username}} zugreifen", + "warn": "Warnung", "warning": "Warnung", "warning-plural": "Warnungen", + "warning-plural-lowercase": "Warnungen", "web-analytic-entity-view-report-data": "Webanalyse-Entitätsansichtsberichtsdaten", "web-analytic-user-activity-report-data": "Webanalyse-Benutzeraktivitätsberichtsdaten", "web-analytics-report": "Webanalysenbericht", @@ -2722,6 +2769,8 @@ "workflow-plural": "Arbeitsabläufe", "worksheet": "Arbeitsblatt", "worksheet-plural": "Arbeitsblätter", + "wrap": "Umbrechen", + "wrapping-up": "wird abgeschlossen", "year": "Jahr", "yes": "Ja", "yes-comma-confirm": "Ja, bestätigen", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "Finden Sie die richtigen Datenvermögenswerte mithilfe des Syntax-Editors mit und/oder-Bedingungen.", "agent-setup-description": "Konfigurieren Sie die Kernparameter für diesen Agent.", + "agents-deploy-progress": "{{done}} fertig · {{running}} laufen · {{queued}} in Warteschlange{{failedSuffix}} — Agenten laufen nach diesem ersten Durchlauf nach ihrem Zeitplan", + "agents-deploying-ingesting": "Agenten stellen bereit & nehmen Metadaten auf", + "agents-finished-summary": "{{done}} von {{total}} Agenten abgeschlossen{{attentionSuffix}}", "aggregate-domain-type-description": "Domänen, die benutzerorientiert sind, in denen das Endprodukt aus einer Kombination von Daten verschiedener Domänen für Geschäftsanwender oder Datenbürger zur datengesteuerten Entscheidungsfindung verfügbar ist.", "airflow-guide-message": "{{brandName}} verwendet Airflow, um Ingestion Connectors auszuführen. Wir haben verwaltete APIs entwickelt, um Ingestion Connectors bereitzustellen. Verwenden Sie bitte die {{brandName}} Airflow-Instanz oder beziehen Sie sich auf die unten stehende Anleitung, um die verwalteten APIs in Ihrer Airflow-Installation zu installieren.", "airflow-host-ip-address": "{{brandName}} wird sich von der IP <0>{{hostIp}} mit Ihrer Ressource verbinden. Stellen Sie sicher, dass eingehender Datenverkehr in Ihren Netzwerksicherheitseinstellungen zugelassen ist.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Klicken Sie auf <0>{{text}}, um Details anzuzeigen.", "closed-this-task": "hat diese Aufgabe geschlossen", "collaborate-with-other-user": "um mit anderen Benutzern zusammenzuarbeiten.", + "collate-ai-agents-description": "Klassifizieren, dokumentieren und prüfen Sie Ihre Assets automatisch mit KI.", "collate-ai-widget-description": "Übersicht über die von der Collate AI für den Dienst generierten Daten. <0>Mehr erfahren.", "column-bulk-operations-description": "Verwalten und bearbeiten Sie Metadaten für mehrere Spalten gleichzeitig. Suchen, filtern und aktualisieren Sie Anzeigenamen, Beschreibungen, Tags und Glossarbegriffe in Ihren Datenbeständen.", "column-filter-help-text": "Filtern Sie die Herkunft nach Spalten-Tags oder Namen. Verwenden Sie 'tag:TagName' für Tag-Filterung oder geben Sie einfach den Spaltennamen ein.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Fehler beim Abrufen des Zugriffstokens.", "establishing-connection-ellipsis": "Verbindung wird hergestellt…", "events-matching-search-query": "Ereignisse, die der Suchanfrage entsprechen", + "everything-healthy": "alles in Ordnung", "example-value": "z.B. {{value}}", "exclude-system-entity-description": "Wenn deaktiviert, werden die standardmäßig im Schema definierten Muster für {{entity}} automatisch angewendet.", "excludes-regex-line": "schließt aus += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Macht nichts. Es ist Zeit, Ihre Ziele neu zu strukturieren und schneller voranzukommen.", "latency-sla-description": "<0>{{label}}{{data}} liegen.", "latest-offset-description": "Der neueste Offset des Ereignisses im System.", + "latest-run-lines": "Letzte Ausführung · {{count}} Zeilen", "ldap-group-dn-placeholder": "z.B. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Diese LDAP-Gruppen-DN ist bereits zugeordnet. Jede LDAP-Gruppe kann nur einmal zugeordnet werden.", "learning-resources-management-description": "Erkunden Sie Produktfunktionen und erfahren Sie, wie sie funktionieren, durch unsere Ressourcen", + "leave-page-ingestion-continues": "Sie können diese Seite verlassen — die Aufnahme wird im Hintergrund fortgesetzt", "leave-the-team-team-name": "Verlassen Sie das Team {{teamName}}", "length-validator-error": "Mindestens {{length}} {{field}} erforderlich.", "lineage-ingestion-description": "Die Verbindungsdaten-Erfassung kann konfiguriert und bereitgestellt werden, nachdem eine Metadaten-Erfassung eingerichtet wurde. Der Verbindungsdaten-Erfassungsworkflow ruft den Abfrageverlauf ab, analysiert Abfragen wie CREATE, INSERT, MERGE usw. und bereitet die Verbindung zwischen den beteiligten Entitäten vor. Die Verbindungsdaten-Erfassung kann nur eine Pipeline für einen Datenbankdienst haben. Definieren Sie die Dauer des Abfrageprotokolls (in Tagen) und die Ergebnisgrenze, um zu starten.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "Was möchten Sie heute analysieren?", "mcp-chat-placeholder": "Fragen Sie alles...", "mentioned-you-on-the-lowercase": "hat dich auf der", + "metadata-agents-description": "Extrahieren Sie Metadaten, Nutzung, Lineage und Profiling aus der Quelle.", "metadata-agents-table-description": "Metadata Agents werden verwendet, um Metadaten aus den Quellservices zu extrahieren.", "metadata-ingestion-description": "Geben Sie basierend auf dem ausgewählten Diensttyp die Filtermusterdetails für das Schema oder die Tabelle (Datenbank) oder das Thema (Messaging) oder das Dashboard ein. Sie können die Filtermuster einschließen oder ausschließen. Wählen Sie aus, ob Ansichten einbezogen werden sollen, aktivieren oder deaktivieren Sie den Datenprofiler und erfassen Sie bei Bedarf Beispieldaten.", "metadata-status-complete-description": "Metadaten sind vollständig ausgefüllt und konsistent über alle Spalten", @@ -3392,6 +3449,8 @@ "minimum-count-error": "Es müssen mindestens {{count}} {{field}} ausgewählt werden.", "minimum-value-error": "Der Minimalwert sollte kleiner als der Maximalwert sein.", "minute": "Minute", + "minutes-left": "~{{count}} Min. übrig", + "minutes-short": "{{count}} Min.", "missing-config-value": "Fehlender Konfigurationswert: {{field}}", "missing-description": "Beschreibung fehlt", "modified-time-ago-by": "Geändert vor {{time}} von {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "Keine LDAP-Rollenzuordnungen konfiguriert.", "no-learning-resources-available": "Keine Lernressourcen für diesen Kontext verfügbar.", "no-lineage-available": "Keine Lineage-Verbindungen gefunden", + "no-lines-match": "Keine Zeilen stimmen überein.", "no-match-found": "Keine Übereinstimmung gefunden", "no-mentions": "Es gibt keine Instanzen, in denen Sie oder Ihr Team in Aktivitäten erwähnt wurden", "no-native-fields": "Keine konfigurierbaren nativen Felder für diesen Entitätstyp.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Erkunden Sie die Metriken Ihrer Tabelle, indem Sie den Profiler-Workflow ausführen. Sie werden sehen: Zeilenanzahl, Tabellenaktualisierungen, Volumenänderungen und vieles mehr. Besuchen Sie unsere Dokumentation für Einrichtungsschritte ", "no-profiler-title": "Profiler ausführen, um Tabelleneinblicke freizuschalten", "no-properties-added": "No properties added.", + "no-recent-runs": "Keine letzten Ausführungen gefunden.", "no-recently-viewed-data": "Keine kürzlich angesehenen Daten.", "no-reference-available": "Keine Verweise verfügbar.", "no-related-terms-available": "Keine verwandten Begriffe verfügbar.", @@ -3638,6 +3699,7 @@ "password-error-message": "Das Passwort muss mindestens 8 und maximal 56 Zeichen lang sein und mindestens einen Großbuchstaben (A-Z), einen Kleinbuchstaben (a-z), eine Zahl und ein Sonderzeichen (z. B. !, %, @ oder #) enthalten.", "password-pattern-error": "Das Passwort muss mindestens 8 und maximal 56 Zeichen lang sein und mindestens einen Sonderbuchstaben, einen Großbuchstaben und einen Kleinbuchstaben enthalten.", "path-of-the-dbt-files-stored": "Pfad zum Ordner, in dem die dbt-Dateien gespeichert sind", + "percent-complete-all-agents": "{{percent}}% über alle Agenten abgeschlossen", "permanently-delete-common-message": "Diese {{entity}} und alle zugehörigen Metadaten dauerhaft löschen. Dies kann nicht rückgängig gemacht werden.", "permanently-delete-ingestion-pipeline": "Das dauerhafte Löschen von <0>{{entityName}} führt zum Verlust der Pipeline-Konfiguration und kann nicht wiederhergestellt werden.", "permanently-delete-metadata": "Das dauerhafte Löschen dieses <0>{{entityName}} entfernt seine Metadaten dauerhaft aus {{brandName}}.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Konfiguration zur Anpassung, wie weit wir in den Abfrageprotokollen zurückblicken möchten, um Nutzungsdaten zu verarbeiten.", "query-used-by-other-tables": "Abfrage wird von anderen Tabellen verwendet", "quick-add-tip": "Verwenden Sie Schnellhinzufügen, um Glossarbegriff-Beziehungen zu erstellen, ohne den Graphen zu verlassen.", + "ran-for-duration": "lief {{duration}} Min.", "rdf-not-enabled-for-export": "RDF muss aktiviert sein, um die Ontologie zu exportieren. Bitte aktivieren Sie RDF in Ihrer Serverkonfiguration.", "rdf-predicate-tooltip": "Der RDF-Prädikat-URI für diesen Beziehungstyp (z.B. skos:broader, skos:exactMatch).", "reacted-with-emoji": "hat mit einem {{type}} Emoji reagiert", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Daten sollten für <0>{{data}} aufbewahrt werden.", "run-sample-data-to-ingest-sample-data": "Führen Sie Musterdaten aus, um Musterdatenvermögenswerte in Ihr {{brandName}} einzufügen.", "run-status-at-timestamp": "Status: {{status}} zu {{timestamp}}", + "run-status-click-details": "{{status}} Ausführung · für Details klicken", "run-successful-test-to-continue": "Führen Sie einen erfolgreichen Test durch, um fortzufahren.", "sample-data-ingestion-config-description": "Dieses Schema definiert die Parameter, die für die Erfassung von Beispieldaten übergeben werden können.", "schedule-description": "Planen Sie die Ingestion so, dass sie zu einer bestimmten Zeit und Häufigkeit ausgeführt wird.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Zeigen Sie Suchclusterstatistiken und Indexdetails an und verwalten Sie verwaiste Indizes.", "search-settings-description": "Sucheinstellungen für jede Entität basierend auf Rankings.", "search-settings-for-entity": "Sucheinstellungen basierend auf Ranking für {{entity}}", + "seconds-left": "~{{count}}s übrig", + "seconds-short": "{{count}}s", "see-also": "Siehe auch", "see-how-to-get-started": "Sehen Sie, wie Sie loslegen können", "select-alert-type": "Bitte wählen Sie einen Alarmtyp aus", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json index 5318fffd172e..dfba4b6d1e5b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json @@ -97,6 +97,7 @@ "advanced-configuration": "Advanced Configuration", "advanced-entity": "Advanced {{entity}}", "advanced-search": "Advanced Search", + "agent": "Agent", "agent-activity": "Agent Activity", "agent-plural": "Agents", "agent-setup": "Agent Setup", @@ -189,6 +190,8 @@ "asset-plural": "Assets", "asset-plural-lowercase": "assets", "asset-type": "Asset Type", + "assets-ingested": "assets ingested", + "assets-profiled": "assets profiled", "assigned": "Assigned", "assigned-entity": "Assigned {{entity}}", "assigned-to-me": "Assigned to me", @@ -248,6 +251,7 @@ "basic-configuration": "Basic Configuration", "batch-size": "Batch Size", "bearer-hmac-signature": "Bearer (HMAC Signature)", + "before-error": "before error", "before-number-of-day-plural": "Before {{numberOfDays}} days", "belongs-to": "Belongs to", "belongs-to-database": "Belongs to database", @@ -369,6 +373,7 @@ "collapse": "Collapse", "collapse-all": "Collapse All", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Collate AI Agents", "collection": "Collection", "collection-plural": "Collections", "color": "Color", @@ -664,12 +669,14 @@ "dbt-source": "dbt Source", "dbt-source-project": "dbt Source Project", "deactivated": "Deactivated", + "debug": "Debug", "december": "December", "decision": "Decision", "default": "Default", "default-persona": "Default Persona", "default-role": "Default Role", "delete": "Delete", + "delete-agent": "Delete agent", "delete-all-nodes": "Delete All Nodes", "delete-boost": "Delete Boost", "delete-data-asset-rule": "Delete Data Asset Rule", @@ -697,6 +704,7 @@ "deployed": "Deployed", "deployed-lowercase": "deployed", "deploying-lowercase": "deploying", + "deployment-complete": "Deployment complete", "deprecate": "Deprecate", "depth": "Depth", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Details", "details": "Details", "developed-by-developer": "Developed by {{developer}}", + "diagnose": "Diagnose", "diagnostic-info": "Diagnostic Info", "did-not-run": "Didn't run", "dimension": "Dimension", @@ -784,6 +793,7 @@ "drive-plural": "Drives", "duplicate": "Duplicate", "duration": "Duration", + "duration-in-minute": "{{duration}} min", "dynamic": "Dynamic", "dynamic-assertion": "Dynamic Assertion", "edge": "Edge", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Edit & Accept Suggestion", "edit-an-announcement": "Edit an Announcement", "edit-chart-name": "Edit Chart: \"{{name}}\"", + "edit-configuration": "Edit configuration", "edit-connection": "Edit Connection", "edit-data-asset-rule": "Edit Data Asset Rule", "edit-description-for": "Edit Description for {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "Equivalence", "error": "Error", "error-plural": "Errors", + "error-plural-lowercase": "errors", "esc": "Esc", + "est-remaining": "est. remaining", "establish-connection": "Establish Connection", "evaluate": "Evaluate", "evaluate-permission": "Evaluate Permission", @@ -972,8 +985,10 @@ "factor": "Factor", "fail-on-conflict": "Fail on Conflict", "failed": "Failed", + "failed-at": "Failed at", "failed-entity": "Failed {{entity}}", "failed-event-plural": "Failed Events", + "failed-lowercase": "failed", "failed-rows": "Failed Rows", "failed-slash-aborted-reason": "Failed/Aborted Reason", "failed-to-upload-file": "Failed to upload file", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Filter Patterns", "filter-plural": "Filters", "filtered": "Filtered", + "filtered-lowercase": "filtered", "filtering-condition": "Filtering Condition", "filters-configuration": "Filters Configuration", + "finished": "Finished", + "finished-lowercase": "finished", "first": "First", "first-lowercase": "first", "first-name": "First Name", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Hide impersonation settings ({{count}})", "hide-meta-details": "Hide Meta Details", "hide-property-plural": "Hide Properties", + "hide-raw-logs": "Hide raw logs", "hierarchical": "Hierarchical", "hierarchy": "Hierarchy", "hierarchy-depth": "Hierarchy Depth", @@ -1170,6 +1189,7 @@ "homepage": "Homepage", "hour": "Hour", "hourly": "Hourly", + "how-to-fix": "How to fix", "http-config-source": "HTTP Config Source", "http-method": "HTTP Method", "hybrid-search-weight-plural": "Hybrid Search Weights", @@ -1226,6 +1246,7 @@ "index-name": "Index Name", "index-states": "Index stats", "indirect": "Indirect", + "info": "Info", "ingest-sample-data": "Ingest Sample Data", "ingestion": "Ingestion", "ingestion-lowercase": "ingestion", @@ -1297,6 +1318,7 @@ "keyword": "Keyword", "keyword-lowercase-plural": "keywords", "kill": "Kill", + "kill-run": "Kill run", "knowledge": "Knowledge", "knowledge-article-plural": "Knowledge Articles", "knowledge-center": "Knowledge Center", @@ -1508,7 +1530,9 @@ "model": "Model", "model-name": "Model Name", "model-plural": "Models", + "model-plural-lowercase": "models", "model-store": "Model Store", + "models-parsed": "models parsed", "modified-time": "Modified Time", "modifier": "Modifier", "monday": "Monday", @@ -1517,6 +1541,7 @@ "monthly": "Monthly", "more": "More", "more-action": "More Action", + "more-action-plural": "More Actions", "more-actions": "More actions", "more-help": "More Help", "more-lowercase": "more", @@ -1554,6 +1579,7 @@ "native-field-plural": "Native Fields", "navigation": "Navigation", "navigation-menu-plural": "Navigation Menus", + "need-attention": "need attention", "need-help": "Need Help", "needs-attention": "Needs Attention", "needs-review": "Needs review", @@ -1605,6 +1631,7 @@ "no-records": "No Records", "no-result-found": "No result found.", "no-reviewer": "No reviewer", + "no-status": "No status", "no-tags-added": "No Tags added", "no-tasks-yet": "No Tasks Yet", "no-tests-run": "No tests run", @@ -1741,6 +1768,7 @@ "part-of": "Part Of", "part-of-domain": "Part of domain", "partial-coverage": "Partial Coverage", + "partial-success": "Partial Success", "partition-lowercase-plural": "partitions", "partition-plural": "Partitions", "partitioned": "Partitioned", @@ -1885,12 +1913,15 @@ "public-team": "Public Team", "published": "Published", "quality": "Quality", + "queries-processed": "queries processed", + "queries-scanned": "queries scanned", "query": "Query", "query-log-duration": "Query Log Duration", "query-lowercase": "query", "query-lowercase-plural": "queries", "query-parameter-plural": "Query Params", "query-plural": "Queries", + "query-plural-lowercase": "queries", "query-used-in": "Query Used In", "queued": "Queued", "quick-add": "Quick Add", @@ -1902,11 +1933,13 @@ "range": "Range", "range-condition": "Range Condition", "raw-connection-log": "Raw Connection Log", + "raw-logs": "Raw logs", "rdf-predicate": "RDF Predicate", "rdf-store": "RDF Store", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Reassign", "re-deploy": "Re Deploy", + "re-deploy-sentence": "Re-deploy", "re-enter-new-password": "Re-enter New Password", "re-index-all": "Re-Index All", "re-index-elasticsearch": "Re-Index Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "Recent", "recent-event-plural": "Recent Events", "recent-run-plural": "Recent Runs", + "recent-runs-sentence": "Recent runs", "recent-search-term-plural": "Recent Search Terms", "recent-views": "Recent Views", "recently-created": "Recently created", @@ -1931,6 +1965,8 @@ "recently-updated": "Recently updated", "recently-viewed": "Recently Viewed", "record-plural": "Records", + "records": "records", + "records-processed": "records processed", "recreate-index-plural": "Recreate Indexes", "reference-plural": "References", "refocused-to-home": "Refocused to home", @@ -2071,6 +2107,7 @@ "run": "Run", "run-agent-plural": "Run Agents", "run-at": "Run at", + "run-history-and-details": "Run history & details", "run-in-background": "Run in background", "run-now": "Run now", "run-type": "Run Type", @@ -2138,6 +2175,7 @@ "search-index-plural": "Search Indexes", "search-index-setting-plural": "Search Index Settings", "search-insights": "Search Insights", + "search-logs": "Search logs", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Search memories by content...", @@ -2248,6 +2286,7 @@ "show-nested": "Show Nested", "show-or-hide-advanced-config": "{{showAdv}} Advanced Config", "show-or-hide-column-plural": "Show / Hide Columns", + "show-raw-logs": "Show raw logs", "showing-count-of-total-assets": "Showing {{count}} of {{total}} assets", "showing-total-failure-plural": "Total {{total}} failures", "sign-in": "Sign In", @@ -2313,6 +2352,7 @@ "started": "Started", "started-following": "Started following", "starting-offset": "Starting Offset", + "starts-after": "Starts after", "starts-with": "starts with", "state": "State", "static": "Static", @@ -2322,10 +2362,13 @@ "status-success": "Success", "stay-up-to-date": "Stay Up-to-date", "step": "Step", + "steps": "Steps", + "steps-lowercase": "steps", "steward": "Steward", "stop": "Stop", "stop-re-index-all": "Stop Re-Index", "stopped": "Stopped", + "stopped-lowercase": "stopped", "storage": "Storage", "storage-plural": "Storages", "storage-service": "Storage Service", @@ -2500,6 +2543,7 @@ "to-perform": "to perform", "to-service-name": "To Service Name", "to-service-type": "To Service Type", + "toggle-wrap": "Toggle Wrap", "token": "Token", "token-end-point": "TokenEndpoint", "token-expiration": "Token Expiration", @@ -2673,6 +2717,7 @@ "view-plural": "Views", "view-property-plural": "View Properties", "view-reindex-failure-plural": "View Reindex Failures", + "view-run-history": "View run history", "view-selected": "View Selected", "visibility": "Visibility", "visibility-dataspace": "Dataspace", @@ -2685,8 +2730,10 @@ "volume-change": "Volume Change", "wall-clock": "Wall-clock", "wants-to-access-your-account": "wants to access your {{username}} account", + "warn": "Warn", "warning": "Warning", "warning-plural": "Warnings", + "warning-plural-lowercase": "warnings", "web-analytic-entity-view-report-data": "Web Analytic Entity View Report Data", "web-analytic-user-activity-report-data": "Web Analytic User Activity Report Data", "web-analytics-report": "Web Analytics Report", @@ -2722,6 +2769,8 @@ "workflow-plural": "Workflows", "worksheet": "Worksheet", "worksheet-plural": "Worksheets", + "wrap": "Wrap", + "wrapping-up": "wrapping up", "year": "Year", "yes": "Yes", "yes-comma-confirm": "Yes, confirm", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "Discover the right data assets using the syntax editor with and/or conditions.", "agent-setup-description": "Configure the core parameters for this agent.", + "agents-deploy-progress": "{{done}} done · {{running}} running · {{queued}} queued{{failedSuffix}} — agents run on their schedule after this first pass", + "agents-deploying-ingesting": "Agents deploying & ingesting metadata", + "agents-finished-summary": "{{done}} of {{total}} agents finished{{attentionSuffix}}", "aggregate-domain-type-description": "Domains that collect and curate the data from multiple source-aligned to provide aggregated data and data products, such as Customer 360, Customers sessions, etc., for other domains to consume.", "airflow-guide-message": "{{brandName}} uses Airflow to run Ingestion Connectors. We developed Managed APIs to deploy ingestion connectors. Please use {{brandName}} Airflow instance or refer to the guide below to install the managed APIs in your Airflow installation.", "airflow-host-ip-address": "{{brandName}} will connect to your resource from the IP <0>{{hostIp}}. Make sure to allow inbound traffic in your network security settings.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Click <0>{{text}} to view details.", "closed-this-task": "closed this task", "collaborate-with-other-user": "to collaborate with other users.", + "collate-ai-agents-description": "Auto-tier, document, and quality-check your assets with AI.", "collate-ai-widget-description": "Overview of the data generated by the Collate AI for the service. <0>learn more.", "column-bulk-operations-description": "Manage and edit metadata for multiple columns at once. Search, filter, and update display names, descriptions, tags, and glossary terms across your data assets.", "column-filter-help-text": "Filter lineage by column tags or names. Use 'tag:TagName' for tag filtering or just enter the column name.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Error while fetching access token.", "establishing-connection-ellipsis": "Establishing connection…", "events-matching-search-query": "Events matching search query", + "everything-healthy": "everything healthy", "example-value": "e.g. {{value}}", "exclude-system-entity-description": "When disabled, the default schema-defined patterns for {{entity}} are automatically applied.", "excludes-regex-line": "excludes += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Notice: The Description KPI target hasn't been met yet, but there's still time – your organization has {{count}} days left. To stay on track, please enable the Data Insights Report. This will allow us to send weekly updates to all teams, fostering collaboration and focus towards achieving our organization's KPIs.", "latency-sla-description": "<0>{{label}}: Query response must be under <0>{{data}}", "latest-offset-description": "The latest offset of the event in the system.", + "latest-run-lines": "Latest run · {{count}} lines", "ldap-group-dn-placeholder": "e.g. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "This LDAP group DN is already mapped. Each LDAP group can only be mapped once.", "learning-resources-management-description": "Explore product features and learn how they work through our resources", + "leave-page-ingestion-continues": "You can leave this page — ingestion continues in the background", "leave-the-team-team-name": "Leave the team {{teamName}}", "length-validator-error": "At least {{length}} {{field}} required", "lineage-ingestion-description": "Lineage ingestion can be configured and deployed after a metadata ingestion has been set up. The lineage ingestion workflow obtains the query history, parses CREATE, INSERT, MERGE... queries and prepares the lineage between the involved entities. The lineage ingestion can have only one pipeline for a database service. Define the Query Log Duration (in days) and Result Limit to start.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "What do you want to analyze today?", "mcp-chat-placeholder": "Ask anything...", "mentioned-you-on-the-lowercase": "mentioned you on the", + "metadata-agents-description": "Extract metadata, usage, lineage and profiling from the source.", "metadata-agents-table-description": "Metadata Agents are used to extract metadata from the source services.", "metadata-ingestion-description": "Based on the service type selected, enter the filter pattern details for the schema or table (database), or topic (messaging), or dashboard. You can include or exclude the filter patterns. Choose to include views, enable or disable the data profiler, and ingest sample data, as required.", "metadata-status-complete-description": "Metadata is fully filled and consistent across all columns", @@ -3392,6 +3449,8 @@ "minimum-count-error": "At least {{count}} {{field}} must be selected.", "minimum-value-error": "The minimum value should be smaller than the maximum value.", "minute": "Minute", + "minutes-left": "~{{count}} min left", + "minutes-short": "{{count}} min", "missing-config-value": "Missing config value: {{field}}", "missing-description": "Missing Description", "modified-time-ago-by": "Modified {{time}} ago by {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "No LDAP role mappings configured.", "no-learning-resources-available": "No learning resources available for this context.", "no-lineage-available": "No lineage connections found", + "no-lines-match": "No lines match.", "no-match-found": "No match found", "no-mentions": "Looks like you and your team are all clear – no mentions in any activities just yet. Keep up the great work!", "no-native-fields": "No configurable native fields for this entity type.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Explore your table's metrics by running the profiler workflow. You'll see Row Count, Table Updates, Volume Changes, and more. Visit our documentation for setup steps ", "no-profiler-title": "Run Profiler to Unlock Table Insights", "no-properties-added": "No properties added.", + "no-recent-runs": "No recent runs found.", "no-recently-viewed-data": "You haven't viewed any data assets recently. Explore to find something interesting!", "no-reference-available": "No references available.", "no-related-terms-available": "No related terms available.", @@ -3638,6 +3699,7 @@ "password-error-message": "Password must be a minimum of 8 and a maximum of 56 characters long and contain at least one uppercase character (A-Z), one lowercase character (a-z), one number, and one special character (such as !, %, @, or #)", "password-pattern-error": "Password must be of minimum 8 and maximum 56 characters, with one special , one upper, one lower case character", "path-of-the-dbt-files-stored": "Path of the folder where the dbt files are stored", + "percent-complete-all-agents": "{{percent}}% complete across all agents", "permanently-delete-common-message": "Delete this {{entity}} and all its metadata forever. This can't be undone.", "permanently-delete-ingestion-pipeline": "Permanently deleting this <0>{{entityName}} will result in loss of pipeline configuration, and it cannot be recovered.", "permanently-delete-metadata": "Permanently deleting this <0>{{entityName}} will result in the removal of its metadata from {{brandName}}, and it cannot be recovered.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Configuration to tune how far we want to look back in query logs to process usage data.", "query-used-by-other-tables": "Query used by other tables", "quick-add-tip": "Use Quick Add to create glossary term relationships without leaving the graph.", + "ran-for-duration": "ran for {{duration}} min", "rdf-not-enabled-for-export": "RDF must be enabled to export ontology. Please enable RDF in your server configuration.", "rdf-predicate-tooltip": "The RDF predicate URI for this relation type (e.g., skos:broader, skos:exactMatch).", "reacted-with-emoji": "reacted with {{type}} emoji", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Data should be retained for <0>{{data}}", "run-sample-data-to-ingest-sample-data": "'Run sample data to ingest sample data assets into your {{brandName}}.'", "run-status-at-timestamp": "Run status: {{status}} at {{timestamp}}", + "run-status-click-details": "{{status}} run · click for details", "run-successful-test-to-continue": "Run a successful test to continue.", "sample-data-ingestion-config-description": "This schema defines the parameters that can be passed for sample data collection.", "schedule-description": "Schedule the ingestion to run at a specific time and frequency.", @@ -3740,6 +3804,8 @@ "search-insights-description": "View search cluster statistics, index details, and manage orphan indexes.", "search-settings-description": "Search settings for each entity based on rankings.", "search-settings-for-entity": "Search settings based on ranking for {{entity}}", + "seconds-left": "~{{count}}s left", + "seconds-short": "{{count}}s", "see-also": "See Also", "see-how-to-get-started": "See how to get started", "select-alert-type": "Please select a alert type", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json index f4a5bb98e860..5c700550f18d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json @@ -97,6 +97,7 @@ "advanced-configuration": "Configuración avanzada", "advanced-entity": "{{entity}} avanzado", "advanced-search": "Búsqueda avanzada", + "agent": "Agente", "agent-activity": "Actividad del agente", "agent-plural": "Agentes", "agent-setup": "Configuración del agente", @@ -189,6 +190,8 @@ "asset-plural": "Activos", "asset-plural-lowercase": "activos", "asset-type": "Tipo de Activo", + "assets-ingested": "activos ingeridos", + "assets-profiled": "activos perfilados", "assigned": "Asignado", "assigned-entity": "{{entity}} asignado", "assigned-to-me": "Asignado a mí", @@ -248,6 +251,7 @@ "basic-configuration": "Configuración básica", "batch-size": "Tamaño del lote", "bearer-hmac-signature": "Bearer (firma HMAC)", + "before-error": "antes del error", "before-number-of-day-plural": "Antes de {{numberOfDays}} días", "belongs-to": "Pertenece a", "belongs-to-database": "Pertenece a la base de datos", @@ -369,6 +373,7 @@ "collapse": "Colapsar", "collapse-all": "Contraer todo", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Agentes de IA de Collate", "collection": "Colección", "collection-plural": "Colecciones", "color": "Color", @@ -492,7 +497,7 @@ "cost-analysis": "Análisis de Coste", "count": "Conteo", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} en ejecución", "cover-image": "Cubrir", "covered": "Cubierto", "create": "Crear", @@ -664,12 +669,14 @@ "dbt-source": "Fuente de dbt", "dbt-source-project": "Proyecto Fuente dbt", "deactivated": "Desactivado", + "debug": "Depuración", "december": "Diciembre", "decision": "Decisión", "default": "Por defecto", "default-persona": "Persona por defecto", "default-role": "Rol por defecto", "delete": "Eliminar", + "delete-agent": "Eliminar agente", "delete-all-nodes": "Eliminar todos los nodos", "delete-boost": "Eliminar impulso", "delete-data-asset-rule": "Eliminar regla de activo de datos", @@ -697,6 +704,7 @@ "deployed": "Desplegado", "deployed-lowercase": "desplegado", "deploying-lowercase": "desplegando", + "deployment-complete": "Despliegue completo", "deprecate": "Deprecate", "depth": "Profundidad", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Detalles", "details": "Detalles", "developed-by-developer": "Desarrollado por {{developer}}", + "diagnose": "Diagnosticar", "diagnostic-info": "Información de diagnóstico", "did-not-run": "No se ejecutó", "dimension": "Dimensión", @@ -784,6 +793,7 @@ "drive-plural": "Unidades", "duplicate": "Duplicar", "duration": "Duración", + "duration-in-minute": "{{duration}} min", "dynamic": "Dinámico", "dynamic-assertion": "Afirmación dinámica", "edge": "Arista", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Editar y aceptar sugerencia", "edit-an-announcement": "Editar un anuncio", "edit-chart-name": "Editar gráfico: \"{{name}}\"", + "edit-configuration": "Editar configuración", "edit-connection": "Editar conexión", "edit-data-asset-rule": "Editar Regla de Activo de Datos", "edit-description-for": "Editar descripción para {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "Equivalencia", "error": "Error", "error-plural": "Errores", + "error-plural-lowercase": "errores", "esc": "Esc", + "est-remaining": "restante aprox.", "establish-connection": "Establish Connection", "evaluate": "Evaluar", "evaluate-permission": "Evaluar Permiso", @@ -972,8 +985,10 @@ "factor": "Factor", "fail-on-conflict": "Fallar en caso de conflicto", "failed": "Fallido", + "failed-at": "Falló en", "failed-entity": "{{entity}} Fallido", "failed-event-plural": "Eventos fallidos", + "failed-lowercase": "fallido", "failed-rows": "Filas fallidas", "failed-slash-aborted-reason": "Motivo de fallo/aborto", "failed-to-upload-file": "Error al subir el archivo", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Patrones de filtro", "filter-plural": "Filtros", "filtered": "Filtrado", + "filtered-lowercase": "filtrado", "filtering-condition": "Condiciones de Filtrado", "filters-configuration": "Configuración de filtros", + "finished": "Finalizado", + "finished-lowercase": "finalizado", "first": "Primero", "first-lowercase": "primero", "first-name": "Nombre", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Ocultar configuración de suplantación ({{count}})", "hide-meta-details": "Ocultar detalles meta", "hide-property-plural": "Ocultar propiedades", + "hide-raw-logs": "Ocultar registros sin procesar", "hierarchical": "Jerárquica", "hierarchy": "Jerarquía", "hierarchy-depth": "Profundidad de la jerarquía", @@ -1170,6 +1189,7 @@ "homepage": "Página de Inicio", "hour": "Hora", "hourly": "Cada hora", + "how-to-fix": "Cómo solucionarlo", "http-config-source": "Fuente de configuración HTTP", "http-method": "Método HTTP", "hybrid-search-weight-plural": "Pesos de búsqueda híbrida", @@ -1226,6 +1246,7 @@ "index-name": "Nombre del índice", "index-states": "Estados del índice", "indirect": "Indirecto", + "info": "Información", "ingest-sample-data": "Ingesta de datos de muestra", "ingestion": "Ingesta", "ingestion-lowercase": "ingesta", @@ -1297,6 +1318,7 @@ "keyword": "Palabra clave", "keyword-lowercase-plural": "palabras clave", "kill": "Eliminar", + "kill-run": "Detener ejecución", "knowledge": "Conocimiento", "knowledge-article-plural": "Artículos de conocimiento", "knowledge-center": "Centro de conocimiento", @@ -1508,7 +1530,9 @@ "model": "Modelo", "model-name": "Nombre del Modelo", "model-plural": "Modelos", + "model-plural-lowercase": "modelos", "model-store": "Almacenamiento de Modelos", + "models-parsed": "modelos analizados", "modified-time": "Hora de Modificación", "modifier": "Modificador", "monday": "Lunes", @@ -1517,6 +1541,7 @@ "monthly": "Mensual", "more": "Más", "more-action": "Más acción", + "more-action-plural": "Más acciones", "more-actions": "Más acciones", "more-help": "Más Ayuda", "more-lowercase": "más", @@ -1554,6 +1579,7 @@ "native-field-plural": "Campos nativos", "navigation": "Navegación", "navigation-menu-plural": "Menús de navegación", + "need-attention": "requieren atención", "need-help": "necesita ayuda", "needs-attention": "Necesita Atención", "needs-review": "Necesita revisión", @@ -1605,6 +1631,7 @@ "no-records": "Sin Registros", "no-result-found": "No se encontraron resultados.", "no-reviewer": "Sin revisor", + "no-status": "Sin estado", "no-tags-added": "No se añadieron etiquetas", "no-tasks-yet": "Aún no hay tareas", "no-tests-run": "Sin pruebas ejecutadas", @@ -1741,6 +1768,7 @@ "part-of": "Parte de", "part-of-domain": "Parte del dominio", "partial-coverage": "Cobertura Parcial", + "partial-success": "Éxito parcial", "partition-lowercase-plural": "particiones", "partition-plural": "Particiones", "partitioned": "Particionado", @@ -1885,12 +1913,15 @@ "public-team": "Equipo público", "published": "Publicado", "quality": "Calidad", + "queries-processed": "consultas procesadas", + "queries-scanned": "consultas escaneadas", "query": "Consulta", "query-log-duration": "Duración del registro de consultas", "query-lowercase": "consulta", "query-lowercase-plural": "consultas", "query-parameter-plural": "Parámetros de Consulta", "query-plural": "Consultas", + "query-plural-lowercase": "consultas", "query-used-in": "Consulta usada en", "queued": "En cola", "quick-add": "Añadir Rápido", @@ -1902,11 +1933,13 @@ "range": "Rango", "range-condition": "Condición de Rango", "raw-connection-log": "Raw Connection Log", + "raw-logs": "Registros sin procesar", "rdf-predicate": "Predicado RDF", "rdf-store": "Almacén RDF", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Reasignar", "re-deploy": "Volver a desplegar", + "re-deploy-sentence": "Volver a desplegar", "re-enter-new-password": "Vuelva a ingresar la nueva contraseña", "re-index-all": "Volver a indexar todo", "re-index-elasticsearch": "Volver a indexar Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "Reciente", "recent-event-plural": "Eventos recientes", "recent-run-plural": "Ejecuciones recientes", + "recent-runs-sentence": "Ejecuciones recientes", "recent-search-term-plural": "Términos de búsqueda recientes", "recent-views": "Vistas recientes", "recently-created": "Creado recientemente", @@ -1931,6 +1965,8 @@ "recently-updated": "Actualizado recientemente", "recently-viewed": "Visto recientemente", "record-plural": "Registros", + "records": "registros", + "records-processed": "registros procesados", "recreate-index-plural": "Recrear índices", "reference-plural": "Referencias", "refocused-to-home": "Reenfocado a la página principal", @@ -2071,6 +2107,7 @@ "run": "Ejecutar", "run-agent-plural": "Ejecutar Agentes", "run-at": "Ejecutar a las", + "run-history-and-details": "Historial de ejecuciones y detalles", "run-in-background": "Run in background", "run-now": "Ejecutar ahora", "run-type": "Tipo de Ejecución", @@ -2138,6 +2175,7 @@ "search-index-plural": "Índices de Búsqueda", "search-index-setting-plural": "Configuración de Índices de Búsqueda", "search-insights": "Información de búsqueda", + "search-logs": "Buscar registros", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Buscar recuerdos por contenido...", @@ -2248,6 +2286,7 @@ "show-nested": "Mostrar anidados", "show-or-hide-advanced-config": "{{showAdv}} Configuración Avanzada", "show-or-hide-column-plural": "Mostrar / Ocultar columnas", + "show-raw-logs": "Mostrar registros sin procesar", "showing-count-of-total-assets": "Mostrando {{count}} de {{total}} activos", "showing-total-failure-plural": "Total de {{total}} fallas", "sign-in": "Iniciar sesión", @@ -2313,6 +2352,7 @@ "started": "Iniciado", "started-following": "Comenzó a seguir", "starting-offset": "Desplazamiento inicial", + "starts-after": "Comienza después de", "starts-with": "empieza con", "state": "Estado", "static": "Estático", @@ -2322,10 +2362,13 @@ "status-success": "Correcto", "stay-up-to-date": "Manténgase Actualizado", "step": "Paso", + "steps": "Pasos", + "steps-lowercase": "pasos", "steward": "Steward", "stop": "Detener", "stop-re-index-all": "Parar el reindexado", "stopped": "Parado", + "stopped-lowercase": "detenido", "storage": "Almacenamiento", "storage-plural": "Almacenamientos", "storage-service": "Servicio de Almacenamiento", @@ -2500,6 +2543,7 @@ "to-perform": "para realizar", "to-service-name": "Al nombre del servicio", "to-service-type": "Al tipo de servicio", + "toggle-wrap": "Alternar ajuste de línea", "token": "Token", "token-end-point": "Terminal del Token", "token-expiration": "Expiración del Token", @@ -2673,6 +2717,7 @@ "view-plural": "Vistas", "view-property-plural": "Ver propiedades", "view-reindex-failure-plural": "Ver errores de reindexación", + "view-run-history": "Ver historial de ejecuciones", "view-selected": "Ver seleccionados", "visibility": "Visibilidad", "visibility-dataspace": "Espacio de datos", @@ -2685,8 +2730,10 @@ "volume-change": "Cambios de volumen", "wall-clock": "Tiempo real", "wants-to-access-your-account": "quiere acceder a su cuenta {{username}}", + "warn": "Advertencia", "warning": "Advertencia", "warning-plural": "Advertencias", + "warning-plural-lowercase": "advertencias", "web-analytic-entity-view-report-data": "Datos del Informe de Vista de Entidad Web Analítica", "web-analytic-user-activity-report-data": "Datos del Informe de Actividad del Usuario Web Analítica", "web-analytics-report": "Informe de análisis web", @@ -2722,6 +2769,8 @@ "workflow-plural": "Flujos de Trabajo", "worksheet": "Hoja de trabajo", "worksheet-plural": "Hojas de trabajo", + "wrap": "Ajustar línea", + "wrapping-up": "finalizando", "year": "Año", "yes": "Sí", "yes-comma-confirm": "Sí, confirmar", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "Descubre los activos de datos correctos usando el editor de sintaxis con condiciones y/o.", "agent-setup-description": "Configure los parámetros principales de este agente.", + "agents-deploy-progress": "{{done}} completados · {{running}} en ejecución · {{queued}} en cola{{failedSuffix}} — los agentes se ejecutan según su programación tras esta primera pasada", + "agents-deploying-ingesting": "Los agentes están desplegando e ingiriendo metadatos", + "agents-finished-summary": "{{done}} de {{total}} agentes finalizados{{attentionSuffix}}", "aggregate-domain-type-description": "Dominios que recopilan y curan los datos de varias fuentes alineadas para proporcionar datos agregados y productos de datos, como Customer 360, sesiones de clientes, etc., para que otros dominios los consuman.", "airflow-guide-message": "{{brandName}} utiliza Airflow para ejecutar las ingestas. Hemos desarrollado APIs para desplegar los conectores dinámicamente en Airflow. Puede utilizar la instancia de Airflow de {{brandName}} o consultar la guía de Airflow para instalar las APIs.", "airflow-host-ip-address": "{{brandName}} se conectará a su servicio desde la dirección IP <0>{{hostIp}}. Asegúrese de permitir el tráfico entrante en la configuración de seguridad de su red.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Haz clic en <0>{{text}} para ver detalles.", "closed-this-task": "cerró esta tarea", "collaborate-with-other-user": "para colaborar con otros usuarios.", + "collate-ai-agents-description": "Clasifica por niveles, documenta y verifica la calidad de tus activos con IA.", "collate-ai-widget-description": "Resumen de los datos generados por Collate AI para el servicio. <0>saber más.", "column-bulk-operations-description": "Administre y edite metadatos para varias columnas a la vez.Busque, filtre y actualice nombres para mostrar, descripciones, etiquetas y términos del glosario en sus activos de datos.", "column-filter-help-text": "Filtre el linaje por etiquetas o nombres de columnas. Use 'tag:NombreEtiqueta' para filtrar por etiqueta o simplemente ingrese el nombre de la columna.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Error al obtener el token de acceso.", "establishing-connection-ellipsis": "Estableciendo conexión…", "events-matching-search-query": "Eventos que coinciden con la consulta de búsqueda", + "everything-healthy": "todo en orden", "example-value": "p. ej. {{value}}", "exclude-system-entity-description": "Cuando está desactivado, los patrones predeterminados definidos en el esquema para {{entity}} se aplican automáticamente.", "excludes-regex-line": "excluye += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "No importa. Es hora de reestructurar tus objetivos y progresar más rápido.", "latency-sla-description": "<0>{{label}}: La respuesta a la consulta debe ser menor que <0>{{data}}.", "latest-offset-description": "El último offset del evento en el sistema.", + "latest-run-lines": "Última ejecución · {{count}} líneas", "ldap-group-dn-placeholder": "ej. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Este DN de grupo LDAP ya está mapeado. Cada grupo LDAP solo puede mapearse una vez.", "learning-resources-management-description": "Explora las funciones del producto y aprende cómo funcionan a través de nuestros recursos", + "leave-page-ingestion-continues": "Puedes salir de esta página: la ingesta continúa en segundo plano", "leave-the-team-team-name": "Abandonar el equipo {{teamName}}", "length-validator-error": "Se requiere al menos {{length}} {{field}}", "lineage-ingestion-description": "La ingesta de linaje se puede configurar y implementar después de que se haya establecido una ingesta de metadatos. El workflow de ingesta de linaje obtiene el historial de consultas, analiza las consultas CREATE, INSERT, MERGE, etc. y prepara el linaje entre las entidades involucradas. La ingesta de linaje solo puede tener un workflow para un servicio de base de datos. Defina la duración del registro de consultas (en días) y el límite de resultados para comenzar.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "¿Qué quieres analizar hoy?", "mcp-chat-placeholder": "Pregunta lo que quieras...", "mentioned-you-on-the-lowercase": "te mencionó en", + "metadata-agents-description": "Extrae metadatos, uso, linaje y perfilado desde el origen.", "metadata-agents-table-description": "Los agentes de metadatos se utilizan para extraer metadatos de los servicios de origen.", "metadata-ingestion-description": "Basado en el tipo de servicio seleccionado, ingresa los detalles del patrón de filtro para el esquema o tabla (base de datos), o tema (mensajería), o tablero. Puedes incluir o excluir los patrones de filtro. Elije incluir vistas, habilitar o deshabilitar el perfilador de datos y ingerir datos de muestra, según sea necesario.", "metadata-status-complete-description": "Los metadatos están completamente rellenados y son coherentes en todas las columnas", @@ -3392,6 +3449,8 @@ "minimum-count-error": "Se deben seleccionar al menos {{count}} {{field}}.", "minimum-value-error": "El valor mínimo debería de ser menor que el valor máximo.", "minute": "Minuto", + "minutes-left": "~{{count}} min restantes", + "minutes-short": "{{count}} min", "missing-config-value": "Falta el valor de configuración: {{field}}", "missing-description": "Falta descripción", "modified-time-ago-by": "Modificado {{time}} atrás por {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "No hay mapeos de roles LDAP configurados.", "no-learning-resources-available": "No hay recursos de aprendizaje disponibles para este contexto.", "no-lineage-available": "No se encontraron conexiones de lineage", + "no-lines-match": "No hay líneas coincidentes.", "no-match-found": "No se encontraron coincidencias", "no-mentions": "No hay instancias en las que tú o tu equipo hayan sido mencionados en ninguna actividad", "no-native-fields": "No hay campos nativos configurables para este tipo de entidad.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Explora las métricas de tu tabla ejecutando el flujo de trabajo del perfilador. Verás: Número de filas, Actualizaciones de tablas, Cambios de volumen, y más. Visita nuestra documentación para los pasos de configuración ", "no-profiler-title": "Ejecutar Profiler para desbloquear información de tablas", "no-properties-added": "No properties added.", + "no-recent-runs": "No se encontraron ejecuciones recientes.", "no-recently-viewed-data": "No hay datos vistos recientemente.", "no-reference-available": "No hay referencias disponibles.", "no-related-terms-available": "No hay términos relacionados disponibles.", @@ -3638,6 +3699,7 @@ "password-error-message": "La contraseña debe tener como mínimo 8 y como máximo 56 caracteres, con al menos una letra mayúscula, una letra minúscula, un número y un carácter especial (como !, %, @ o #)", "password-pattern-error": "La contraseña debe tener como mínimo 8 y como máximo 56 caracteres, con al menos una letra mayúscula, una letra minúscula, un número y un carácter especial (como !, %, @ o #)", "path-of-the-dbt-files-stored": "Ruta de la carpeta donde se almacenan los archivos dbt", + "percent-complete-all-agents": "{{percent}}% completado en todos los agentes", "permanently-delete-common-message": "Eliminar este {{entity}} y todos sus metadatos para siempre. Esta acción no se puede deshacer.", "permanently-delete-ingestion-pipeline": "Al eliminar permanentemente este <0>{{entityName}}, se perderá la configuración de la pipeline, y no podrá ser recuperada.", "permanently-delete-metadata": "Al eliminar permanentemente este <0>{{entityName}}, se eliminarán sus metadatos de {{brandName}} permanentemente.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Configuración para ajustar cuánto tiempo queremos retroceder en los registros de consultas para procesar datos de uso.", "query-used-by-other-tables": "Consulta utilizada por otras tablas", "quick-add-tip": "Use Añadir Rápido para crear relaciones entre términos del glosario sin salir del grafo.", + "ran-for-duration": "se ejecutó durante {{duration}} min", "rdf-not-enabled-for-export": "RDF debe estar habilitado para exportar la ontología. Por favor, habilite RDF en la configuración de su servidor.", "rdf-predicate-tooltip": "La URI del predicado RDF para este tipo de relación (por ejemplo, skos:broader, skos:exactMatch).", "reacted-with-emoji": "reaccionó con el emoji {{type}}", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Los datos deben conservarse durante <0>{{data}}.", "run-sample-data-to-ingest-sample-data": "'Ejecutar datos de muestra para ingresar activos de datos de muestra en tu {{brandName}}.'", "run-status-at-timestamp": "Estado de la ejecución: {{status}} a las {{timestamp}}", + "run-status-click-details": "Ejecución {{status}} · haz clic para ver detalles", "run-successful-test-to-continue": "Ejecuta una prueba exitosa para continuar.", "sample-data-ingestion-config-description": "Este esquema define los parámetros que se pueden pasar para la recopilación de datos de ejemplo.", "schedule-description": "Programe la ingestión a ejecutar a una hora y frecuencia específicas.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Vea estadísticas del grupo de búsqueda, detalles del índice y administre índices huérfanos.", "search-settings-description": "Configuración de búsqueda para cada entidad basada en rankings.", "search-settings-for-entity": "Configuración de búsqueda basada en ranking para {{entity}}", + "seconds-left": "~{{count}}s restantes", + "seconds-short": "{{count}}s", "see-also": "Ver También", "see-how-to-get-started": "Mira cómo empezar", "select-alert-type": "Por favor selecciona un tipo de alerta", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json index 73510190b41d..ee0d853bfead 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json @@ -97,6 +97,7 @@ "advanced-configuration": "Configuration Avancée", "advanced-entity": "{{entity}} Avancé", "advanced-search": "Recherche Avancée", + "agent": "Agent", "agent-activity": "Activité des agents", "agent-plural": "Agentes", "agent-setup": "Configuration de l'agent", @@ -189,6 +190,8 @@ "asset-plural": "Actifs", "asset-plural-lowercase": "actifs", "asset-type": "Type d'actif", + "assets-ingested": "actifs ingérés", + "assets-profiled": "actifs profilés", "assigned": "Assigné", "assigned-entity": "Assigné(e) à {{entity}}", "assigned-to-me": "Assigné(e) à moi", @@ -248,6 +251,7 @@ "basic-configuration": "Configuration de Base", "batch-size": "Taille du Lot", "bearer-hmac-signature": "Bearer (signature HMAC)", + "before-error": "avant l'erreur", "before-number-of-day-plural": "Avant {{numberOfDays}} jours", "belongs-to": "Appartient à", "belongs-to-database": "Appartient à la base de données", @@ -369,6 +373,7 @@ "collapse": "Réduire", "collapse-all": "Tout Réduire", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Agents Collate AI", "collection": "Collection", "collection-plural": "Collections", "color": "Couleur", @@ -492,7 +497,7 @@ "cost-analysis": "Analyse des Coûts", "count": "Décompte", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} en cours", "cover-image": "Couverture", "covered": "Couvert", "create": "Créer", @@ -664,12 +669,14 @@ "dbt-source": "Source dbt", "dbt-source-project": "Projet Source dbt", "deactivated": "Désactivé", + "debug": "Débogage", "december": "Décembre", "decision": "Décision", "default": "Défaut", "default-persona": "Persona par Défaut", "default-role": "Rôle par Défaut", "delete": "Supprimer", + "delete-agent": "Supprimer l'agent", "delete-all-nodes": "Supprimer tous les nœuds", "delete-boost": "Supprimer le boost", "delete-data-asset-rule": "Supprimer la Règle d'Actif de Données", @@ -697,6 +704,7 @@ "deployed": "Déployé", "deployed-lowercase": "déployé", "deploying-lowercase": "déploiement", + "deployment-complete": "Déploiement terminé", "deprecate": "Deprecate", "depth": "Profondeur", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Détails", "details": "Détails", "developed-by-developer": "Développé par {{developer}}", + "diagnose": "Diagnostiquer", "diagnostic-info": "Informations de diagnostic", "did-not-run": "Non exécuté", "dimension": "Dimension", @@ -784,6 +793,7 @@ "drive-plural": "Lecteurs", "duplicate": "Dupliquer", "duration": "Durée", + "duration-in-minute": "{{duration}} min", "dynamic": "Dynamique", "dynamic-assertion": "Assertion Dynamique", "edge": "Bord", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Éditer & Accepter la Suggestion", "edit-an-announcement": "Éditer une Annonce", "edit-chart-name": "Éditer le Graphique : \"{{name}}\"", + "edit-configuration": "Modifier la configuration", "edit-connection": "Modifier la connexion", "edit-data-asset-rule": "Modifier la Règle d'Actif de Données", "edit-description-for": "Mettre à Jour la Description de {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "Équivalence", "error": "Erreur", "error-plural": "Erreurs", + "error-plural-lowercase": "erreurs", "esc": "Esc", + "est-remaining": "restant est.", "establish-connection": "Establish Connection", "evaluate": "Évaluer", "evaluate-permission": "Évaluer la Permission", @@ -972,8 +985,10 @@ "factor": "Facteur", "fail-on-conflict": "Échouer en cas de conflit", "failed": "Échec", + "failed-at": "Échec à", "failed-entity": "{{entity}} Échoué(e)", "failed-event-plural": "Événements échoués", + "failed-lowercase": "échoué", "failed-rows": "Lignes échouées", "failed-slash-aborted-reason": "Raison de l'échec/abandon", "failed-to-upload-file": "Échec du téléchargement du fichier", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Modèles de filtre", "filter-plural": "Filtres", "filtered": "Filtré", + "filtered-lowercase": "filtré", "filtering-condition": "Condition de Filtrage", "filters-configuration": "Configuration des filtres", + "finished": "Terminé", + "finished-lowercase": "terminé", "first": "Premier", "first-lowercase": "premier", "first-name": "Prénom", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Masquer les paramètres d'usurpation d'identité ({{count}})", "hide-meta-details": "Masquer les méta-détails", "hide-property-plural": "Masquer les propriétés", + "hide-raw-logs": "Masquer les journaux bruts", "hierarchical": "Hiérarchique", "hierarchy": "Hiérarchie", "hierarchy-depth": "Profondeur de Hiérarchie", @@ -1170,6 +1189,7 @@ "homepage": "Page d'Accueil", "hour": "Heure", "hourly": "Horaire", + "how-to-fix": "Comment corriger", "http-config-source": "Source de Configuration HTTP", "http-method": "Méthode HTTP", "hybrid-search-weight-plural": "Pondérations de recherche hybride", @@ -1226,6 +1246,7 @@ "index-name": "Nom de l'index", "index-states": "États de l'Index", "indirect": "Indirecte", + "info": "Info", "ingest-sample-data": "Ingestion des Exemples de Données", "ingestion": "Ingestion", "ingestion-lowercase": "ingestion", @@ -1297,6 +1318,7 @@ "keyword": "Mot-clé", "keyword-lowercase-plural": "mots-clés", "kill": "Arrêter", + "kill-run": "Arrêter l'exécution", "knowledge": "Connaissances", "knowledge-article-plural": "Articles de la base de connaissances", "knowledge-center": "Centre de connaissances", @@ -1508,7 +1530,9 @@ "model": "Modèle", "model-name": "Nom du Modèle", "model-plural": "Modèles", + "model-plural-lowercase": "modèles", "model-store": "Magasin de Modèles", + "models-parsed": "modèles analysés", "modified-time": "Heure de Modification", "modifier": "Modificateur", "monday": "Lundi", @@ -1517,6 +1541,7 @@ "monthly": "Mensuel", "more": "Plus", "more-action": "Plus d'action", + "more-action-plural": "Plus d'actions", "more-actions": "Plus d'actions", "more-help": "Plus d'Aide", "more-lowercase": "plus", @@ -1554,6 +1579,7 @@ "native-field-plural": "Champs natifs", "navigation": "Navigation", "navigation-menu-plural": "Menus de navigation", + "need-attention": "nécessitent une attention", "need-help": "Besoin d'Aide", "needs-attention": "Nécessite une Attention", "needs-review": "Nécessite une révision", @@ -1605,6 +1631,7 @@ "no-records": "Aucun Enregistrement", "no-result-found": "Aucun résultat trouvé", "no-reviewer": "Aucun Réviseur", + "no-status": "Aucun statut", "no-tags-added": "Aucun Tag ajouté", "no-tasks-yet": "Pas encore de tâches", "no-tests-run": "Aucun test exécuté", @@ -1741,6 +1768,7 @@ "part-of": "Partie de", "part-of-domain": "Partie du domaine", "partial-coverage": "Couverture partielle", + "partial-success": "Succès partiel", "partition-lowercase-plural": "cloisons", "partition-plural": "Partitions", "partitioned": "Partitionné", @@ -1885,12 +1913,15 @@ "public-team": "Équipe Publique", "published": "Publié", "quality": "Qualité", + "queries-processed": "requêtes traitées", + "queries-scanned": "requêtes analysées", "query": "Requête", "query-log-duration": "Durée du Journal de Requête", "query-lowercase": "requête", "query-lowercase-plural": "requêtes", "query-parameter-plural": "Paramètres de Requête", "query-plural": "Requêtes", + "query-plural-lowercase": "requêtes", "query-used-in": "Requêtes Utilisées dans", "queued": "En file d'attente", "quick-add": "Ajout Rapide", @@ -1902,11 +1933,13 @@ "range": "Amplitude", "range-condition": "Condition de Plage", "raw-connection-log": "Raw Connection Log", + "raw-logs": "Journaux bruts", "rdf-predicate": "Prédicat RDF", "rdf-store": "Magasin RDF", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Réaffecter", "re-deploy": "Re-Déployer", + "re-deploy-sentence": "Redéployer", "re-enter-new-password": "Entrer le Mot de Passe à Nouveau", "re-index-all": "Tout Ré-indexer", "re-index-elasticsearch": "Re-Indexer Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "Récent", "recent-event-plural": "Événements récents", "recent-run-plural": "Exécutions Récentes", + "recent-runs-sentence": "Exécutions récentes", "recent-search-term-plural": "Termes de Recherche Récents", "recent-views": "Vues Récentes", "recently-created": "Créé récemment", @@ -1931,6 +1965,8 @@ "recently-updated": "Mis à jour récemment", "recently-viewed": "Consultés Récemment", "record-plural": "Enregistrements", + "records": "enregistrements", + "records-processed": "enregistrements traités", "recreate-index-plural": "Recréer les Indexes", "reference-plural": "Références", "refocused-to-home": "Récentré sur l'accueil", @@ -2071,6 +2107,7 @@ "run": "Exécuter", "run-agent-plural": "Exécuter les Agents", "run-at": "Exécuté à", + "run-history-and-details": "Historique & détails des exécutions", "run-in-background": "Run in background", "run-now": "Exécuter maintenant", "run-type": "Type d'Exécution", @@ -2138,6 +2175,7 @@ "search-index-plural": "Indexes de Recherche", "search-index-setting-plural": "Paramètres des Index de Recherche", "search-insights": "Statistiques de recherche", + "search-logs": "Rechercher dans les journaux", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Rechercher des souvenirs par contenu...", @@ -2248,6 +2286,7 @@ "show-nested": "Afficher imbriqué", "show-or-hide-advanced-config": "{{showAdv}} Configuration Avancée", "show-or-hide-column-plural": "Afficher / Masquer les colonnes", + "show-raw-logs": "Afficher les journaux bruts", "showing-count-of-total-assets": "Affichage de {{count}} sur {{total}} assets", "showing-total-failure-plural": "Nombre total d'échecs {{total}}", "sign-in": "Se Connecter", @@ -2313,6 +2352,7 @@ "started": "Démarré·e", "started-following": "A commencé à suivre", "starting-offset": "Décalage de départ", + "starts-after": "Démarre après", "starts-with": "commence par", "state": "État", "static": "Statique", @@ -2322,10 +2362,13 @@ "status-success": "Réussi", "stay-up-to-date": "Rester à Jour", "step": "Étape", + "steps": "Étapes", + "steps-lowercase": "étapes", "steward": "Steward", "stop": "Arrêter", "stop-re-index-all": "Arrêter la Ré-indexation de Tout", "stopped": "Arrêté", + "stopped-lowercase": "arrêté", "storage": "Stockage", "storage-plural": "Stockages", "storage-service": "Service de Stockage", @@ -2500,6 +2543,7 @@ "to-perform": "à effectuer", "to-service-name": "À Service Name", "to-service-type": "À Service Type", + "toggle-wrap": "Basculer le retour à la ligne", "token": "Token", "token-end-point": "Point de Terminaison du Jeton", "token-expiration": "Expiration du Jeton", @@ -2673,6 +2717,7 @@ "view-plural": "Vues", "view-property-plural": "Voir les propriétés", "view-reindex-failure-plural": "Afficher les échecs de réindexation", + "view-run-history": "Voir l'historique des exécutions", "view-selected": "Afficher la sélection", "visibility": "Visibilité", "visibility-dataspace": "Espace de données", @@ -2685,8 +2730,10 @@ "volume-change": "Changement de Volume", "wall-clock": "Temps réel", "wants-to-access-your-account": "souhaite accéder à votre compte {{username}}", + "warn": "Avertissement", "warning": "Attention", "warning-plural": "Avertissements", + "warning-plural-lowercase": "avertissements", "web-analytic-entity-view-report-data": "Données de Rapport de Vue d'Entité Web Analytique", "web-analytic-user-activity-report-data": "Données de Rapport d'Activité Utilisateur Web Analytique", "web-analytics-report": "Rapport d'Analyse Web", @@ -2722,6 +2769,8 @@ "workflow-plural": "Flux de travail", "worksheet": "Feuille de travail", "worksheet-plural": "Feuilles de travail", + "wrap": "Retour à la ligne", + "wrapping-up": "finalisation", "year": "Année", "yes": "Oui", "yes-comma-confirm": "Oui, confirmer", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "Découvrez les bonnes données à l'aide de l'éditeur de syntaxe avec des conditions et/ou.", "agent-setup-description": "Configurez les paramètres principaux de cet agent.", + "agents-deploy-progress": "{{done}} terminé(s) · {{running}} en cours · {{queued}} en file d'attente{{failedSuffix}} — les agents s'exécutent selon leur planification après ce premier passage", + "agents-deploying-ingesting": "Les agents déploient et ingèrent les métadonnées", + "agents-finished-summary": "{{done}} agents sur {{total}} terminés{{attentionSuffix}}", "aggregate-domain-type-description": "Domaines collectant et utilisant les données de multiples sources pour fournir de la donnée aggrégée et des data products, comme une vision Client 360, des sessions utilisateurs, etc., afin d'être consommés par d'autres domaines.", "airflow-guide-message": "{{brandName}} utilise Airflow pour exécuter les connecteurs d'ingestion. Nous avons développé des API gérées pour déployer les connecteurs d'ingestion. Veuillez utiliser l'instance Airflow {{brandName}} ou vous référer au guide ci-dessous pour installer les API gérées dans votre installation Airflow.", "airflow-host-ip-address": "{{brandName}} utilisera l'adresse IP <0>{{hostIp}} pour se connecter à votre ressource. Assurez-vous d'autoriser le trafic entrant dans les paramètres de sécurité de votre réseau.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Cliquez sur <0>{{text}} pour voir les détails.", "closed-this-task": "fermer cette tâche", "collaborate-with-other-user": "pour collaborer avec d'autres utilisateurs.", + "collate-ai-agents-description": "Classez, documentez et vérifiez la qualité de vos actifs automatiquement grâce à l'IA.", "collate-ai-widget-description": "Aperçu des données générées par Collate AI pour le service. <0>en savoir plus.", "column-bulk-operations-description": "Gérez et modifiez les métadonnées de plusieurs colonnes à la fois.Recherchez, filtrez et mettez à jour les noms d'affichage, les descriptions, les balises et les termes du glossaire dans vos actifs de données.", "column-filter-help-text": "Filtrez le lignage par étiquettes ou noms de colonnes. Utilisez 'tag:NomÉtiquette' pour filtrer par étiquette ou entrez simplement le nom de la colonne.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Erreur pendant la récupération du jeton d'accès.", "establishing-connection-ellipsis": "Établissement de la connexion…", "events-matching-search-query": "Événements correspondant à la requête de recherche", + "everything-healthy": "tout est sain", "example-value": "ex. {{value}}", "exclude-system-entity-description": "Lorsqu'il est désactivé, les modèles par défaut définis dans le schéma pour {{entity}} sont appliqués automatiquement.", "excludes-regex-line": "exclut += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Dommage. Vous devriez peut-être réévaluer vos objectifs pour continuer votre progression.", "latency-sla-description": "<0>{{label}} : le temps de réponse de la requête doit être inférieur à <0>{{data}}.", "latest-offset-description": "Le dernier décalage de l'événement dans le système.", + "latest-run-lines": "Dernière exécution · {{count}} lignes", "ldap-group-dn-placeholder": "p.ex. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Ce DN de groupe LDAP est déjà mappé. Chaque groupe LDAP ne peut être mappé qu'une seule fois.", "learning-resources-management-description": "Explorez les fonctionnalités du produit et découvrez comment elles fonctionnent grâce à nos ressources", + "leave-page-ingestion-continues": "Vous pouvez quitter cette page — l'ingestion se poursuit en arrière-plan", "leave-the-team-team-name": "Quitter l'équipe {{teamName}}", "length-validator-error": "Au moins {{length}} {{field}} requis", "lineage-ingestion-description": "Traçabilité de l'ingestion peut être configurée et déployée après une ingestion de métadonnées a été mis en place. Le flux de travail d'ingestion de la lignée obtient l'historique des requêtes, analyse CREATE, INSERT, MERGE... requêtes et prépare la lignée entre les entités impliquées. L'ingestion de la lignée peut avoir un seul pipeline pour un service de base de données. Définir la durée du journal de requêtes (en jours) et le nombre de résultats pour démarrer.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "Que voulez-vous analyser aujourd'hui ?", "mcp-chat-placeholder": "Posez n'importe quelle question...", "mentioned-you-on-the-lowercase": "vous a mentionné dans", + "metadata-agents-description": "Extrayez les métadonnées, l'utilisation, le lignage et le profilage depuis la source.", "metadata-agents-table-description": "Les agents de métadonnées sont utilisés pour extraire les métadonnées des services sources.", "metadata-ingestion-description": "Selon le type de service sélectionné, saisissez les détails du modèle de filtre pour le schéma ou la table (base de données), ou le sujet (messagerie), ou le tableau de bord. Vous pouvez inclure ou exclure des modèles de filtre. Choisissez d'inclure des vues, activez ou désactivez le profilage des données, et ingérez des données d'exemple, si nécessaire.", "metadata-status-complete-description": "Les métadonnées sont entièrement renseignées et cohérentes entre toutes les colonnes", @@ -3392,6 +3449,8 @@ "minimum-count-error": "Au moins {{count}} {{field}} doit être sélectionné.", "minimum-value-error": "La vleur minimum value doit être plus petite que la valeur maximum.", "minute": "Minute", + "minutes-left": "~{{count}} min restantes", + "minutes-short": "{{count}} min", "missing-config-value": "Valeur de configuration manquante : {{field}}", "missing-description": "Description manquante", "modified-time-ago-by": "Modifié {{time}} par {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "Aucun mappage de rôle LDAP configuré.", "no-learning-resources-available": "Aucune ressource d'apprentissage disponible pour ce contexte.", "no-lineage-available": "Aucune connexion de lineage trouvée", + "no-lines-match": "Aucune ligne ne correspond.", "no-match-found": "Aucune correspondance trouvée", "no-mentions": "Il n'y a aucune instance où vous ou votre équipe avez été mentionnés dans des activités", "no-native-fields": "Aucun champ natif configurable pour ce type d'entité.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Explorez les métriques de votre table en exécutant le workflow de profilage. Vous verrez: Nombre de lignes, Mises à jour de tables, Changements de volume, et plus encore. Visitez notre documentation pour les étapes de configuration ", "no-profiler-title": "Exécuter le Profiler pour déverrouiller les informations de table", "no-properties-added": "No properties added.", + "no-recent-runs": "Aucune exécution récente trouvée.", "no-recently-viewed-data": "Aucune donnée récemment consultée.", "no-reference-available": "Aucune référence disponible.", "no-related-terms-available": "Aucun terme associé disponible.", @@ -3638,6 +3699,7 @@ "password-error-message": "Le mot de passe doit comporter au moins 8 caractères et au plus 56 caractères et doit contenir au moins une lettre majuscule (A-Z), une lettre minuscule (a-z), un chiffre et un caractère spécial (tel que !, %, @ ou #).", "password-pattern-error": "Le mot de passe doit comporter au moins 8 caractères et au plus 56 caractères, avec un caractère spécial, une lettre majuscule et une lettre minuscule.", "path-of-the-dbt-files-stored": "Chemin du dossier où sont situés les fichiers dbt.", + "percent-complete-all-agents": "{{percent}}% terminé sur l'ensemble des agents", "permanently-delete-common-message": "Supprimer définitivement ce {{entity}} et toutes ses métadonnées. Cette action est irréversible.", "permanently-delete-ingestion-pipeline": "La suppression définitive de <0>{{entityName}} entraînera la perte de la configuration du pipeline et ne pourra pas être récupérée.", "permanently-delete-metadata": "La suppression permanente de cette <0>{{entityName}} supprimera ses métadonnées de façon permanente d'{{brandName}}.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Configuration pour régler la profondeur de la recherche dans les journaux de requête pour traiter les données d'utilisation.", "query-used-by-other-tables": "Requête utilisée par d'autres tables", "quick-add-tip": "Utilisez l'Ajout Rapide pour créer des relations entre termes de glossaire sans quitter le graphe.", + "ran-for-duration": "exécuté pendant {{duration}} min", "rdf-not-enabled-for-export": "RDF doit être activé pour exporter l'ontologie. Veuillez activer RDF dans la configuration de votre serveur.", "rdf-predicate-tooltip": "L'URI du prédicat RDF pour ce type de relation (par ex., skos:broader, skos:exactMatch).", "reacted-with-emoji": "a réagi avec l'emoji {{type}}", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}} : les données doivent être conservées pendant <0>{{data}}.", "run-sample-data-to-ingest-sample-data": "Exécuter l'ingestion de données d'exemple dans {{brandName}}", "run-status-at-timestamp": "Etat du lancement: {{status}} à {{timestamp}}", + "run-status-click-details": "Exécution {{status}} · cliquez pour les détails", "run-successful-test-to-continue": "Exécutez un test réussi pour continuer.", "sample-data-ingestion-config-description": "Ce schéma définit les paramètres pouvant être transmis pour la collecte de données d'exemple.", "schedule-description": "Planifiez l'ingestion pour qu'elle s'exécute à une heure et une fréquence spécifiques.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Affichez les statistiques du cluster de recherche, les détails de l'index et gérez les index orphelins.", "search-settings-description": "Paramètres de recherche pour chaque entité basés sur les classements.", "search-settings-for-entity": "Paramètres de recherche basés sur le classement pour {{entity}}", + "seconds-left": "~{{count}}s restantes", + "seconds-short": "{{count}}s", "see-also": "Voir Aussi", "see-how-to-get-started": "Voir comment commencer", "select-alert-type": "Sélectionner un type d'alerte", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json index 84325000b0fb..09b9936801f6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json @@ -97,6 +97,7 @@ "advanced-configuration": "Configuración avanzada", "advanced-entity": "Avanzado {{entity}}", "advanced-search": "Busca avanzada", + "agent": "Axente", "agent-activity": "Actividade do axente", "agent-plural": "Agentes", "agent-setup": "Configuración do axente", @@ -189,6 +190,8 @@ "asset-plural": "Activos", "asset-plural-lowercase": "activos", "asset-type": "Tipo de activo", + "assets-ingested": "activos inxeridos", + "assets-profiled": "activos perfilados", "assigned": "Asignado", "assigned-entity": "{{entity}} asignado", "assigned-to-me": "Asignado a min", @@ -248,6 +251,7 @@ "basic-configuration": "Configuración básica", "batch-size": "Tamaño do lote", "bearer-hmac-signature": "Bearer (sinatura HMAC)", + "before-error": "antes do erro", "before-number-of-day-plural": "Antes de {{numberOfDays}} días", "belongs-to": "Pertence a", "belongs-to-database": "Pertence á base de datos", @@ -369,6 +373,7 @@ "collapse": "Colapsar", "collapse-all": "Colapsar todo", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Axentes de Collate AI", "collection": "Colección", "collection-plural": "Coleccións", "color": "Cor", @@ -492,7 +497,7 @@ "cost-analysis": "Análise de custos", "count": "Contar", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} en execución", "cover-image": "Portada", "covered": "Cuberto", "create": "Crear", @@ -664,12 +669,14 @@ "dbt-source": "Fonte dbt", "dbt-source-project": "Proxecto Fonte dbt", "deactivated": "Desactivado", + "debug": "Depuración", "december": "Decembro", "decision": "Decisión", "default": "Predeterminado", "default-persona": "Persoa predeterminada", "default-role": "Rol Predeterminado", "delete": "Eliminar", + "delete-agent": "Eliminar axente", "delete-all-nodes": "Eliminar todos os nodos", "delete-boost": "Eliminar impulso", "delete-data-asset-rule": "Eliminar Regra de Activo de Datos", @@ -697,6 +704,7 @@ "deployed": "Despregado", "deployed-lowercase": "despregado", "deploying-lowercase": "despregando", + "deployment-complete": "Despregamento completado", "deprecate": "Deprecate", "depth": "Profundidade", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Detalles", "details": "Detalles", "developed-by-developer": "Desenvolvido por {{developer}}", + "diagnose": "Diagnosticar", "diagnostic-info": "Información de diagnóstico", "did-not-run": "Non se executou", "dimension": "Dimensión", @@ -784,6 +793,7 @@ "drive-plural": "Unidades", "duplicate": "Duplicar", "duration": "Duración", + "duration-in-minute": "{{duration}} min", "dynamic": "Dinámico", "dynamic-assertion": "Aserción dinámica", "edge": "Borde", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Editar e aceptar suxestión", "edit-an-announcement": "Editar un anuncio", "edit-chart-name": "Editar gráfico: \"{{name}}\"", + "edit-configuration": "Editar configuración", "edit-connection": "Editar conexión", "edit-data-asset-rule": "Editar Regra de Activo de Datos", "edit-description-for": "Editar descrición para {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "Equivalencia", "error": "Erro", "error-plural": "Erros", + "error-plural-lowercase": "erros", "esc": "Esc", + "est-remaining": "est. restante", "establish-connection": "Establecer conexión", "evaluate": "Avaliar", "evaluate-permission": "Avaliar Permiso", @@ -972,8 +985,10 @@ "factor": "Factor", "fail-on-conflict": "Falar en caso de conflito", "failed": "Fallado", + "failed-at": "Fallou en", "failed-entity": "Fallado {{entity}}", "failed-event-plural": "Eventos fallidos", + "failed-lowercase": "fallou", "failed-rows": "Filas fallidas", "failed-slash-aborted-reason": "Motivo do fallo/aborto", "failed-to-upload-file": "Fallou ao subir o ficheiro", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Patróns de filtro", "filter-plural": "Filtros", "filtered": "Filtrado", + "filtered-lowercase": "filtrado", "filtering-condition": "Condición de filtrado", "filters-configuration": "Configuración de filtros", + "finished": "Rematado", + "finished-lowercase": "rematado", "first": "Primeiro", "first-lowercase": "primeiro", "first-name": "Nome", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Ocultar configuración de suplantación ({{count}})", "hide-meta-details": "Ocultar detalles meta", "hide-property-plural": "Ocultar propiedades", + "hide-raw-logs": "Ocultar rexistros en bruto", "hierarchical": "Xerárquico", "hierarchy": "Xerarquía", "hierarchy-depth": "Profundidade da xerarquía", @@ -1170,6 +1189,7 @@ "homepage": "Páxina de inicio", "hour": "Hora", "hourly": "Cada hora", + "how-to-fix": "Como corrixir", "http-config-source": "Fonte de configuración HTTP", "http-method": "Método HTTP", "hybrid-search-weight-plural": "Pesos de busca híbrida", @@ -1226,6 +1246,7 @@ "index-name": "Nome do índice", "index-states": "Estatísticas de índices", "indirect": "Indirecto", + "info": "Información", "ingest-sample-data": "Inxerir datos de mostra", "ingestion": "Inxestión", "ingestion-lowercase": "inxestión", @@ -1297,6 +1318,7 @@ "keyword": "Palabra clave", "keyword-lowercase-plural": "palabras clave", "kill": "Matar", + "kill-run": "Deter execución", "knowledge": "Coñecemento", "knowledge-article-plural": "Artigos de coñecemento", "knowledge-center": "Centro de coñecemento", @@ -1508,7 +1530,9 @@ "model": "Modelo", "model-name": "Nome do modelo", "model-plural": "Modelos", + "model-plural-lowercase": "modelos", "model-store": "Tenda de modelos", + "models-parsed": "modelos analizados", "modified-time": "Hora de Modificación", "modifier": "Modificador", "monday": "Luns", @@ -1517,6 +1541,7 @@ "monthly": "Mensual", "more": "Máis", "more-action": "Máis accións", + "more-action-plural": "Máis accións", "more-actions": "Máis accións", "more-help": "Máis axuda", "more-lowercase": "máis", @@ -1554,6 +1579,7 @@ "native-field-plural": "Campos nativos", "navigation": "Navegação", "navigation-menu-plural": "Menús de navegación", + "need-attention": "requiren atención", "need-help": "Necesitas axuda", "needs-attention": "Require Atención", "needs-review": "Necesita revisión", @@ -1605,6 +1631,7 @@ "no-records": "Sen rexistros", "no-result-found": "Non se atoparon resultados.", "no-reviewer": "Sen revisor", + "no-status": "Sen estado", "no-tags-added": "Non se engadiron etiquetas", "no-tasks-yet": "Aínda non hai tarefas", "no-tests-run": "Non se executou ningunha proba", @@ -1741,6 +1768,7 @@ "part-of": "Parte de", "part-of-domain": "Parte do dominio", "partial-coverage": "Cobertura parcial", + "partial-success": "Éxito parcial", "partition-lowercase-plural": "particións", "partition-plural": "Particións", "partitioned": "Particionado", @@ -1885,12 +1913,15 @@ "public-team": "Equipo público", "published": "Publicado", "quality": "Calidade", + "queries-processed": "consultas procesadas", + "queries-scanned": "consultas escaneadas", "query": "Consulta", "query-log-duration": "Duración do rexistro da consulta", "query-lowercase": "consulta", "query-lowercase-plural": "consultas", "query-parameter-plural": "Parámetros de Consulta", "query-plural": "Consultas", + "query-plural-lowercase": "consultas", "query-used-in": "Consulta utilizada en", "queued": "En cola", "quick-add": "Engadir Rápido", @@ -1902,11 +1933,13 @@ "range": "Intervalo", "range-condition": "Condición de Rango", "raw-connection-log": "Raw Connection Log", + "raw-logs": "Rexistros en bruto", "rdf-predicate": "Predicado RDF", "rdf-store": "Almacén RDF", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Reasignar", "re-deploy": "Redeployer", + "re-deploy-sentence": "Volver despregar", "re-enter-new-password": "Introduce de novo o novo contrasinal", "re-index-all": "Reindexar todo", "re-index-elasticsearch": "Reindexar Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "Recente", "recent-event-plural": "Eventos Recentes", "recent-run-plural": "Execucións recentes", + "recent-runs-sentence": "Execucións recentes", "recent-search-term-plural": "Termos de busca recentes", "recent-views": "Visualizações recentes", "recently-created": "Creado recentemente", @@ -1931,6 +1965,8 @@ "recently-updated": "Actualizado recentemente", "recently-viewed": "Visto recentemente", "record-plural": "Rexistros", + "records": "rexistros", + "records-processed": "rexistros procesados", "recreate-index-plural": "Recrear índices", "reference-plural": "Referencias", "refocused-to-home": "Reenfocado á páxina de inicio", @@ -2071,6 +2107,7 @@ "run": "Executar", "run-agent-plural": "Executar Agentes", "run-at": "Executar ás", + "run-history-and-details": "Historial e detalles das execucións", "run-in-background": "Run in background", "run-now": "Executar agora", "run-type": "Tipo de execución", @@ -2138,6 +2175,7 @@ "search-index-plural": "Índices de busca", "search-index-setting-plural": "Axustes do índice de busca", "search-insights": "Insights de busca", + "search-logs": "Buscar rexistros", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Buscar recordos por contido...", @@ -2248,6 +2286,7 @@ "show-nested": "Mostrar aniñados", "show-or-hide-advanced-config": "{{showAdv}} Configuración avanzada", "show-or-hide-column-plural": "Mostrar / Ocultar columnas", + "show-raw-logs": "Mostrar rexistros en bruto", "showing-count-of-total-assets": "Mostrando {{count}} de {{total}} activos", "showing-total-failure-plural": "Total {{total}} erros", "sign-in": "Iniciar sesión", @@ -2313,6 +2352,7 @@ "started": "Iniciado", "started-following": "Comezou a seguir", "starting-offset": "Desprazamento inicial", + "starts-after": "Comeza despois de", "starts-with": "comeza por", "state": "Estado", "static": "Estático", @@ -2322,10 +2362,13 @@ "status-success": "Correcto", "stay-up-to-date": "Mantente ao día", "step": "Paso", + "steps": "Pasos", + "steps-lowercase": "pasos", "steward": "Steward", "stop": "Parar", "stop-re-index-all": "Deteñer reindexación", "stopped": "Detido", + "stopped-lowercase": "detido", "storage": "Almacenamento", "storage-plural": "Almacenamentos", "storage-service": "Servizo de Almacenamento", @@ -2500,6 +2543,7 @@ "to-perform": "a realizar", "to-service-name": "A Service Name", "to-service-type": "A Service Type", + "toggle-wrap": "Alternar axuste de liña", "token": "Token", "token-end-point": "Punto final do token", "token-expiration": "Caducidade do token", @@ -2673,6 +2717,7 @@ "view-plural": "Vistas", "view-property-plural": "Ver propiedades", "view-reindex-failure-plural": "Ver erros de reindexación", + "view-run-history": "Ver historial de execucións", "view-selected": "Ver seleccionado", "visibility": "Visibilidade", "visibility-dataspace": "Espazo de datos", @@ -2685,8 +2730,10 @@ "volume-change": "Cambio de volume", "wall-clock": "Tempo real", "wants-to-access-your-account": "quere acceder á túa conta de {{username}}", + "warn": "Aviso", "warning": "Advertencia", "warning-plural": "Advertencias", + "warning-plural-lowercase": "avisos", "web-analytic-entity-view-report-data": "Datos do Informe de Vista de Entidade Web Analítica", "web-analytic-user-activity-report-data": "Datos do Informe de Actividade do Usuario Web Analítica", "web-analytics-report": "Informe de analítica web", @@ -2722,6 +2769,8 @@ "workflow-plural": "Fluxos de traballo", "worksheet": "Folla de traballo", "worksheet-plural": "Follas de traballo", + "wrap": "Axustar liña", + "wrapping-up": "finalizando", "year": "Ano", "yes": "Si", "yes-comma-confirm": "Si, confirmar", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "Descubre os activos de datos axeitados usando o editor de sintaxe con condicións 'e/ou'.", "agent-setup-description": "Configure os parámetros principais deste axente.", + "agents-deploy-progress": "{{done}} rematados · {{running}} en execución · {{queued}} en cola{{failedSuffix}} — os axentes execútanse segundo a súa planificación despois desta primeira pasada", + "agents-deploying-ingesting": "Os axentes están despregando e inxerindo metadatos", + "agents-finished-summary": "{{done}} de {{total}} axentes rematados{{attentionSuffix}}", "aggregate-domain-type-description": "Dominios que recollen e organizan os datos de múltiples fontes para proporcionar datos agregados e produtos de datos, como Customer 360, sesións de clientes, etc., para que outros dominios os consuman.", "airflow-guide-message": "{{brandName}} usa Airflow para executar conectores de inxestión. Desenvolvemos APIs xestionadas para despregar conectores de inxestión. Por favor, usa a instancia de Airflow de {{brandName}} ou consulta a guía a continuación para instalar as APIs xestionadas na túa instalación de Airflow.", "airflow-host-ip-address": "{{brandName}} conectará co teu recurso desde o IP <0>{{hostIp}}. Asegúrate de permitir o tráfico entrante na configuración de seguridade da túa rede.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Fai clic en <0>{{text}} para ver os detalles.", "closed-this-task": "pechou esta tarefa", "collaborate-with-other-user": "para colaborar con outros usuarios.", + "collate-ai-agents-description": "Clasifica, documenta e comproba a calidade dos teus activos automaticamente con IA.", "collate-ai-widget-description": "Visión xeral dos datos xerados por Collate AI para o servizo. <0>saber máis.", "column-bulk-operations-description": "Xestiona e edita metadatos para varias columnas á vez. Busca, filtra e actualiza nomes de visualización, descricións, etiquetas e termos do glosario nos teus activos de datos.", "column-filter-help-text": "Filtre a liñaxe por etiquetas ou nomes de columnas. Use 'tag:NomeEtiqueta' para filtrar por etiqueta ou simplemente introduza o nome da columna.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Erro ao obter o token de acceso.", "establishing-connection-ellipsis": "Establecendo conexión…", "events-matching-search-query": "Eventos que coinciden coa consulta de busca", + "everything-healthy": "todo correcto", "example-value": "p. ex. {{value}}", "exclude-system-entity-description": "Cando está desactivado, os patróns predeterminados definidos no esquema para {{entity}} aplícanse automaticamente.", "excludes-regex-line": "exclúe += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Aviso: O obxectivo KPI de Descrición aínda non se alcanzou, pero aínda hai tempo: á túa organización quédanlle {{count}} días. Para manter o rumbo, habilita o Informe de Insights de Datos. Isto permitirá enviar actualizacións semanais a todos os equipos, fomentando a colaboración e o enfoque cara a alcanzar os KPI da nosa organización.", "latency-sla-description": "<0>{{label}}: A resposta á consulta debe ser inferior a <0>{{data}}.", "latest-offset-description": "O último desprazamento do evento no sistema.", + "latest-run-lines": "Última execución · {{count}} liñas", "ldap-group-dn-placeholder": "p.ex. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Este DN de grupo LDAP xa está mapeado. Cada grupo LDAP só pode mapearse unha vez.", "learning-resources-management-description": "Explora as funcións do produto e aprende como funcionan a través dos nosos recursos", + "leave-page-ingestion-continues": "Podes saír desta páxina — a inxestión continúa en segundo plano", "leave-the-team-team-name": "Abandonar o equipo {{teamName}}", "length-validator-error": "Requírese polo menos {{length}} {{field}}", "lineage-ingestion-description": "A inxestión de liñaxe pódese configurar e despregar despois de configurar a inxestión de metadatos. O fluxo de traballo de inxestión de liñaxe obtén o historial de consultas, analiza consultas CREATE, INSERT, MERGE... e prepara a liñaxe entre as entidades implicadas. A inxestión de liñaxe só pode ter un pipeline para un servizo de base de datos. Define a Duración do Rexistro de Consultas (en días) e o Límite de Resultados para comezar.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "Que queres analizar hoxe?", "mcp-chat-placeholder": "Pregunta o que queiras...", "mentioned-you-on-the-lowercase": "mencionoute en", + "metadata-agents-description": "Extrae metadatos, uso, liñaxe e perfilado da orixe.", "metadata-agents-table-description": "Os agentes de metadatos se utilizan para extraer metadatos dos servicios de origen.", "metadata-ingestion-description": "Baseándose no tipo de servizo seleccionado, introduce os detalles do patrón de filtro para o esquema ou táboa (base de datos), ou tema (mensaxería), ou panel. Podes incluír ou excluír os patróns de filtro. Escolle incluír vistas, activar ou desactivar o perfilador de datos e inxerir datos de mostra, segundo sexa necesario.", "metadata-status-complete-description": "Os metadatos están completamente cubertos e consistentes en todas as columnas", @@ -3392,6 +3449,8 @@ "minimum-count-error": "Polo menos {{count}} {{field}} debe ser seleccionado.", "minimum-value-error": "O valor mínimo debe ser menor que o valor máximo.", "minute": "Minuto", + "minutes-left": "~{{count}} min restantes", + "minutes-short": "{{count}} min", "missing-config-value": "Falta o valor de configuración: {{field}}", "missing-description": "Descrición faltante", "modified-time-ago-by": "Modificado {{time}} por {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "Non hai asignacións de roles LDAP configuradas.", "no-learning-resources-available": "Non hai recursos de aprendizaxe dispoñibles para este contexto.", "no-lineage-available": "Non se atoparon conexións de lineage", + "no-lines-match": "Ningunha liña coincide.", "no-match-found": "Non se atopou ningunha coincidencia", "no-mentions": "Parece que ti e o teu equipo estades ao día: non hai mencións en ningunha actividade por agora. Seguídeo así!", "no-native-fields": "Non hai campos nativos configurables para este tipo de entidade.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Explora as métricas da túa táboa executando o flujo de traballo do perfilador. Verás: Número de filas, Actualizacións de táboas, Cambios de volume, e máis. Visita a nosa documentación para os pasos de configuración ", "no-profiler-title": "Executar Profiler para desbloquear información das táboas", "no-properties-added": "No properties added.", + "no-recent-runs": "Non se atoparon execucións recentes.", "no-recently-viewed-data": "Aínda non visualizaches ningún activo de datos recentemente. Explora para atopar algo interesante!", "no-reference-available": "Non hai referencias dispoñibles.", "no-related-terms-available": "Non hai termos relacionados dispoñibles.", @@ -3638,6 +3699,7 @@ "password-error-message": "O contrasinal debe ter un mínimo de 8 e un máximo de 56 caracteres e conter polo menos unha maiúscula (A-Z), unha minúscula (a-z), un número e un carácter especial (como !, %, @ ou #)", "password-pattern-error": "O contrasinal debe ter un mínimo de 8 e un máximo de 56 caracteres, cun carácter especial, unha maiúscula e unha minúscula", "path-of-the-dbt-files-stored": "Ruta do cartafol onde se almacenan os ficheiros dbt", + "percent-complete-all-agents": "{{percent}}% completado en todos os axentes", "permanently-delete-common-message": "Eliminar este {{entity}} e todos os seus metadatos para sempre. Esta acción non se pode desfacer.", "permanently-delete-ingestion-pipeline": "A eliminación permanente deste <0>{{entityName}} provocará a perda da configuración da canalización e non se poderá recuperar.", "permanently-delete-metadata": "Eliminar permanentemente este <0>{{entityName}} eliminará os seus metadatos de {{brandName}} e non poderá recuperarse.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Configuración para axustar canto tempo queremos retroceder nos rexistros de consultas para procesar os datos de uso.", "query-used-by-other-tables": "Consulta usada por outras táboas", "quick-add-tip": "Use Engadir Rápido para crear relacións entre termos do glosario sen saír do grafo.", + "ran-for-duration": "executouse durante {{duration}} min", "rdf-not-enabled-for-export": "RDF debe estar activado para exportar a ontoloxía. Por favor, active RDF na configuración do seu servidor.", "rdf-predicate-tooltip": "O URI do predicado RDF para este tipo de relación (ex: skos:broader, skos:exactMatch).", "reacted-with-emoji": "reaccionou cun emoji {{type}}", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Os datos deben conservarse por <0>{{data}}.", "run-sample-data-to-ingest-sample-data": "'Executa datos de mostra para inxerir activos de datos de mostra no teu {{brandName}}.'", "run-status-at-timestamp": "Estado de execución: {{status}} ás {{timestamp}}", + "run-status-click-details": "Execución {{status}} · fai clic para ver os detalles", "run-successful-test-to-continue": "Executa unha proba exitosa para continuar.", "sample-data-ingestion-config-description": "Este esquema define os parámetros que se poden pasar para a recollida de datos de exemplo.", "schedule-description": "Programe a inxestión para que se execute a unha hora e frecuencia específicas.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Visualiza estatísticas do clúster de busca, detalles de índices e xestiona índices orfos.", "search-settings-description": "Configuración de busca para cada entidade baseada en clasificacións.", "search-settings-for-entity": "Configuración de busca baseada en clasificación para {{entity}}", + "seconds-left": "~{{count}}s restantes", + "seconds-short": "{{count}}s", "see-also": "Ver Tamén", "see-how-to-get-started": "Mira cómo empezar", "select-alert-type": "Por favor, selecciona un tipo de alerta", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json index a459dc6ae3bd..a165b0af6b4c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json @@ -97,6 +97,7 @@ "advanced-configuration": "תצורה מתקדמת", "advanced-entity": "מתקדם {{entity}}", "advanced-search": "חיפוש מתקדם", + "agent": "סוכן", "agent-activity": "פעילות סוכן", "agent-plural": "סוכנים", "agent-setup": "הגדרת סוכן", @@ -189,6 +190,8 @@ "asset-plural": "נכסים", "asset-plural-lowercase": "נכסים", "asset-type": "סוג נכס", + "assets-ingested": "נכסים שנקלטו", + "assets-profiled": "נכסים שנותחו", "assigned": "הוקצה", "assigned-entity": "הוקצה {{entity}}", "assigned-to-me": "הוקצה לי", @@ -248,6 +251,7 @@ "basic-configuration": "תצורה בסיסית", "batch-size": "גודל סדרה", "bearer-hmac-signature": "Bearer (חתימת HMAC)", + "before-error": "לפני השגיאה", "before-number-of-day-plural": "לפני {{numberOfDays}} ימים", "belongs-to": "שייך ל", "belongs-to-database": "שייך לבסיס נתונים", @@ -369,6 +373,7 @@ "collapse": "כווץ", "collapse-all": "קפיצה לתחתית", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "סוכני Collate AI", "collection": "אוסף", "collection-plural": "אוספים", "color": "צבע", @@ -492,7 +497,7 @@ "cost-analysis": "ניתוח עלויות", "count": "ספירה", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} פועלים", "cover-image": "תמונת כיסוי", "covered": "מכוסה", "create": "צור", @@ -664,12 +669,14 @@ "dbt-source": "מקור dbt", "dbt-source-project": "פרויקט מקור dbt", "deactivated": "הושבת", + "debug": "ניפוי באגים", "december": "דצמבר", "decision": "החלטה", "default": "ברירת מחדל", "default-persona": "פרסונה ברירת מחדל", "default-role": "תפקיד ברירת מחדל", "delete": "מחק", + "delete-agent": "מחיקת סוכן", "delete-all-nodes": "מחיקת כל הצמתים", "delete-boost": "מחק הגברה", "delete-data-asset-rule": "מחק כלל נכס נתונים", @@ -697,6 +704,7 @@ "deployed": "נפרס", "deployed-lowercase": "נפרס", "deploying-lowercase": "פורס", + "deployment-complete": "הפריסה הושלמה", "deprecate": "Deprecate", "depth": "עומק", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "פרטים", "details": "פרטים", "developed-by-developer": "פותח על ידי {{developer}}", + "diagnose": "אבחון", "diagnostic-info": "מידע אבחוני", "did-not-run": "לא רץ", "dimension": "ממד", @@ -784,6 +793,7 @@ "drive-plural": "כוננים", "duplicate": "שכפל", "duration": "משך זמן", + "duration-in-minute": "{{duration}} דק'", "dynamic": "דינמי", "dynamic-assertion": "אסרציה דינמית", "edge": "קצה", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "ערוך וקבל הצעה", "edit-an-announcement": "ערוך הודעה", "edit-chart-name": "ערוך תרשים: \"{{name}}\"", + "edit-configuration": "עריכת תצורה", "edit-connection": "ערוך חיבור", "edit-data-asset-rule": "ערוך כלל נכס נתונים", "edit-description-for": "ערוך תיאור עבור {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "שקילות", "error": "שגיאה", "error-plural": "שגיאות", + "error-plural-lowercase": "שגיאות", "esc": "Esc", + "est-remaining": "נותר משוער", "establish-connection": "Establish Connection", "evaluate": "הערך", "evaluate-permission": "הערך הרשאה", @@ -972,8 +985,10 @@ "factor": "גורם", "fail-on-conflict": "כישלון בעת קונפליקט", "failed": "נכשל", + "failed-at": "נכשל ב-", "failed-entity": "{{entity}} נכשל", "failed-event-plural": "אירועים שנכשלו", + "failed-lowercase": "נכשל", "failed-rows": "שורות נכשלות", "failed-slash-aborted-reason": "סיבת כישלון/ביטול", "failed-to-upload-file": "נכשל בהעלאת קובץ", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "תבניות סינון", "filter-plural": "סננים", "filtered": "מסונן", + "filtered-lowercase": "מסונן", "filtering-condition": "תנאי סינון", "filters-configuration": "תצורת מסננים", + "finished": "הסתיים", + "finished-lowercase": "הסתיים", "first": "ראשון", "first-lowercase": "ראשון", "first-name": "שם פרטי", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "הסתר הגדרות התחזות ({{count}})", "hide-meta-details": "הסתר פרטי מטא", "hide-property-plural": "הסתר מאפיינים", + "hide-raw-logs": "הסתרת יומנים גולמיים", "hierarchical": "היררכי", "hierarchy": "היררכיה", "hierarchy-depth": "עומק היררכיה", @@ -1170,6 +1189,7 @@ "homepage": "דף הבית", "hour": "שעה", "hourly": "שעתי", + "how-to-fix": "כיצד לתקן", "http-config-source": "מקור תצורת HTTP", "http-method": "שיטת HTTP", "hybrid-search-weight-plural": "משקלי חיפוש היברידי", @@ -1226,6 +1246,7 @@ "index-name": "שם אינדקס", "index-states": "מצבי אינדקס", "indirect": "עקיף", + "info": "מידע", "ingest-sample-data": "טען נתוני דוגמא (Sample)", "ingestion": "תהליך טעינה", "ingestion-lowercase": "תהליך טעינה", @@ -1297,6 +1318,7 @@ "keyword": "מילת מפתח", "keyword-lowercase-plural": "מילות מפתח", "kill": "הרוג", + "kill-run": "עצירת ריצה", "knowledge": "ידע", "knowledge-article-plural": "מאמרי ידע", "knowledge-center": "מרכז ידע", @@ -1508,7 +1530,9 @@ "model": "מודל", "model-name": "שם המודל", "model-plural": "מודלים", + "model-plural-lowercase": "מודלים", "model-store": "מאגר מודל", + "models-parsed": "מודלים שנותחו", "modified-time": "זמן עדכון", "modifier": "משנה", "monday": "יום שני", @@ -1517,6 +1541,7 @@ "monthly": "חודשי", "more": "יותר", "more-action": "פעולה נוספת", + "more-action-plural": "פעולות נוספות", "more-actions": "פעולות נוספות", "more-help": "עזרה נוספת", "more-lowercase": "יותר", @@ -1554,6 +1579,7 @@ "native-field-plural": "שדות מקוריים", "navigation": "ניווט", "navigation-menu-plural": "תפריטי ניווט", + "need-attention": "דורש תשומת לב", "need-help": "צריך עזרה", "needs-attention": "דורש תשומת לב", "needs-review": "דרושה בדיקה", @@ -1605,6 +1631,7 @@ "no-records": "אין רשומות", "no-result-found": "לא נמצאו תוצאות.", "no-reviewer": "אין בודק", + "no-status": "אין סטטוס", "no-tags-added": "לא הוספו תגיות", "no-tasks-yet": "אין משימות עדיין", "no-tests-run": "לא הורצו בדיקות", @@ -1741,6 +1768,7 @@ "part-of": "חלק מ", "part-of-domain": "חלק מתחום", "partial-coverage": "כיסוי חלקי", + "partial-success": "הצלחה חלקית", "partition-lowercase-plural": "פרטישנים", "partition-plural": "פרטישנים", "partitioned": "מחולק לפרטישנים", @@ -1885,12 +1913,15 @@ "public-team": "צוות ציבורי", "published": "פורסם", "quality": "איכות", + "queries-processed": "שאילתות שעובדו", + "queries-scanned": "שאילתות שנסרקו", "query": "שאילתה", "query-log-duration": "משך לוג שאילתה", "query-lowercase": "שאילתה", "query-lowercase-plural": "שאילתות", "query-parameter-plural": "פרמטרי שאילתה", "query-plural": "שאילתות", + "query-plural-lowercase": "שאילתות", "query-used-in": "שאילתה שמשמשת ב", "queued": "בתור", "quick-add": "הוספה מהירה", @@ -1902,11 +1933,13 @@ "range": "טווח", "range-condition": "תנאי טווח", "raw-connection-log": "Raw Connection Log", + "raw-logs": "יומנים גולמיים", "rdf-predicate": "פרדיקט RDF", "rdf-store": "מאגר RDF", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "הקצה מחדש", "re-deploy": "הפצה מחדש", + "re-deploy-sentence": "פריסה מחדש", "re-enter-new-password": "הקלד סיסמה חדשה מחדש", "re-index-all": "אינדקס מחדש לכל הנתונים", "re-index-elasticsearch": "אינדקס מחדש לאלסטיקסרץ", @@ -1924,6 +1957,7 @@ "recent-chat": "אחרון", "recent-event-plural": "אירועים אחרונים", "recent-run-plural": "הרצות אחרונות", + "recent-runs-sentence": "ריצות אחרונות", "recent-search-term-plural": "מונחי חיפוש אחרונים", "recent-views": "צפיות אחרונות", "recently-created": "נוצר לאחרונה", @@ -1931,6 +1965,8 @@ "recently-updated": "עודכן לאחרונה", "recently-viewed": "נצפה לאחרונה", "record-plural": "רשומות", + "records": "רשומות", + "records-processed": "רשומות שעובדו", "recreate-index-plural": "יצירת מחדש של אינדקסים", "reference-plural": "הפניות", "refocused-to-home": "מיקוד מחדש לדף הבית", @@ -2071,6 +2107,7 @@ "run": "הרץ", "run-agent-plural": "הפעל סוכנים", "run-at": "הרץ ב", + "run-history-and-details": "היסטוריית ריצות ופרטים", "run-in-background": "Run in background", "run-now": "הרץ עכשיו", "run-type": "סוג הרצה", @@ -2138,6 +2175,7 @@ "search-index-plural": "אינדקסי חיפוש", "search-index-setting-plural": "הגדרות אינדקס חיפוש", "search-insights": "תובנות חיפוש", + "search-logs": "חיפוש ביומנים", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "חפש זיכרונות לפי תוכן...", @@ -2248,6 +2286,7 @@ "show-nested": "הצג מקוננים", "show-or-hide-advanced-config": "{{showAdv}} הצג/הסתר הגדרות מתקדמות", "show-or-hide-column-plural": "הצג / הסתר עמודות", + "show-raw-logs": "הצגת יומנים גולמיים", "showing-count-of-total-assets": "מציג {{count}} מתוך {{total}} נכסים", "showing-total-failure-plural": "סך הכל {{total}} כשלים", "sign-in": "התחבר", @@ -2313,6 +2352,7 @@ "started": "התחיל", "started-following": "התחיל לעקוב", "starting-offset": "היסט התחלתי", + "starts-after": "מתחיל לאחר", "starts-with": "מתחיל ב", "state": "מצב", "static": "סטטי", @@ -2322,10 +2362,13 @@ "status-success": "הצלחה", "stay-up-to-date": "הישאר מעודכן", "step": "שלב", + "steps": "שלבים", + "steps-lowercase": "שלבים", "steward": "Steward", "stop": "עצור", "stop-re-index-all": "עצור Re-Index", "stopped": "נעצר", + "stopped-lowercase": "נעצר", "storage": "אחסון", "storage-plural": "אחסונים", "storage-service": "שירות אחסון", @@ -2500,6 +2543,7 @@ "to-perform": "לבצע", "to-service-name": "לשם שירות", "to-service-type": "לסוג שירות", + "toggle-wrap": "החלפת גלישת שורות", "token": "Token", "token-end-point": "TokenEndpoint", "token-expiration": "תפוגת טוקן", @@ -2673,6 +2717,7 @@ "view-plural": "תצוגות", "view-property-plural": "הצג מאפיינים", "view-reindex-failure-plural": "הצג כשלי אינדוקס מחדש", + "view-run-history": "הצגת היסטוריית ריצות", "view-selected": "הצג נבחרים", "visibility": "נראות", "visibility-dataspace": "מרחב נתונים", @@ -2685,8 +2730,10 @@ "volume-change": "שינוי נפח", "wall-clock": "זמן אמת", "wants-to-access-your-account": "רוצה לגשת לחשבון {{username}} שלך", + "warn": "אזהרה", "warning": "אזהרה", "warning-plural": "אזהרות", + "warning-plural-lowercase": "אזהרות", "web-analytic-entity-view-report-data": "נתוני דוח צפייה בישות אנליטית באינטרנט", "web-analytic-user-activity-report-data": "נתוני דוח פעילות משתמש אנליטית באינטרנט", "web-analytics-report": "דוח ניתוח אינטרנטי", @@ -2722,6 +2769,8 @@ "workflow-plural": "תהליכי עבודה", "worksheet": "גליון עבודה", "worksheet-plural": "גליונות עבודה", + "wrap": "גלישת שורות", + "wrapping-up": "מסתיים", "year": "שנה", "yes": "כן", "yes-comma-confirm": "כן, אשר", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "גלה את נכסי הנתונים הנכונים באמצעות עורך התחברות עם תנאים או/ו.", "agent-setup-description": "הגדר את הפרמטרים המרכזיים לסוכן זה.", + "agents-deploy-progress": "{{done}} הושלמו · {{running}} רצים · {{queued}} בתור{{failedSuffix}} — הסוכנים רצים לפי לוח הזמנים שלהם לאחר מעבר ראשוני זה", + "agents-deploying-ingesting": "הסוכנים נפרסים וקולטים מטא-נתונים", + "agents-finished-summary": "{{done}} מתוך {{total}} סוכנים הסתיימו{{attentionSuffix}}", "aggregate-domain-type-description": "דומיינים שאוספים ומסדרים את הנתונים ממקורות מרובים כדי לספק נתונים מצטברים ומוצרי נתונים, כמו לדוגמה Customer 360, Customers sessions, וכו', לדומיינים אחרים לצרכי צריכה.", "airflow-guide-message": "{{brandName}} משתמשת ב-Airflow להפעלת מחברי קליטה. פיתחנו API מנוהלות להפקדת מחברי קליטה. יש להשתמש במופע {{brandName}} של Airflow או לעיין במדריך למטה להתקנת ה- API המנוהלות בהתקנת Airflow שלך.", "airflow-host-ip-address": "{{brandName}} תתחבר למשאב שלך מה-IP <0>{{hostIp}}. וודא שהמערכת מורשית לקבל תעבורה נכנסת בהגדרות אבטחת הרשת שלך.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "לחץ על <0>{{text}} לצפייה בפרטים.", "closed-this-task": "סגר משימה זו", "collaborate-with-other-user": "לשתף פעולה עם משתמשים אחרים.", + "collate-ai-agents-description": "סווג אוטומטית, תעד ובדוק את איכות הנכסים שלך באמצעות בינה מלאכותית.", "collate-ai-widget-description": "סקירה של הנתונים שנוצרו על ידי Collate AI עבור השירות. <0>למד עוד.", "column-bulk-operations-description": "נהל וערוך מטא-דאטה עבור עמודות מרובות בבת אחת. חפש, סנן ועדכן שמות תצוגה, תיאורים, תגיות ומונחי מילון במקום אחד.", "column-filter-help-text": "סנן שושלת לפי תגיות עמודות או שמות. השתמש ב-'tag:שםתגית' לסינון תגיות או פשוט הזן את שם העמודה.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "שגיאה בעת קבלת טוקן גישה.", "establishing-connection-ellipsis": "יוצר חיבור…", "events-matching-search-query": "אירועים התואמים לשאילתת החיפוש", + "everything-healthy": "הכול תקין", "example-value": "לדוגמה {{value}}", "exclude-system-entity-description": "כאשר מושבת, הדפוסים המוגדרים כברירת מחדל בסכמה עבור {{entity}} מוחלים אוטומטית.", "excludes-regex-line": "מוציא += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "לא משנה. זמן לשדרג את המטרות שלך ולהתקדם במהירות יותר.", "latency-sla-description": "<0>{{label}}: זמן תגובת השאילתה חייב להיות פחות מ‑ <0>{{data}}.", "latest-offset-description": "ה-offset האחרון של האירוע במערכת.", + "latest-run-lines": "ריצה אחרונה · {{count}} שורות", "ldap-group-dn-placeholder": "לדוגמה cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "DN של קבוצת LDAP זו כבר ממופה. כל קבוצת LDAP יכולה להיות ממופה רק פעם אחת.", "learning-resources-management-description": "חקור את תכונות המוצר ולמד כיצד הן עובדות באמצעות המשאבים שלנו", + "leave-page-ingestion-continues": "אפשר לעזוב את הדף — הקליטה נמשכת ברקע", "leave-the-team-team-name": "עזוב את הקבוצה {{teamName}}", "length-validator-error": "נדרשים לפחות {{length}} {{field}}", "lineage-ingestion-description": "הקליטת השקפיות יכולה להיות מוגדרת ופורסמת לאחר שהקליטת מטא-דאטה הוגדרה. תהליך העבודה של הקליטת שקפיות משיג את ההיסטוריה של השאילתות, פורס את השאילתות CREATE, INSERT, MERGE... ומכין את השקפיות בין היישויות המעורבות. הקליטת שקפיות יכולה להכיל רק תהליך שינוע נתונים אחד עבור שירות בסיס נתונים. הגדר את משך יומיות יומן השאילתות (בימים) והגבלת התוצאה להתחלה.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "מה תרצה לנתח היום?", "mcp-chat-placeholder": "שאל כל שאלה...", "mentioned-you-on-the-lowercase": "ציין אותך ב", + "metadata-agents-description": "חלץ מטא-נתונים, שימוש, שושלת ופרופיל מהמקור.", "metadata-agents-table-description": "סוכני מטא-דאטה משמשים לחילוץ מטא-דאטה משירותי המקור.", "metadata-ingestion-description": "בהתאם לסוג השירות שנבחר, הזן פרטי דפוס הסינון עבור הסכמה או טבלה (מסד נתונים), או נושא (הודעות), או לוח בקרה. תוכל לכלול או לא כלול את פרטי דפוס הסינון. בחר לכלול צפיות, הפעל או השבת את פרופיל הנתונים, וחילוץ נתוני דוגמה, כפי שנדרש.", "metadata-status-complete-description": "המטא-נתונים מלאים ועקביים בכל העמודות", @@ -3392,6 +3449,8 @@ "minimum-count-error": "יש לבחור לפחות {{count}} {{field}}.", "minimum-value-error": "הערך המינימלי צריך להיות קטן מהערך המקסימלי.", "minute": "דקה", + "minutes-left": "~{{count}} דק' נותרו", + "minutes-short": "{{count}} דק'", "missing-config-value": "חסר ערך הגדרה: {{field}}", "missing-description": "תיאור חסר", "modified-time-ago-by": "עודכן {{time}} לפני {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "לא הוגדרו מיפויי תפקידי LDAP.", "no-learning-resources-available": "אין משאבי למידה זמינים להקשר זה.", "no-lineage-available": "לא נמצאו קישורי lineage", + "no-lines-match": "אין שורות תואמות.", "no-match-found": "לא נמצאה התאמה", "no-mentions": "אין מקרים בהם התייחסו אליך או לצוות שלך בפעולות כלשהן", "no-native-fields": "אין שדות מקוריים הניתנים להגדרה עבור סוג ישות זה.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "גלה את מדדי הטבלה שלך על ידי הפעלת פרופילר של טבלה. תראה כמות של שורות, עדכונים של טבלות, שינויים בנפח, ועוד. עיין במדריך ההגדרה <0>כאן", "no-profiler-title": "הפעל Profiler לפתיחת תובנות טבלה", "no-properties-added": "No properties added.", + "no-recent-runs": "לא נמצאו ריצות אחרונות.", "no-recently-viewed-data": "אין נתונים שנצפו לאחרונה.", "no-reference-available": "אין הפניות זמינות.", "no-related-terms-available": "אין מונחים קשורים זמינים.", @@ -3638,6 +3699,7 @@ "password-error-message": "יש להזין סיסמה באורך של 8 עד 15 תווים ולכלול לפחות אות גדולה אחת (A-Z), אות קטנה אחת (a-z), מספר אחד ותו מיוחד (כמו !, %, @, או #)", "password-pattern-error": "יש להזין סיסמה באורך של 8 עד 56 תווים, עם תו מיוחד אחד, אות גדולה אחת ואות קטנה אחת", "path-of-the-dbt-files-stored": "נתיב לתיקייה בה נשמרים קבצי ה-dbt", + "percent-complete-all-agents": "{{percent}}% הושלמו בכל הסוכנים", "permanently-delete-common-message": "מחק את {{entity}} וכל המטא-נתונים שלו לצמיתות. לא ניתן לבטל פעולה זו.", "permanently-delete-ingestion-pipeline": "מחיקה קבועה של <0>{{entityName}} תגרום לאובדן תצורת הצינור, ולא ניתן יהיה לשחזר אותה.", "permanently-delete-metadata": "מחיקה של {{entityName}} תסיר את המטה-דאטה שלו מ-{{brandName}} לצמיתות.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "הגדרות להתאמה של כמה להחזיר אחורה בלוגי שאילתות לעיבוד נתוני שימוש.", "query-used-by-other-tables": "שאילתה בשימוש על ידי טבלאות אחרות", "quick-add-tip": "השתמש בהוספה מהירה ליצירת קשרי מונחי מילון מבלי לעזוב את הגרף.", + "ran-for-duration": "רץ במשך {{duration}} דק'", "rdf-not-enabled-for-export": "יש להפעיל RDF לייצוא אונטולוגיה. הפעל RDF בהגדרות השרת.", "rdf-predicate-tooltip": "URI של פרדיקט RDF לסמנטיקה מקושרת (למשל skos:broader)", "reacted-with-emoji": "{{type}} הגיב באמוג'י", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: הנתונים צריכים להיות נשמרים במשך <0>{{data}}.", "run-sample-data-to-ingest-sample-data": "'הרץ נתוני דוגמה כדי לשדרג נכסי נתונים דוגמה אל {{brandName}} שלך.'", "run-status-at-timestamp": "סטטוס ריצה: {{status}} ב-{{timestamp}}", + "run-status-click-details": "ריצת {{status}} · לחץ לפרטים", "run-successful-test-to-continue": "הפעל בדיקה מוצלחת להמשך.", "sample-data-ingestion-config-description": "סכימה זו מגדירה את הפרמטרים שניתן להעביר לאיסוף נתוני דוגמה.", "schedule-description": "תזמן את הקליטה לרוץ בזמן ותדירות ספציפיים.", @@ -3740,6 +3804,8 @@ "search-insights-description": "הצג סטטיסטיקות אשכול חיפוש, פרטי אינדקס ונהל אינדקסים יתומים.", "search-settings-description": "הגדרות חיפוש לכל ישות על בסיס דירוגים.", "search-settings-for-entity": "הגדרות חיפוש מבוססות דירוג עבור {{entity}}", + "seconds-left": "~{{count}} שנ' נותרו", + "seconds-short": "{{count}} שנ'", "see-also": "ראה גם", "see-how-to-get-started": "ראה איך להתחיל", "select-alert-type": "יש לבחור סוג התראה", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json index c289547f328d..958c16763956 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json @@ -97,6 +97,7 @@ "advanced-configuration": "高度な構成", "advanced-entity": "高度な{{entity}}", "advanced-search": "詳細検索", + "agent": "エージェント", "agent-activity": "エージェントのアクティビティ", "agent-plural": "エージェント", "agent-setup": "エージェントセットアップ", @@ -189,6 +190,8 @@ "asset-plural": "アセット", "asset-plural-lowercase": "アセット", "asset-type": "資産タイプ", + "assets-ingested": "取り込まれたアセット", + "assets-profiled": "プロファイルされたアセット", "assigned": "割り当て済み", "assigned-entity": "{{entity}}に割り当てました", "assigned-to-me": "自分に割り当て", @@ -248,6 +251,7 @@ "basic-configuration": "基本設定", "batch-size": "バッチサイズ", "bearer-hmac-signature": "Bearer(HMAC署名)", + "before-error": "エラーまで", "before-number-of-day-plural": "{{numberOfDays}}日前より前", "belongs-to": "所属先", "belongs-to-database": "所属データベース", @@ -369,6 +373,7 @@ "collapse": "折りたたむ", "collapse-all": "すべて折りたたむ", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Collate AI エージェント", "collection": "コレクション", "collection-plural": "コレクション", "color": "色", @@ -492,7 +497,7 @@ "cost-analysis": "コスト分析", "count": "件数", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} 件実行中", "cover-image": "カバー", "covered": "カバー済み", "create": "作成", @@ -664,12 +669,14 @@ "dbt-source": "dbtソース", "dbt-source-project": "dbt ソースプロジェクト", "deactivated": "無効化済み", + "debug": "デバッグ", "december": "12月", "decision": "判断", "default": "デフォルト", "default-persona": "デフォルトペルソナ", "default-role": "デフォルトロール", "delete": "削除", + "delete-agent": "エージェントを削除", "delete-all-nodes": "すべてのノードを削除", "delete-boost": "ブーストを削除", "delete-data-asset-rule": "データアセットルールを削除", @@ -697,6 +704,7 @@ "deployed": "デプロイ済み", "deployed-lowercase": "デプロイ済み", "deploying-lowercase": "デプロイ中", + "deployment-complete": "デプロイ完了", "deprecate": "Deprecate", "depth": "深度", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "詳細", "details": "詳細", "developed-by-developer": "{{developer}} によって開発", + "diagnose": "診断", "diagnostic-info": "診断情報", "did-not-run": "未実行", "dimension": "ディメンション", @@ -784,6 +793,7 @@ "drive-plural": "ドライブ", "duplicate": "重複", "duration": "所要時間", + "duration-in-minute": "{{duration}} 分", "dynamic": "動的", "dynamic-assertion": "動的アサーション", "edge": "エッジ", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "編集して提案を承認", "edit-an-announcement": "お知らせを編集", "edit-chart-name": "チャート \"{{name}}\" を編集", + "edit-configuration": "設定を編集", "edit-connection": "接続を編集", "edit-data-asset-rule": "データアセットルールを編集", "edit-description-for": "{{entityName}} の説明を編集", @@ -909,7 +920,9 @@ "equivalence": "等価", "error": "エラー", "error-plural": "エラー", + "error-plural-lowercase": "エラー", "esc": "Esc", + "est-remaining": "推定残り時間", "establish-connection": "接続を確立", "evaluate": "評価", "evaluate-permission": "パーミッションを評価", @@ -972,8 +985,10 @@ "factor": "要因", "fail-on-conflict": "競合時に失敗", "failed": "失敗", + "failed-at": "失敗した箇所", "failed-entity": "失敗した{{entity}}", "failed-event-plural": "失敗したイベント", + "failed-lowercase": "失敗", "failed-rows": "失敗した行", "failed-slash-aborted-reason": "失敗/中止の理由", "failed-to-upload-file": "ファイルのアップロードに失敗しました", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "フィルターパターン", "filter-plural": "フィルター", "filtered": "フィルター済み", + "filtered-lowercase": "フィルター済み", "filtering-condition": "フィルター条件", "filters-configuration": "フィルター設定", + "finished": "完了", + "finished-lowercase": "完了", "first": "最初", "first-lowercase": "最初", "first-name": "名", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "なりすまし設定を非表示 ({{count}})", "hide-meta-details": "メタ詳細を非表示にする", "hide-property-plural": "プロパティを非表示", + "hide-raw-logs": "生ログを非表示", "hierarchical": "階層的", "hierarchy": "階層", "hierarchy-depth": "階層の深さ", @@ -1170,6 +1189,7 @@ "homepage": "ホームページ", "hour": "時間", "hourly": "毎時", + "how-to-fix": "修正方法", "http-config-source": "HTTP設定ソース", "http-method": "HTTPメソッド", "hybrid-search-weight-plural": "ハイブリッド検索の重み", @@ -1226,6 +1246,7 @@ "index-name": "インデックス名", "index-states": "インデックス状態", "indirect": "間接", + "info": "情報", "ingest-sample-data": "サンプルデータをインジェスト", "ingestion": "インジェスト", "ingestion-lowercase": "インジェスト", @@ -1297,6 +1318,7 @@ "keyword": "キーワード", "keyword-lowercase-plural": "キーワード", "kill": "強制終了", + "kill-run": "実行を強制終了", "knowledge": "ナレッジ", "knowledge-article-plural": "ナレッジ記事", "knowledge-center": "ナレッジセンター", @@ -1508,7 +1530,9 @@ "model": "モデル", "model-name": "モデル名", "model-plural": "モデル", + "model-plural-lowercase": "モデル", "model-store": "モデルストア", + "models-parsed": "解析されたモデル", "modified-time": "更新時刻", "modifier": "修飾子", "monday": "月曜日", @@ -1517,6 +1541,7 @@ "monthly": "毎月", "more": "もっと見る", "more-action": "さらなるアクション", + "more-action-plural": "その他の操作", "more-actions": "その他のアクション", "more-help": "さらに詳しいヘルプ", "more-lowercase": "もっと", @@ -1554,6 +1579,7 @@ "native-field-plural": "ネイティブフィールド", "navigation": "ナビゲーション", "navigation-menu-plural": "ナビゲーションメニュー", + "need-attention": "要対応", "need-help": "ヘルプが必要ですか?", "needs-attention": "対応が必要", "needs-review": "要確認", @@ -1605,6 +1631,7 @@ "no-records": "レコードなし", "no-result-found": "結果が見つかりません", "no-reviewer": "レビュワーがいません", + "no-status": "ステータスなし", "no-tags-added": "タグは追加されていません", "no-tasks-yet": "タスクはまだありません", "no-tests-run": "テスト未実行", @@ -1741,6 +1768,7 @@ "part-of": "一部", "part-of-domain": "所属ドメイン", "partial-coverage": "部分的な適用範囲", + "partial-success": "部分的に成功", "partition-lowercase-plural": "パーティション", "partition-plural": "パーティション", "partitioned": "パーティション化済み", @@ -1885,12 +1913,15 @@ "public-team": "公開チーム", "published": "公開済み", "quality": "品質", + "queries-processed": "処理されたクエリ", + "queries-scanned": "スキャンされたクエリ", "query": "クエリ", "query-log-duration": "クエリログの期間", "query-lowercase": "クエリ", "query-lowercase-plural": "クエリ", "query-parameter-plural": "クエリパラメーター", "query-plural": "クエリ", + "query-plural-lowercase": "クエリ", "query-used-in": "使用されているクエリ", "queued": "キュー済み", "quick-add": "クイック追加", @@ -1902,11 +1933,13 @@ "range": "範囲", "range-condition": "範囲条件", "raw-connection-log": "Raw Connection Log", + "raw-logs": "生ログ", "rdf-predicate": "RDF述語", "rdf-store": "RDFストア", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "再割り当て", "re-deploy": "再デプロイ", + "re-deploy-sentence": "再デプロイ", "re-enter-new-password": "新しいパスワードを再入力してください", "re-index-all": "全て再インデックス", "re-index-elasticsearch": "Elasticsearch を再インデックス", @@ -1924,6 +1957,7 @@ "recent-chat": "最近", "recent-event-plural": "最近のイベント", "recent-run-plural": "最近の実行", + "recent-runs-sentence": "最近の実行", "recent-search-term-plural": "最近の検索ワード", "recent-views": "最近の閲覧", "recently-created": "最近作成された", @@ -1931,6 +1965,8 @@ "recently-updated": "最近更新された", "recently-viewed": "最近閲覧された項目", "record-plural": "レコード", + "records": "レコード", + "records-processed": "処理されたレコード", "recreate-index-plural": "インデックスを再作成", "reference-plural": "参照", "refocused-to-home": "ホームにフォーカスを戻しました", @@ -2071,6 +2107,7 @@ "run": "実行", "run-agent-plural": "エージェントを実行", "run-at": "実行日時", + "run-history-and-details": "実行履歴と詳細", "run-in-background": "Run in background", "run-now": "今すぐ実行", "run-type": "実行タイプ", @@ -2138,6 +2175,7 @@ "search-index-plural": "検索インデックス", "search-index-setting-plural": "検索インデックス設定", "search-insights": "検索インサイト", + "search-logs": "ログを検索", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "内容でメモリを検索...", @@ -2248,6 +2286,7 @@ "show-nested": "ネストを表示", "show-or-hide-advanced-config": "{{showAdv}} 高度な設定", "show-or-hide-column-plural": "カラムの表示/非表示", + "show-raw-logs": "生ログを表示", "showing-count-of-total-assets": "{{total}}件中{{count}}件のアセットを表示中", "showing-total-failure-plural": "合計 {{total}} 回の失敗", "sign-in": "サインイン", @@ -2313,6 +2352,7 @@ "started": "開始済み", "started-following": "フォローを開始しました", "starting-offset": "開始オフセット", + "starts-after": "開始条件", "starts-with": "で始まる", "state": "状態", "static": "静的", @@ -2322,10 +2362,13 @@ "status-success": "成功", "stay-up-to-date": "常に最新情報を取得", "step": "ステップ", + "steps": "ステップ", + "steps-lowercase": "ステップ", "steward": "Steward", "stop": "停止", "stop-re-index-all": "再インデックスを停止", "stopped": "停止済み", + "stopped-lowercase": "停止", "storage": "ストレージ", "storage-plural": "ストレージ", "storage-service": "ストレージサービス", @@ -2500,6 +2543,7 @@ "to-perform": "実行するには", "to-service-name": "サービス名", "to-service-type": "サービスタイプ", + "toggle-wrap": "折り返しを切り替え", "token": "Token", "token-end-point": "トークンエンドポイント", "token-expiration": "トークンの有効期限", @@ -2673,6 +2717,7 @@ "view-plural": "ビュー", "view-property-plural": "プロパティを表示", "view-reindex-failure-plural": "再インデックスの失敗の表示", + "view-run-history": "実行履歴を表示", "view-selected": "選択したものを表示", "visibility": "表示", "visibility-dataspace": "データスペース", @@ -2685,8 +2730,10 @@ "volume-change": "ボリュームの変化", "wall-clock": "実時間", "wants-to-access-your-account": "{{username}} アカウントへのアクセスを要求しています", + "warn": "警告", "warning": "警告", "warning-plural": "警告", + "warning-plural-lowercase": "警告", "web-analytic-entity-view-report-data": "Web分析エンティティ表示レポートデータ", "web-analytic-user-activity-report-data": "Web分析ユーザーアクティビティレポートデータ", "web-analytics-report": "Web分析レポート", @@ -2722,6 +2769,8 @@ "workflow-plural": "ワークフロー", "worksheet": "ワークシート", "worksheet-plural": "ワークシート", + "wrap": "折り返し", + "wrapping-up": "処理を終えています", "year": "年", "yes": "はい", "yes-comma-confirm": "はい、確認します", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "and/or 条件を使用したシンタックスエディターで、最適なデータアセットを見つけましょう。", "agent-setup-description": "このエージェントのコアパラメータを設定します。", + "agents-deploy-progress": "{{done}} 完了 · {{running}} 実行中 · {{queued}} キュー待ち{{failedSuffix}} — この最初のパスの後、エージェントはスケジュールに従って実行されます", + "agents-deploying-ingesting": "エージェントがメタデータをデプロイして取り込んでいます", + "agents-finished-summary": "{{total}} 個中 {{done}} 個のエージェントが完了しました{{attentionSuffix}}", "aggregate-domain-type-description": "複数のソースに連携してデータを集約し、Customer 360 や顧客セッションなどのデータプロダクトとして他のドメインが利用できるようにするドメインタイプ。", "airflow-guide-message": "{{brandName}} は Airflow を使用して取り込みコネクタを実行します。マネージド API を開発しており、これによりコネクタをデプロイできます。{{brandName}} の Airflow を利用するか、以下のガイドを参照してお使いの Airflow にマネージド API をインストールしてください。", "airflow-host-ip-address": "{{brandName}} は <0>{{hostIp}} からリソースに接続します。ネットワークセキュリティ設定でインバウンドトラフィックを許可してください。", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "<0>{{text}} をクリックして詳細を表示", "closed-this-task": "このタスクはクローズされました", "collaborate-with-other-user": "他のユーザーとコラボレーションできます。", + "collate-ai-agents-description": "AI を使ってアセットの自動ティア付け、ドキュメント化、品質チェックを行います。", "collate-ai-widget-description": "Collate AI によって生成されたデータの概要。<0>詳細を見る。", "column-bulk-operations-description": "複数の列のメタデータを一度に管理および編集します。データ資産全体で表示名、説明、タグ、用語集の用語を検索、フィルタリング、更新します。", "column-filter-help-text": "カラムタグまたは名前でリネージをフィルタリングします。タグフィルタリングには 'tag:タグ名' を使用するか、カラム名を入力してください。", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "アクセストークンの取得中にエラーが発生しました。", "establishing-connection-ellipsis": "接続を確立中…", "events-matching-search-query": "検索クエリに一致するイベント", + "everything-healthy": "すべて正常", "example-value": "例: {{value}}", "exclude-system-entity-description": "無効の場合、スキーマで定義されたデフォルトパターンが{{entity}}に自動的に適用されます。", "excludes-regex-line": "除外 += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "大丈夫。目標を再構築して、より早く前進しましょう。", "latency-sla-description": "<0>{{label}}: クエリ応答は<0>{{data}}未満である必要があります", "latest-offset-description": "システム内の最新のイベントオフセットです。", + "latest-run-lines": "最新の実行 · {{count}} 行", "ldap-group-dn-placeholder": "例:cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "このLDAPグループDNはすでにマップされています。各LDAPグループは一度のみマップできます。", "learning-resources-management-description": "製品の機能を探索し、リソースを通じてその仕組みを学びましょう", + "leave-page-ingestion-continues": "このページを離れても構いません — 取り込みはバックグラウンドで続行されます", "leave-the-team-team-name": "チーム {{teamName}} から退出する", "length-validator-error": "{{length}} 文字以上の {{field}} が必要です", "lineage-ingestion-description": "メタデータの取り込み設定が完了した後、リネージ取り込みを構成・デプロイできます。リネージ取り込みワークフローでは、クエリ履歴を取得し、CREATE、INSERT、MERGE などのクエリを解析してエンティティ間のリネージを作成します。1つのデータベースサービスに対して、リネージ取り込みは1つのパイプラインのみ可能です。開始するには、クエリログの期間(日数)と結果の上限を定義してください。", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "今日は何を分析しますか?", "mcp-chat-placeholder": "何でも聞いてください...", "mentioned-you-on-the-lowercase": "であなたについて言及しました", + "metadata-agents-description": "ソースからメタデータ、使用状況、リネージ、プロファイリングを抽出します。", "metadata-agents-table-description": "メタデータエージェントは、ソースサービスからメタデータを抽出するために使用されます。", "metadata-ingestion-description": "選択したサービスの種類に基づいて、スキーマまたはテーブル(データベース)、トピック(メッセージ)、またはダッシュボードのフィルターパターンの詳細を入力します。フィルターパターンを含めたり除外したりできます。ビューの含有、データプロファイラーの有効/無効、サンプルデータの取り込みも選択できます。", "metadata-status-complete-description": "メタデータはすべての列で完全に記入され、一貫しています", @@ -3392,6 +3449,8 @@ "minimum-count-error": "少なくとも {{count}} 個の {{field}} を選択する必要があります。", "minimum-value-error": "最小値は最大値より小さくする必要があります。", "minute": "分", + "minutes-left": "残り約 {{count}} 分", + "minutes-short": "{{count}} 分", "missing-config-value": "設定値が不足しています: {{field}}", "missing-description": "説明なし", "modified-time-ago-by": "{{time}} 前に {{by}} によって更新されました", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "LDAPロールマッピングが設定されていません。", "no-learning-resources-available": "このコンテキストで利用可能な学習リソースはありません。", "no-lineage-available": "lineage の接続は見つかりませんでした", + "no-lines-match": "一致する行がありません。", "no-match-found": "一致するものは見つかりませんでした", "no-mentions": "あなたやチームが参照されているアクティビティはありません", "no-native-fields": "このエンティティタイプには設定可能なネイティブフィールドがありません。", @@ -3513,6 +3573,7 @@ "no-profiler-message": "テーブルのメトリクスを実行するプロファイラーを設定して探索しましょう。行数、更新頻度、ボリュームの変化などを確認できます。開始手順は次の通りです。", "no-profiler-title": "プロファイラーを実行してテーブルインサイトをアンロック", "no-properties-added": "No properties added.", + "no-recent-runs": "最近の実行が見つかりません。", "no-recently-viewed-data": "最近表示したデータはありません。", "no-reference-available": "参照はありません。", "no-related-terms-available": "関連用語はありません。", @@ -3638,6 +3699,7 @@ "password-error-message": "パスワードは8文字以上66文字以下で、大文字 (A-Z)、小文字 (a-z)、数字、特殊文字 (!、%、@、# など) をそれぞれ少なくとも1文字含める必要があります。", "password-pattern-error": "パスワードは8~56文字で、1つの特殊文字、大文字1つ、小文字1つが含まれている必要があります。", "path-of-the-dbt-files-stored": "dbtファイルが保存されているフォルダのパス", + "percent-complete-all-agents": "全エージェントで {{percent}}% 完了", "permanently-delete-common-message": "この{{entity}}とそのすべてのメタデータを完全に削除します。この操作は元に戻せません。", "permanently-delete-ingestion-pipeline": "この <0>{{entityName}} を完全に削除すると、パイプライン設定が失われ、元に戻すことはできません。", "permanently-delete-metadata": "この <0>{{entityName}} を完全に削除すると、{{brandName}} からメタデータが完全に削除されます。", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "使用状況データを処理するために、クエリログのどこまで遡るかの設定です。", "query-used-by-other-tables": "他のテーブルで使用されているクエリ", "quick-add-tip": "クイック追加を使用すると、グラフを離れずに用語集の用語関係を作成できます。", + "ran-for-duration": "{{duration}} 分間実行しました", "rdf-not-enabled-for-export": "オントロジーをエクスポートするにはRDFを有効にする必要があります。サーバー設定でRDFを有効にしてください。", "rdf-predicate-tooltip": "この関係タイプのRDF述語URI(例:skos:broader、skos:exactMatch)。", "reacted-with-emoji": "{{type}} の絵文字でリアクションしました", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: データは<0>{{data}}間保持する必要があります", "run-sample-data-to-ingest-sample-data": "サンプルデータを実行して {{brandName}} に取り込みます。", "run-status-at-timestamp": "実行ステータス:{{timestamp}} 時点で {{status}}", + "run-status-click-details": "{{status}} 実行 · クリックして詳細を表示", "run-successful-test-to-continue": "続行するには成功したテストを実行してください。", "sample-data-ingestion-config-description": "このスキーマは、サンプルデータ収集のために渡すことができるパラメータを定義します。", "schedule-description": "取り込みの実行時刻と頻度をスケジュールします。", @@ -3740,6 +3804,8 @@ "search-insights-description": "検索クラスターの統計、インデックスの詳細を表示し、孤立したインデックスを管理します。", "search-settings-description": "各エンティティのランキングに基づく検索設定。", "search-settings-for-entity": "{{entity}}の検索設定(ランキングに基づく)", + "seconds-left": "残り約 {{count}} 秒", + "seconds-short": "{{count}} 秒", "see-also": "関連項目", "see-how-to-get-started": "使い始める方法を見る", "select-alert-type": "アラートタイプを選択してください", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json index c7091f3b280d..6b8bb26a263e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json @@ -97,6 +97,7 @@ "advanced-configuration": "고급 구성", "advanced-entity": "고급 {{entity}}", "advanced-search": "고급 검색", + "agent": "에이전트", "agent-activity": "에이전트 활동", "agent-plural": "에이전트", "agent-setup": "에이전트 설정", @@ -189,6 +190,8 @@ "asset-plural": "자산들", "asset-plural-lowercase": "자산들", "asset-type": "자산 유형", + "assets-ingested": "수집된 자산", + "assets-profiled": "프로파일링된 자산", "assigned": "할당됨", "assigned-entity": "할당된 {{entity}}", "assigned-to-me": "나에게 할당됨", @@ -248,6 +251,7 @@ "basic-configuration": "기본 설정", "batch-size": "배치 크기", "bearer-hmac-signature": "Bearer (HMAC 서명)", + "before-error": "오류 발생 전", "before-number-of-day-plural": "{{numberOfDays}}일 전", "belongs-to": "소속", "belongs-to-database": "소속 데이터베이스", @@ -369,6 +373,7 @@ "collapse": "접기", "collapse-all": "모두 접기", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Collate AI 에이전트", "collection": "컬렉션", "collection-plural": "컬렉션들", "color": "색상", @@ -492,7 +497,7 @@ "cost-analysis": "비용 분석", "count": "개수", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}}개 실행 중", "cover-image": "씌우다", "covered": "포함됨", "create": "생성", @@ -664,12 +669,14 @@ "dbt-source": "dbt 소스", "dbt-source-project": "dbt 소스 프로젝트", "deactivated": "비활성화됨", + "debug": "디버그", "december": "12월", "decision": "결정", "default": "기본값", "default-persona": "기본 페르소나", "default-role": "기본 역할", "delete": "삭제", + "delete-agent": "에이전트 삭제", "delete-all-nodes": "모든 노드 삭제", "delete-boost": "부스트 삭제", "delete-data-asset-rule": "데이터 자산 규칙 삭제", @@ -697,6 +704,7 @@ "deployed": "배포됨", "deployed-lowercase": "배포됨", "deploying-lowercase": "배포 중", + "deployment-complete": "배포 완료", "deprecate": "Deprecate", "depth": "깊이", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "세부사항", "details": "세부", "developed-by-developer": "{{developer}}에 의해 개발됨", + "diagnose": "진단", "diagnostic-info": "진단 정보", "did-not-run": "실행되지 않음", "dimension": "차원", @@ -784,6 +793,7 @@ "drive-plural": "드라이브", "duplicate": "복제", "duration": "기간", + "duration-in-minute": "{{duration}}분", "dynamic": "동적", "dynamic-assertion": "동적 단언", "edge": "엣지", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "편집 & 제안 수락", "edit-an-announcement": "공지사항 편집", "edit-chart-name": "차트 편집: \"{{name}}\"", + "edit-configuration": "구성 편집", "edit-connection": "연결 편집", "edit-data-asset-rule": "데이터 자산 규칙 편집", "edit-description-for": "{{entityName}}에 대한 설명 편집", @@ -909,7 +920,9 @@ "equivalence": "동등성", "error": "오류", "error-plural": "오류들", + "error-plural-lowercase": "오류", "esc": "Esc", + "est-remaining": "예상 남은 시간", "establish-connection": "연결 설정", "evaluate": "평가", "evaluate-permission": "권한 평가", @@ -972,8 +985,10 @@ "factor": "요인", "fail-on-conflict": "충돌 시 실패", "failed": "실패", + "failed-at": "실패 위치", "failed-entity": "실패한 {{entity}}", "failed-event-plural": "실패한 이벤트들", + "failed-lowercase": "실패", "failed-rows": "실패한 행", "failed-slash-aborted-reason": "실패/중단 사유", "failed-to-upload-file": "파일 업로드에 실패했습니다", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "필터 패턴", "filter-plural": "필터들", "filtered": "필터링됨", + "filtered-lowercase": "필터링됨", "filtering-condition": "필터링 조건", "filters-configuration": "필터 구성", + "finished": "완료됨", + "finished-lowercase": "완료됨", "first": "첫 번째", "first-lowercase": "첫 번째", "first-name": "이름", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "가장(Impersonation) 설정 숨기기 ({{count}})", "hide-meta-details": "메타 정보 숨기기", "hide-property-plural": "속성 숨기기", + "hide-raw-logs": "원시 로그 숨기기", "hierarchical": "계층적", "hierarchy": "계층", "hierarchy-depth": "계층 깊이", @@ -1170,6 +1189,7 @@ "homepage": "홈페이지", "hour": "시간", "hourly": "매시간", + "how-to-fix": "해결 방법", "http-config-source": "HTTP 설정 소스", "http-method": "HTTP 메서드", "hybrid-search-weight-plural": "하이브리드 검색 가중치", @@ -1226,6 +1246,7 @@ "index-name": "인덱스 이름", "index-states": "인덱스 통계", "indirect": "간접", + "info": "정보", "ingest-sample-data": "샘플 데이터 수집", "ingestion": "수집", "ingestion-lowercase": "수집", @@ -1297,6 +1318,7 @@ "keyword": "키워드", "keyword-lowercase-plural": "키워드", "kill": "종료", + "kill-run": "실행 강제 종료", "knowledge": "지식", "knowledge-article-plural": "지식 문서", "knowledge-center": "지식 센터", @@ -1508,7 +1530,9 @@ "model": "모델", "model-name": "모델 이름", "model-plural": "모델들", + "model-plural-lowercase": "모델", "model-store": "모델 저장소", + "models-parsed": "파싱된 모델", "modified-time": "수정 시간", "modifier": "수정자", "monday": "월요일", @@ -1517,6 +1541,7 @@ "monthly": "월간", "more": "더 보기", "more-action": "추가 활동", + "more-action-plural": "추가 작업", "more-actions": "추가 작업", "more-help": "추가 도움말", "more-lowercase": "더", @@ -1554,6 +1579,7 @@ "native-field-plural": "네이티브 필드", "navigation": "내비게이션", "navigation-menu-plural": "내비게이션 메뉴들", + "need-attention": "주의 필요", "need-help": "도움이 필요하신가요", "needs-attention": "주의 필요", "needs-review": "검토 필요", @@ -1605,6 +1631,7 @@ "no-records": "기록 없음", "no-result-found": "결과를 찾을 수 없습니다.", "no-reviewer": "검토자 없음", + "no-status": "상태 없음", "no-tags-added": "추가된 태그 없음", "no-tasks-yet": "작업 없음", "no-tests-run": "테스트 미실행", @@ -1741,6 +1768,7 @@ "part-of": "일부", "part-of-domain": "소속 도메인", "partial-coverage": "부분 보장", + "partial-success": "부분 성공", "partition-lowercase-plural": "파티션들", "partition-plural": "파티션들", "partitioned": "분할됨", @@ -1885,12 +1913,15 @@ "public-team": "공개 팀", "published": "게시됨", "quality": "품질", + "queries-processed": "처리된 쿼리", + "queries-scanned": "스캔된 쿼리", "query": "쿼리", "query-log-duration": "쿼리 로그 기간", "query-lowercase": "쿼리", "query-lowercase-plural": "쿼리들", "query-parameter-plural": "쿼리 매개변수", "query-plural": "쿼리들", + "query-plural-lowercase": "쿼리", "query-used-in": "사용된 쿼리", "queued": "대기열에 추가됨", "quick-add": "빠른 추가", @@ -1902,11 +1933,13 @@ "range": "범위", "range-condition": "범위 조건", "raw-connection-log": "Raw Connection Log", + "raw-logs": "원시 로그", "rdf-predicate": "RDF 술어", "rdf-store": "RDF 저장소", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "재할당", "re-deploy": "재배포", + "re-deploy-sentence": "재배포", "re-enter-new-password": "새 비밀번호 재입력", "re-index-all": "전체 재색인", "re-index-elasticsearch": "Elasticsearch 재색인", @@ -1924,6 +1957,7 @@ "recent-chat": "최근", "recent-event-plural": "최근 이벤트", "recent-run-plural": "최근 실행들", + "recent-runs-sentence": "최근 실행", "recent-search-term-plural": "최근 검색어들", "recent-views": "최근 조회", "recently-created": "최근 생성됨", @@ -1931,6 +1965,8 @@ "recently-updated": "최근 업데이트됨", "recently-viewed": "최근에 본", "record-plural": "기록들", + "records": "레코드", + "records-processed": "처리된 레코드", "recreate-index-plural": "인덱스 재생성", "reference-plural": "참조들", "refocused-to-home": "홈으로 포커스 이동됨", @@ -2071,6 +2107,7 @@ "run": "실행", "run-agent-plural": "에이전트 실행", "run-at": "실행 시간", + "run-history-and-details": "실행 기록 및 세부 정보", "run-in-background": "Run in background", "run-now": "지금 실행", "run-type": "실행 유형", @@ -2138,6 +2175,7 @@ "search-index-plural": "검색 인덱스들", "search-index-setting-plural": "검색 인덱스 설정들", "search-insights": "검색 인사이트", + "search-logs": "로그 검색", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "내용으로 메모리 검색...", @@ -2248,6 +2286,7 @@ "show-nested": "중첩 표시", "show-or-hide-advanced-config": "고급 구성 {{showAdv}}", "show-or-hide-column-plural": "열 표시/숨기기", + "show-raw-logs": "원시 로그 표시", "showing-count-of-total-assets": "{{total}}개 중 {{count}}개 자산 표시 중", "showing-total-failure-plural": "총 {{total}}건 실패", "sign-in": "로그인", @@ -2313,6 +2352,7 @@ "started": "시작됨", "started-following": "팔로우 시작됨", "starting-offset": "시작 오프셋", + "starts-after": "시작 조건", "starts-with": "다음으로 시작", "state": "상태", "static": "정적", @@ -2322,10 +2362,13 @@ "status-success": "성공", "stay-up-to-date": "최신 정보 유지", "step": "단계", + "steps": "단계", + "steps-lowercase": "단계", "steward": "Steward", "stop": "중지", "stop-re-index-all": "재색인 중지", "stopped": "중지됨", + "stopped-lowercase": "중지됨", "storage": "저장소", "storage-plural": "저장소들", "storage-service": "스토리지 서비스", @@ -2500,6 +2543,7 @@ "to-perform": "수행할", "to-service-name": "서비스 이름", "to-service-type": "서비스 유형", + "toggle-wrap": "줄 바꿈 전환", "token": "Token", "token-end-point": "토큰 엔드포인트", "token-expiration": "토큰 만료", @@ -2673,6 +2717,7 @@ "view-plural": "뷰들", "view-property-plural": "속성 보기", "view-reindex-failure-plural": "재색인 실패 보기", + "view-run-history": "실행 기록 보기", "view-selected": "선택된 결과 보기", "visibility": "가시성", "visibility-dataspace": "데이터 공간", @@ -2685,8 +2730,10 @@ "volume-change": "볼륨 변경", "wall-clock": "실제 시간", "wants-to-access-your-account": "{{username}} 계정에 접근하려고 합니다", + "warn": "경고", "warning": "경고", "warning-plural": "경고들", + "warning-plural-lowercase": "경고", "web-analytic-entity-view-report-data": "웹 분석 엔티티 보기 보고서 데이터", "web-analytic-user-activity-report-data": "웹 분석 사용자 활동 보고서 데이터", "web-analytics-report": "웹 분석 보고서", @@ -2722,6 +2769,8 @@ "workflow-plural": "워크플로우들", "worksheet": "워크시트", "worksheet-plural": "워크시트", + "wrap": "줄 바꿈", + "wrapping-up": "마무리 중", "year": "년", "yes": "예", "yes-comma-confirm": "예, 확인합니다", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "and/or 조건이 있는 구문 편집기를 사용하여 적절한 데이터 자산을 발견하세요.", "agent-setup-description": "이 에이전트의 핵심 매개변수를 구성합니다.", + "agents-deploy-progress": "{{done}}개 완료 · {{running}}개 실행 중 · {{queued}}개 대기 중{{failedSuffix}} — 이 첫 번째 실행 후 에이전트는 예약된 일정에 따라 실행됩니다", + "agents-deploying-ingesting": "에이전트가 메타데이터를 배포하고 수집하는 중입니다", + "agents-finished-summary": "{{total}}개 중 {{done}}개 에이전트 완료{{attentionSuffix}}", "aggregate-domain-type-description": "다양한 도메인의 데이터 조합의 최종 제품이 비즈니스 사용자나 데이터 시민이 데이터 기반 의사 결정을 위해 사용할 수 있는 사용자 중심 도메인입니다.", "airflow-guide-message": "{{brandName}}는 Airflow를 사용하여 수집 커넥터를 실행합니다. 우리는 수집 커넥터를 배포하기 위해 관리형 API를 개발했습니다. {{brandName}} Airflow 인스턴스를 사용하거나 아래 가이드를 참조하여 Airflow 설치에 관리형 API를 설치하세요.", "airflow-host-ip-address": "{{brandName}}는 IP {{hostIp}}에서 귀하의 리소스에 연결할 것입니다. 네트워크 보안 설정에서 인바운드 트래픽을 허용하도록 확인하세요.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "자세한 내용을 보려면 <0>{{text}}를 클릭하세요.", "closed-this-task": "이 작업을 종료했습니다", "collaborate-with-other-user": "다른 사용자와 협업하기 위해", + "collate-ai-agents-description": "AI로 자산을 자동 티어 분류, 문서화 및 품질 검사합니다.", "collate-ai-widget-description": "해당 서비스에서 Collate AI가 생성한 데이터 개요입니다. <0>자세히 보기", "column-bulk-operations-description": "한 번에 여러 열의 메타데이터를 관리하고 편집합니다. 데이터 자산 전반에 걸쳐 표시 이름, 설명, 태그 및 용어를 검색, 필터링 및 업데이트합니다.", "column-filter-help-text": "컬럼 태그 또는 이름으로 계보를 필터링합니다. 태그 필터링에는 'tag:태그명'을 사용하거나 컬럼 이름을 입력하세요.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "액세스 토큰을 가져오는 중 오류가 발생했습니다.", "establishing-connection-ellipsis": "연결 설정 중…", "events-matching-search-query": "검색 쿼리와 일치하는 이벤트", + "everything-healthy": "모두 정상", "example-value": "예: {{value}}", "exclude-system-entity-description": "비활성화되면 스키마에 정의된 {{entity}}의 기본 패턴이 자동으로 적용됩니다.", "excludes-regex-line": "제외 += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "알림: 설명 KPI 목표가 아직 달성되지 않았지만 시간이 남아 있습니다 - 조직에 {{count}}일이 남았습니다. 진행 상황을 유지하려면 데이터 인사이트 보고서를 활성화하세요. 이를 통해 모든 팀에 주간 업데이트를 보내 조직의 KPI 달성을 위한 협업과 집중을 촉진할 수 있습니다.", "latency-sla-description": "<0>{{label}}: 쿼리 응답은 <0>{{data}} 보다 낮아야 합니다.", "latest-offset-description": "시스템 내 이벤트의 최신 오프셋입니다.", + "latest-run-lines": "최근 실행 · {{count}}줄", "ldap-group-dn-placeholder": "예: cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "이 LDAP 그룹 DN은 이미 매핑되어 있습니다. 각 LDAP 그룹은 한 번만 매핑할 수 있습니다.", "learning-resources-management-description": "제품 기능을 탐색하고 리소스를 통해 작동 방식을 알아보세요", + "leave-page-ingestion-continues": "이 페이지를 벗어나도 됩니다 — 수집은 백그라운드에서 계속됩니다", "leave-the-team-team-name": "{{teamName}} 팀 떠나기", "length-validator-error": "최소 {{length}}개의 {{field}}이(가) 필요합니다", "lineage-ingestion-description": "계보 수집은 메타데이터 수집이 설정된 후 구성 및 배포할 수 있습니다. 계보 수집 워크플로우는 쿼리 기록을 가져와 CREATE, INSERT, MERGE... 쿼리를 파싱하고 관련 엔티티 간의 계보를 준비합니다. 계보 수집은 데이터베이스 서비스당 하나의 파이프라인만 가질 수 있습니다. 시작하려면 쿼리 로그 기간(일)과 결과 제한을 정의하세요.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "오늘 무엇을 분석하시겠습니까?", "mcp-chat-placeholder": "무엇이든 물어보세요...", "mentioned-you-on-the-lowercase": "당신을 언급했습니다", + "metadata-agents-description": "소스에서 메타데이터, 사용량, 계보 및 프로파일링을 추출합니다.", "metadata-agents-table-description": "메타데이터 에이전트는 소스 서비스에서 메타데이터를 추출하는 데 사용됩니다.", "metadata-ingestion-description": "선택한 서비스 유형에 따라 스키마 또는 테이블(데이터베이스), 또는 토픽(메시징), 또는 대시보드에 대한 필터 패턴 세부 정보를 입력하세요. 필터 패턴을 포함하거나 제외할 수 있습니다. 필요에 따라 뷰를 포함하고, 데이터 프로파일러를 활성화 또는 비활성화하고, 샘플 데이터를 수집하도록 선택하세요.", "metadata-status-complete-description": "메타데이터가 모든 열에서 완전히 채워져 있고 일관됩니다", @@ -3392,6 +3449,8 @@ "minimum-count-error": "최소 {{count}} 개의 {{field}}를 선택해야 합니다.", "minimum-value-error": "최소값은 최대값보다 작아야 합니다.", "minute": "분", + "minutes-left": "약 {{count}}분 남음", + "minutes-short": "{{count}}분", "missing-config-value": "누락된 구성 값: {{field}}", "missing-description": "설명 없음", "modified-time-ago-by": "{{time}} 전에 {{by}}에 의해 수정됨", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "구성된 LDAP 역할 매핑이 없습니다.", "no-learning-resources-available": "이 컨텍스트에 사용 가능한 학습 리소스가 없습니다.", "no-lineage-available": "lineage 연결을 찾을 수 없습니다", + "no-lines-match": "일치하는 줄이 없습니다.", "no-match-found": "일치하는 항목을 찾을 수 없습니다", "no-mentions": "당신과 당신의 팀은 모두 괜찮아 보입니다 - 아직 어떤 활동에서도 언급되지 않았습니다. 계속 좋은 일을 하세요!", "no-native-fields": "이 엔터티 유형에 구성 가능한 네이티브 필드가 없습니다.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "데이터 프로파일러는 수집의 선택적 구성입니다. 문서를 따라 데이터 프로파일러를 활성화하세요.", "no-profiler-title": "프로파일러를 실행하여 테이블 인사이트 잠금 해제", "no-properties-added": "No properties added.", + "no-recent-runs": "최근 실행을 찾을 수 없습니다.", "no-recently-viewed-data": "최근에 본 데이터 자산이 없습니다. 흥미로운 것을 찾으려면 탐색해 보세요!", "no-reference-available": "사용 가능한 참조가 없습니다.", "no-related-terms-available": "사용 가능한 관련 용어가 없습니다.", @@ -3638,6 +3699,7 @@ "password-error-message": "비밀번호는 최소 8자에서 최대 56자 길이여야 하며, 최소 하나의 대문자(A-Z), 하나의 소문자(a-z), 하나의 숫자, 그리고 하나의 특수 문자(!, %, @, # 등)를 포함해야 합니다", "password-pattern-error": "비밀번호는 최소 8자에서 최대 56자 길이여야 하며, 하나의 특수 문자, 하나의 대문자, 하나의 소문자를 포함해야 합니다", "path-of-the-dbt-files-stored": "dbt 파일이 저장된 폴더의 경로", + "percent-complete-all-agents": "전체 에이전트 {{percent}}% 완료", "permanently-delete-common-message": "이 {{entity}} 및 모든 메타데이터를 영구적으로 삭제합니다. 이 작업은 취소할 수 없습니다.", "permanently-delete-ingestion-pipeline": "이 <0>{{entityName}}을(를) 영구적으로 삭제하면 파이프라인 구성이 손실되며 복구할 수 없습니다.", "permanently-delete-metadata": "이 <0>{{entityName}}을(를) 영구적으로 삭제하면 {{brandName}}에서 해당 메타데이터가 제거되며 복구할 수 없습니다.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "사용 데이터를 처리하기 위해 쿼리 로그를 얼마나 멀리 볼지 조정하는 구성입니다.", "query-used-by-other-tables": "다른 테이블에서 사용된 쿼리", "quick-add-tip": "빠른 추가를 사용하면 그래프를 떠나지 않고 용어집 용어 관계를 만들 수 있습니다.", + "ran-for-duration": "{{duration}}분 동안 실행됨", "rdf-not-enabled-for-export": "온톨로지를 내보내려면 RDF를 활성화해야 합니다. 서버 설정에서 RDF를 활성화하세요.", "rdf-predicate-tooltip": "이 관계 유형에 대한 RDF 술어 URI (예: skos:broader, skos:exactMatch).", "reacted-with-emoji": "{{type}} 이모지로 반응했습니다", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: 데이터는 <0>{{data}} 동안 보관되어야 합니다.", "run-sample-data-to-ingest-sample-data": "'{{brandName}}에 샘플 데이터 자산을 수집하려면 샘플 데이터를 실행하세요.'", "run-status-at-timestamp": "실행 상태: {{timestamp}}에 {{status}}", + "run-status-click-details": "{{status}} 실행 · 클릭하여 세부 정보 보기", "run-successful-test-to-continue": "계속하려면 테스트를 성공적으로 실행하세요.", "sample-data-ingestion-config-description": "이 스키마는 샘플 데이터 수집을 위해 전달할 수 있는 매개변수를 정의합니다.", "schedule-description": "특정 시간과 주기로 수집을 예약합니다.", @@ -3740,6 +3804,8 @@ "search-insights-description": "검색 클러스터 통계, 인덱스 세부정보를 확인하고 고아 인덱스를 관리합니다.", "search-settings-description": "각 엔티티별 랭킹 기반 검색 설정입니다.", "search-settings-for-entity": "{{entity}}의 랭킹 기반 검색 설정", + "seconds-left": "약 {{count}}초 남음", + "seconds-short": "{{count}}초", "see-also": "참고 항목", "see-how-to-get-started": "시작하는 방법 알아보기", "select-alert-type": "경고 유형을 선택하세요.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json index b77179de8686..85420ef2c3c6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json @@ -97,6 +97,7 @@ "advanced-configuration": "प्रगत संरचना", "advanced-entity": "प्रगत {{entity}}", "advanced-search": "प्रगत शोध", + "agent": "एजंट", "agent-activity": "एजंट क्रियाकलाप", "agent-plural": "एजंट्स", "agent-setup": "एजंट सेटअप", @@ -189,6 +190,8 @@ "asset-plural": "ॲसेट्स", "asset-plural-lowercase": "ॲसेट्स", "asset-type": "अॅसेट प्रकार", + "assets-ingested": "अ‍ॅसेट अंतर्भूत केले", + "assets-profiled": "अ‍ॅसेट प्रोफाइल केले", "assigned": "नियुक्त केले", "assigned-entity": "नियुक्त केलेले {{entity}}", "assigned-to-me": "मला नियुक्त केले", @@ -248,6 +251,7 @@ "basic-configuration": "मूलभूत संरचना", "batch-size": "बॅच आकार", "bearer-hmac-signature": "Bearer (HMAC स्वाक्षरी)", + "before-error": "त्रुटीपूर्वी", "before-number-of-day-plural": "{{numberOfDays}} दिवसांपूर्वी", "belongs-to": "Belongs to", "belongs-to-database": "डेटाबेसशी संबंधित", @@ -369,6 +373,7 @@ "collapse": "संकुचित करा", "collapse-all": "सर्व संकुचित करा", "collate-ai": "कोलेट एआय", + "collate-ai-agent-plural": "Collate AI एजंट", "collection": "संग्रह", "collection-plural": "संग्रह", "color": "रंग", @@ -492,7 +497,7 @@ "cost-analysis": "खर्च विश्लेषण", "count": "संख्या", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} चालू", "cover-image": "मुखपृष्ठ", "covered": "समाविष्ट", "create": "तयार करा", @@ -664,12 +669,14 @@ "dbt-source": "dbt स्रोत", "dbt-source-project": "dbt स्रोत प्रकल्प", "deactivated": "निष्क्रिय केले", + "debug": "डीबग", "december": "डिसेंबर", "decision": "निर्णय", "default": "मूलभूत", "default-persona": "मूलभूत व्यक्तिमत्व", "default-role": "डीफॉल्ट भूमिका", "delete": "मिटवा", + "delete-agent": "एजंट हटवा", "delete-all-nodes": "सर्व नोड हटवा", "delete-boost": "बूस्ट हटवा", "delete-data-asset-rule": "डेटा अॅसेट नियम हटवा", @@ -697,6 +704,7 @@ "deployed": "उपयोजित केले", "deployed-lowercase": "उपयोजित केले", "deploying-lowercase": "उपयोजित करत आहे", + "deployment-complete": "उपयोजन पूर्ण", "deprecate": "Deprecate", "depth": "खोली", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "तपशील", "details": "तपशील", "developed-by-developer": "{{developer}} द्वारे विकसित केले", + "diagnose": "निदान करा", "diagnostic-info": "नैदानिक माहिती", "did-not-run": "चालले नाही", "dimension": "परिमाण", @@ -784,6 +793,7 @@ "drive-plural": "ड्राइव्हस्", "duplicate": "डुप्लिकेट", "duration": "कालावधी", + "duration-in-minute": "{{duration}} मिनिटे", "dynamic": "गतिमान", "dynamic-assertion": "डायनॅमिक अॅसर्शन", "edge": "काठ", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "संपादित करा आणि सूचना स्वीकारा", "edit-an-announcement": "घोषणा संपादित करा", "edit-chart-name": "तक्ता संपादित करा: \"{{name}}\"", + "edit-configuration": "कॉन्फिगरेशन संपादित करा", "edit-connection": "कनेक्शन संपादित करा", "edit-data-asset-rule": "डेटा अॅसेट नियम संपादन", "edit-description-for": "{{entityName}} साठी वर्णन संपादित करा", @@ -909,7 +920,9 @@ "equivalence": "समानता", "error": "त्रुटी", "error-plural": "त्रुटी", + "error-plural-lowercase": "त्रुटी", "esc": "Esc", + "est-remaining": "अंदाजे शिल्लक", "establish-connection": "Establish Connection", "evaluate": "मूल्यांकन", "evaluate-permission": "परवानगीचे मूल्यांकन करा", @@ -972,8 +985,10 @@ "factor": "घटक", "fail-on-conflict": "विवादात अयशस्वी", "failed": "अयशस्वी", + "failed-at": "येथे अयशस्वी", "failed-entity": "अयशस्वी {{entity}}", "failed-event-plural": "अयशस्वी घटना", + "failed-lowercase": "अयशस्वी", "failed-rows": "अयशस्वी पंक्ती", "failed-slash-aborted-reason": "अपयश/रद्द करण्याचे कारण", "failed-to-upload-file": "फाइल अपलोड करण्यात योग्य नाही", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "फिल्टर नमुने", "filter-plural": "फिल्टर्स", "filtered": "फिल्टर केलेले", + "filtered-lowercase": "फिल्टर केले", "filtering-condition": "फिल्टरिंग अट", "filters-configuration": "फिल्टर कॉन्फिगरेशन", + "finished": "पूर्ण झाले", + "finished-lowercase": "पूर्ण झाले", "first": "पहिले", "first-lowercase": "पहिले", "first-name": "पहिले नाव", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "तोतयागिरी सेटिंग्ज लपवा ({{count}})", "hide-meta-details": "मेटा तपशील लपवा", "hide-property-plural": "गुप्त गुणधर्म", + "hide-raw-logs": "रॉ लॉग लपवा", "hierarchical": "श्रेणीबद्ध", "hierarchy": "श्रेणी", "hierarchy-depth": "श्रेणीची खोली", @@ -1170,6 +1189,7 @@ "homepage": "मुख्यपृष्ठ", "hour": "तास", "hourly": "दर तासाला", + "how-to-fix": "कसे दुरुस्त करावे", "http-config-source": "HTTP कॉन्फिग स्रोत", "http-method": "HTTP पद्धत", "hybrid-search-weight-plural": "हायब्रिड शोध भार", @@ -1226,6 +1246,7 @@ "index-name": "निर्देशांकाचे नाव", "index-states": "अनुक्रमणिका स्थिती", "indirect": "अप्रत्यक्ष", + "info": "माहिती", "ingest-sample-data": "नमुना डेटा अंतर्ग्रहण करा", "ingestion": "अंतर्ग्रहण", "ingestion-lowercase": "अंतर्ग्रहण", @@ -1297,6 +1318,7 @@ "keyword": "कीवर्ड", "keyword-lowercase-plural": "कीवर्ड्स", "kill": "ठार", + "kill-run": "रन थांबवा", "knowledge": "ज्ञान", "knowledge-article-plural": "ज्ञान लेख", "knowledge-center": "ज्ञान केंद्र", @@ -1508,7 +1530,9 @@ "model": "मॉडेल", "model-name": "मॉडेल नाव", "model-plural": "मॉडेल्स", + "model-plural-lowercase": "मॉडेल", "model-store": "मॉडेल स्टोअर", + "models-parsed": "मॉडेल पार्स केले", "modified-time": "बदललेली वेळ", "modifier": "संशोधक", "monday": "सोमवार", @@ -1517,6 +1541,7 @@ "monthly": "महिन्याने", "more": "अधिक", "more-action": "अधिक क्रिया", + "more-action-plural": "अधिक क्रिया", "more-actions": "अधिक क्रिया", "more-help": "अधिक मदत", "more-lowercase": "अधिक", @@ -1554,6 +1579,7 @@ "native-field-plural": "मूळ फील्ड", "navigation": "नेव्हिगेशन", "navigation-menu-plural": "नेव्हिगेशन मेनू", + "need-attention": "लक्ष देणे आवश्यक", "need-help": "मदत हवी आहे", "needs-attention": "लक्ष देणे आवश्यक आहे", "needs-review": "पुनरावलोकनाची आवश्यकता आहे", @@ -1605,6 +1631,7 @@ "no-records": "कोणत्याही नोंदी नाहीत", "no-result-found": "कोणताही परिणाम सापडला नाही.", "no-reviewer": "कोणताही पुनरावलोकक नाही", + "no-status": "स्थिती नाही", "no-tags-added": "कोणतेही टॅग जोडलेले नाहीत", "no-tasks-yet": "कार्ये आहेत", "no-tests-run": "कोणत्याही चाचण्या चालल्या नाहीत", @@ -1741,6 +1768,7 @@ "part-of": "चा भाग", "part-of-domain": "डोमेनचा भाग", "partial-coverage": "आंशिक कव्हरेज", + "partial-success": "आंशिक यश", "partition-lowercase-plural": "विभाजने", "partition-plural": "विभाजने", "partitioned": "विभाजित", @@ -1885,12 +1913,15 @@ "public-team": "सार्वजनिक टीम", "published": "प्रकाशित", "quality": "गुणवत्ता", + "queries-processed": "क्वेरी प्रक्रिया केल्या", + "queries-scanned": "क्वेरी स्कॅन केल्या", "query": "क्वेरी", "query-log-duration": "क्वेरी लॉग कालावधी", "query-lowercase": "क्वेरी", "query-lowercase-plural": "क्वेरी", "query-parameter-plural": "क्वेरी पॅरामीटर्स", "query-plural": "क्वेरी", + "query-plural-lowercase": "क्वेरी", "query-used-in": "क्वेरी वापरले", "queued": "रांगेत", "quick-add": "जलद जोडा", @@ -1902,11 +1933,13 @@ "range": "श्रेणी", "range-condition": "श्रेणी अट", "raw-connection-log": "Raw Connection Log", + "raw-logs": "रॉ लॉग", "rdf-predicate": "RDF प्रेडिकेट", "rdf-store": "RDF स्टोअर", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "पुन्हा नियुक्त करा", "re-deploy": "पुन्हा उपयोजित करा", + "re-deploy-sentence": "पुन्हा उपयोजित करा", "re-enter-new-password": "नवीन पासवर्ड पुन्हा प्रविष्ट करा", "re-index-all": "सर्व री-इंडेक्स करा", "re-index-elasticsearch": "एलॅस्टिकसर्च री-इंडेक्स करा", @@ -1924,6 +1957,7 @@ "recent-chat": "अलीकडील", "recent-event-plural": "अलीकडील घटना", "recent-run-plural": "अलीकडील धावा", + "recent-runs-sentence": "अलीकडील रन", "recent-search-term-plural": "अलीकडील शोध संज्ञा", "recent-views": "अलीकडील दृश्ये", "recently-created": "नुकतेच तयार केलेले", @@ -1931,6 +1965,8 @@ "recently-updated": "नुकतेच अद्यतनित केलेले", "recently-viewed": "अलीकडे पाहिलेले", "record-plural": "नोंदी", + "records": "रेकॉर्ड", + "records-processed": "रेकॉर्ड प्रक्रिया केले", "recreate-index-plural": "अनुक्रमणिका पुन्हा तयार करा", "reference-plural": "संदर्भ", "refocused-to-home": "मुख्यपृष्ठावर पुन्हा लक्ष केंद्रित केले", @@ -2071,6 +2107,7 @@ "run": "चालवा", "run-agent-plural": "एजेंट्स चलवा", "run-at": "येथे चालवा", + "run-history-and-details": "रन इतिहास आणि तपशील", "run-in-background": "Run in background", "run-now": "आता चालवा", "run-type": "चालवा प्रकार", @@ -2138,6 +2175,7 @@ "search-index-plural": "शोध अनुक्रमणिका", "search-index-setting-plural": "शोध अनुक्रमणिका सेटिंग्ज", "search-insights": "शोध अंतर्दृष्टी", + "search-logs": "लॉग शोधा", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "सामग्रीद्वारे स्मृती शोधा...", @@ -2248,6 +2286,7 @@ "show-nested": "नेस्टेड दर्शवा", "show-or-hide-advanced-config": "{{showAdv}} प्रगत संरचना दाखवा किंवा लपवा", "show-or-hide-column-plural": "स्तंभ दर्शवा / लपवा", + "show-raw-logs": "रॉ लॉग दाखवा", "showing-count-of-total-assets": "{{total}} पैकी {{count}} मालमत्ता दर्शवित आहे", "showing-total-failure-plural": "एकूण {{total}} अपयश", "sign-in": "साइन इन", @@ -2313,6 +2352,7 @@ "started": "प्रारंभ केले", "started-following": "अनुसरण करणे प्रारंभ केले", "starting-offset": "प्रारंभिक ऑफसेट", + "starts-after": "नंतर सुरू होते", "starts-with": "याने सुरू होते", "state": "अवस्था", "static": "स्थिर", @@ -2322,10 +2362,13 @@ "status-success": "यशस्वी", "stay-up-to-date": "अप-टू-डेट रहा", "step": "पाऊल", + "steps": "पायऱ्या", + "steps-lowercase": "पायऱ्या", "steward": "Steward", "stop": "थांबवा", "stop-re-index-all": "री-इंडेक्स थांबवा", "stopped": "थांबवले", + "stopped-lowercase": "थांबवले", "storage": "साठवण", "storage-plural": "साठवणी", "storage-service": "स्टोरेज सेवा", @@ -2500,6 +2543,7 @@ "to-perform": "करण्यासाठी", "to-service-name": "सेवा नाव", "to-service-type": "सेवा प्रकार", + "toggle-wrap": "रॅप टॉगल करा", "token": "Token", "token-end-point": "टोकन एंडपॉईंट", "token-expiration": "टोकन समाप्ती", @@ -2673,6 +2717,7 @@ "view-plural": "दृश्ये", "view-property-plural": "दृश्य गुणधर्म", "view-reindex-failure-plural": "पुनर्निर्देशांक अपयश पहा", + "view-run-history": "रन इतिहास पहा", "view-selected": "निवडलेले पहा", "visibility": "दृश्यमानता", "visibility-dataspace": "डेटा स्पेस", @@ -2685,8 +2730,10 @@ "volume-change": "खंड बदल", "wall-clock": "वास्तविक वेळ", "wants-to-access-your-account": "तुमच्या {{username}} खात्यात प्रवेश करू इच्छित आहे", + "warn": "इशारा", "warning": "इशारा", "warning-plural": "चेतावण्या", + "warning-plural-lowercase": "इशारे", "web-analytic-entity-view-report-data": "वेब विश्लेषण एंटिटी दृश्य रिपोर्ट डेटा", "web-analytic-user-activity-report-data": "वेब विश्लेषण वापरकर्ता गती रिपोर्ट डेटा", "web-analytics-report": "वेब विश्लेषण अहवाल", @@ -2722,6 +2769,8 @@ "workflow-plural": "कार्यप्रवाह", "worksheet": "वर्कशीट", "worksheet-plural": "वर्कशीट्स", + "wrap": "रॅप", + "wrapping-up": "आटोपत आहे", "year": "वर्ष", "yes": "होय", "yes-comma-confirm": "होय, पुष्टी करा", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "सिंटॅक्स संपादकासह आणि/किंवा अटींसह योग्य डेटा ॲसेट शोधा.", "agent-setup-description": "या एजंटसाठी मूलभूत मापदंड कॉन्फिगर करा.", + "agents-deploy-progress": "{{done}} पूर्ण · {{running}} चालू · {{queued}} रांगेत{{failedSuffix}} — या पहिल्या फेरीनंतर एजंट त्यांच्या वेळापत्रकानुसार चालतात", + "agents-deploying-ingesting": "एजंट मेटाडेटा उपयोजित आणि अंतर्भूत करत आहेत", + "agents-finished-summary": "{{total}} पैकी {{done}} एजंट पूर्ण झाले{{attentionSuffix}}", "aggregate-domain-type-description": "अनेक स्रोत-संरेखितांकडून डेटा गोळा आणि क्युरेट करणारे डोमेन एकत्रित डेटा आणि डेटा उत्पादने प्रदान करण्यासाठी, जसे की ग्राहक 360, ग्राहक सत्रे, इतर डोमेनसाठी वापरण्यासाठी.", "airflow-guide-message": "{{brandName}} एअरफ्लोचा वापर अंतर्ग्रहण कनेक्टर्स चालवण्यासाठी करते. आम्ही अंतर्ग्रहण कनेक्टर्स उपयोजित करण्यासाठी व्यवस्थापित API विकसित केले आहेत. कृपया ओपनमेटाडेटा एअरफ्लो उदाहरण वापरा किंवा व्यवस्थापित API आपल्या एअरफ्लो इंस्टॉलेशनमध्ये स्थापित करण्यासाठी खालील मार्गदर्शक पहा.", "airflow-host-ip-address": "{{brandName}} तुमच्या संसाधनाशी {{hostIp}} IP वरून कनेक्ट होईल. तुमच्या नेटवर्क सुरक्षा सेटिंग्जमध्ये इनबाउंड ट्रॅफिकला परवानगी द्या याची खात्री करा.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "तपशील पाहण्यासाठी <0>{{text}} क्लिक करा.", "closed-this-task": "हे कार्य बंद केले", "collaborate-with-other-user": "इतर वापरकर्त्यांसह सहयोग करण्यासाठी.", + "collate-ai-agents-description": "AI सह तुमचे अ‍ॅसेट स्वयं-टियर करा, दस्तऐवजीकरण करा आणि गुणवत्ता तपासा.", "collate-ai-widget-description": "सेवेसाठी कोलेट एआय द्वारे तयार केलेल्या डेटाचे विहंगावलोकन. <0>अधिक जाणून घ्या.", "column-bulk-operations-description": "एकाच वेळी अनेक स्तंभांचा मेटाडेटा व्यवस्थापित करा आणि संपादित करा. आपल्या डेटा असेट्समध्ये प्रदर्शन नावे, वर्णने, टॅग्ज आणि शब्दकोश संज्ञा शोधा, फिल्टर करा आणि अद्यतनित करा.", "column-filter-help-text": "स्तंभ टॅग किंवा नावांनुसार वंशावली फिल्टर करा. टॅग फिल्टरिंगसाठी 'tag:टॅगनाव' वापरा किंवा फक्त स्तंभाचे नाव प्रविष्ट करा.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "प्रवेश टोकन मिळवताना त्रुटी.", "establishing-connection-ellipsis": "कनेक्शन स्थापित करत आहे…", "events-matching-search-query": "शोध क्वेरीशी जुळणारे इव्हेंट", + "everything-healthy": "सर्व काही सुस्थितीत", "example-value": "उदा. {{value}}", "exclude-system-entity-description": "अक्षम केल्यावर, स्कीमामध्ये परिभाषित {{entity}} साठी डीफॉल्ट नमुने आपोआप लागू केले जातात.", "excludes-regex-line": "वगळतो += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "सूचना: वर्णन KPI लक्ष्य अद्याप पूर्ण झालेले नाही, परंतु अजूनही वेळ आहे – तुमच्या संस्थेकडे {{count}} दिवस शिल्लक आहेत. ट्रॅकवर राहण्यासाठी, कृपया डेटा अंतर्दृष्टी अहवाल सक्षम करा. हे आम्हाला सर्व टीम्सना साप्ताहिक अद्यतने पाठविण्याची परवानगी देईल, सहकार्य आणि आमच्या संस्थेच्या KPI साध्य करण्याच्या दिशेने लक्ष केंद्रित करेल.", "latency-sla-description": "<0>{{label}}: क्वेरी प्रतिसाद <0>{{data}} पेक्षा कमी असणे आवश्यक", "latest-offset-description": "सिस्टममधील घटनेचे नवीनतम ऑफसेट.", + "latest-run-lines": "अलीकडील रन · {{count}} ओळी", "ldap-group-dn-placeholder": "उदा. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "हा LDAP ग्रुप DN आधीच मॅप केला आहे. प्रत्येक LDAP ग्रुप फक्त एकदाच मॅप केला जाऊ शकतो.", "learning-resources-management-description": "उत्पादन वैशिष्ट्ये एक्सप्लोर करा आणि आमच्या संसाधनांद्वारे ते कसे कार्य करतात ते शिका", + "leave-page-ingestion-continues": "तुम्ही हे पृष्ठ सोडू शकता — अंतर्भूतीकरण पार्श्वभूमीत सुरू राहते", "leave-the-team-team-name": "टीम {{teamName}} सोडा", "length-validator-error": "किमान {{length}} {{field}} आवश्यक", "lineage-ingestion-description": "वंशावळ अंतर्ग्रहण मेटाडेटा अंतर्ग्रहण सेट केल्यानंतर कॉन्फिगर आणि तैनात केले जाऊ शकते. वंशावळ अंतर्ग्रहण कार्यप्रवाह क्वेरी इतिहास प्राप्त करतो, CREATE, INSERT, MERGE... क्वेरी पार्स करतो आणि संबंधित घटकांमधील वंशावळ तयार करतो. वंशावळ अंतर्ग्रहणासाठी डेटाबेस सेवेसाठी फक्त एक पाइपलाइन असू शकते. प्रारंभ करण्यासाठी क्वेरी लॉग कालावधी (दिवसांत) आणि परिणाम मर्यादा परिभाषित करा.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "आज आपण काय विश्लेषण करू इच्छिता?", "mcp-chat-placeholder": "काहीही विचारा...", "mentioned-you-on-the-lowercase": "तुमचा उल्लेख केला", + "metadata-agents-description": "स्रोतातून मेटाडेटा, वापर, वंशावळ आणि प्रोफाइलिंग काढा.", "metadata-agents-table-description": "मेटाडेटा एजेंट्स स्रोत सेवांमधून मेटाडेटा निकालण्यासाठी वापरले जातात.", "metadata-ingestion-description": "निवडलेल्या सेवा प्रकारावर आधारित, योजना किंवा टेबल (डेटाबेस), किंवा विषय (संदेशवहन), किंवा डॅशबोर्डसाठी फिल्टर पॅटर्न तपशील प्रविष्ट करा. तुम्ही फिल्टर पॅटर्न समाविष्ट किंवा वगळू शकता. दृश्ये समाविष्ट करण्यासाठी निवडा, डेटा प्रोफाइलर सक्षम किंवा अक्षम करा आणि आवश्यकतेनुसार नमुना डेटा अंतर्ग्रहण करा.", "metadata-status-complete-description": "मेटाडेटा सर्व स्तंभांमध्ये पूर्ण भरलेला आणि सुसंगत आहे", @@ -3392,6 +3449,8 @@ "minimum-count-error": "किमान {{count}} {{field}} निवडणे आवश्यक आहे.", "minimum-value-error": "किमान मूल्य कमाल मूल्यापेक्षा लहान असावे.", "minute": "मिनिट", + "minutes-left": "~{{count}} मिनिटे शिल्लक", + "minutes-short": "{{count}} मिनिटे", "missing-config-value": "कॉन्फिगरेशन व्हॅल्यू गहाळ आहे: {{field}}", "missing-description": "वर्णन गहाळ", "modified-time-ago-by": "{{time}} पूर्व {{by}} द्वारे संशोधित", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "कोणतेही LDAP भूमिका मॅपिंग कॉन्फिगर केलेले नाही.", "no-learning-resources-available": "या संदर्भासाठी कोणतीही शिक्षण संसाधने उपलब्ध नाहीत.", "no-lineage-available": "कोणतेही lineage कनेक्शन सापडले नाहीत", + "no-lines-match": "कोणतीही ओळ जुळत नाही.", "no-match-found": "कोणतेही जुळणारे सापडले नाही", "no-mentions": "असे दिसते की तुम्ही आणि तुमची टीम सर्व स्पष्ट आहात – कोणत्याही क्रियाकलापांमध्ये कोणतेही उल्लेख नाहीत. उत्तम काम करत रहा!", "no-native-fields": "या एंटिटी प्रकारासाठी कोणतीही कॉन्फिगर करण्यायोग्य मूळ फील्ड नाहीत.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "प्रोफाइलर वर्कफ्लो चालवून आपल्या टेबलच्या मेट्रिक्स अन्वेषण करा. आपण पंक्तीची संख्या, टेबल अद्यतने, व्हॉल्यूम बदल, आणि अधिक पाहणार आहात. सेटअप स्टेप्ससाठी आमच्या संदर्भासाठी आमच्या दस्तऐवजावर भेट द्या ", "no-profiler-title": "टेबल अंतर्दृष्टी अनलॉक करण्यासाठी प्रोफाइलर चालवा", "no-properties-added": "No properties added.", + "no-recent-runs": "अलीकडील रन आढळले नाहीत.", "no-recently-viewed-data": "तुम्ही अलीकडे कोणतेही डेटा ॲसेट पाहिलेले नाहीत. काहीतरी मनोरंजक शोधण्यासाठी एक्सप्लोर करा!", "no-reference-available": "कोणतेही संदर्भ उपलब्ध नाहीत.", "no-related-terms-available": "संबंधित संज्ञा उपलब्ध नाहीत.", @@ -3638,6 +3699,7 @@ "password-error-message": "पासवर्ड किमान 8 आणि कमाल 56 वर्णांचा असावा आणि त्यात किमान एक मोठा अक्षर (A-Z), एक लहान अक्षर (a-z), एक संख्या आणि एक विशेष वर्ण (जसे की !, %, @, किंवा #) असावा", "password-pattern-error": "पासवर्ड किमान 8 आणि कमाल 56 वर्णांचा असावा, ज्यात एक विशेष, एक मोठा, एक लहान अक्षर असावा", "path-of-the-dbt-files-stored": "dbt फाइल्स जिथे संग्रहित केल्या आहेत त्या फोल्डरचा पथ", + "percent-complete-all-agents": "सर्व एजंटमध्ये {{percent}}% पूर्ण", "permanently-delete-common-message": "हा {{entity}} आणि त्याचा सर्व मेटाडेटा कायमचा हटवा. हे पूर्ववत करता येणार नाही.", "permanently-delete-ingestion-pipeline": "हे <0>{{entityName}} कायमचे मिटवल्याने पाइपलाइन संरचना गमावली जाईल आणि ती पुनर्प्राप्त केली जाऊ शकत नाही.", "permanently-delete-metadata": "हे <0>{{entityName}} कायमचे मिटवल्याने त्याचे मेटाडेटा {{brandName}} मधून काढले जाईल आणि ते पुनर्प्राप्त केले जाऊ शकत नाही.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "वापर डेटा प्रक्रिया करण्यासाठी क्वेरी लॉगमध्ये मागे पाहण्याची किती दूर ट्यून करायची हे कॉन्फिगरेशन.", "query-used-by-other-tables": "इतर टेबल्सद्वारे वापरलेली क्वेरी", "quick-add-tip": "आलेख न सोडता शब्दकोश संज्ञा संबंध तयार करण्यासाठी \"जलद जोडा\" वापरा.", + "ran-for-duration": "{{duration}} मिनिटे चालले", "rdf-not-enabled-for-export": "ऑन्टोलॉजी निर्यात करण्यासाठी RDF सक्षम असणे आवश्यक आहे. कृपया आपल्या सर्व्हर कॉन्फिगरेशनमध्ये RDF सक्षम करा.", "rdf-predicate-tooltip": "लिंक्ड डेटा सिमेंटिक्ससाठी RDF प्रेडिकेट URI (उदा. skos:broader)", "reacted-with-emoji": "{{type}} इमोजीसह प्रतिक्रिया दिली", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}{{data}}{{hostIp}}. Zorg ervoor dat u inkomend verkeer toestaat in uw netwerkbeveiligingsinstellingen.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Klik op <0>{{text}} om details te bekijken.", "closed-this-task": "heeft deze taak gesloten", "collaborate-with-other-user": "om samen te werken met andere gebruikers.", + "collate-ai-agents-description": "Wijs automatisch tiers toe, documenteer en controleer de kwaliteit van je assets met AI.", "collate-ai-widget-description": "Overzicht van de data gegenereerd door de Collate AI voor de service. <0>meer informatie.", "column-bulk-operations-description": "Beheer en bewerk metadata voor meerdere kolommen tegelijk.Zoek, filter en update weergavenamen, beschrijvingen, tags en woordenlijsttermen in uw gegevensassets.", "column-filter-help-text": "Filter afkomst op kolomtags of namen. Gebruik 'tag:TagNaam' voor tagfiltering of voer gewoon de kolomnaam in.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Fout bij het ophalen van toegangstoken.", "establishing-connection-ellipsis": "Verbinding tot stand brengen…", "events-matching-search-query": "Gebeurtenissen die overeenkomen met de zoekopdracht", + "everything-healthy": "alles in orde", "example-value": "bijv. {{value}}", "exclude-system-entity-description": "Wanneer uitgeschakeld, worden de standaard in het schema gedefinieerde patronen voor {{entity}} automatisch toegepast.", "excludes-regex-line": "sluit uit += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Maakt niet uit. Het is tijd om je doelen te herstructureren en sneller vooruitgang te boeken.", "latency-sla-description": "<0>{{label}}: Reactietijd van de query moet onder <0>{{data}} liggen.", "latest-offset-description": "De laatste offset van de gebeurtenis in het systeem.", + "latest-run-lines": "Laatste uitvoering · {{count}} regels", "ldap-group-dn-placeholder": "bijv. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Deze LDAP-groep DN is al toegewezen. Elke LDAP-groep kan slechts één keer worden toegewezen.", "learning-resources-management-description": "Ontdek productfuncties en leer hoe ze werken via onze bronnen", + "leave-page-ingestion-continues": "Je kunt deze pagina verlaten — de opname gaat op de achtergrond door", "leave-the-team-team-name": "Verlaat het team {{teamName}}", "length-validator-error": "Minimaal {{length}} {{field}} vereist", "lineage-ingestion-description": "Lineage-ingestie kan worden geconfigureerd en ingezet nadat een metadataingestie is ingesteld. De lineage-ingestieworkflow verkrijgt de querygeschiedenis, analyseert CREATE, INSERT, MERGE... queries en bereidt de lineage voor tussen de betrokken entiteiten. Lineage-ingestie kan slechts één pipeline hebben voor een databaseservice. Definieer de duur van de querylog (in dagen) en het resultaatlimiet om te beginnen.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "Wat wilt u vandaag analyseren?", "mcp-chat-placeholder": "Vraag alles...", "mentioned-you-on-the-lowercase": "noemde je op de", + "metadata-agents-description": "Haal metadata, gebruik, herkomst en profilering uit de bron.", "metadata-agents-table-description": "Metadata Agents worden gebruikt om metadata te extraheren uit de bronservices.", "metadata-ingestion-description": "Voer op basis van het geselecteerde servicetype de filterpatroondetails in voor het schema of de tabel (database), of het onderwerp (berichten), of dashboard. Je kunt de filterpatronen opnemen of uitsluiten. Kies ervoor om weergaven op te nemen, de dataprofiler in of uit te schakelen, en voorbeelddata te ingesten, zoals vereist.", "metadata-status-complete-description": "Metadata is volledig ingevuld en consistent in alle kolommen", @@ -3392,6 +3449,8 @@ "minimum-count-error": "Er moet minimaal {{count}} {{field}} worden geselecteerd.", "minimum-value-error": "De minimale waarde moet kleiner zijn dan de maximale waarde.", "minute": "Minuut", + "minutes-left": "~nog {{count}} min", + "minutes-short": "{{count}} min", "missing-config-value": "Ontbrekende configuratiewaarde: {{field}}", "missing-description": "Beschrijving ontbreekt", "modified-time-ago-by": "Aangepast {{time}} geleden door {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "Geen LDAP-roltoewijzingen geconfigureerd.", "no-learning-resources-available": "Geen leermiddelen beschikbaar voor deze context.", "no-lineage-available": "Geen lineage-connecties gevonden", + "no-lines-match": "Geen overeenkomende regels.", "no-match-found": "Geen overeenkomst gevonden", "no-mentions": "Er zijn geen gevallen waarin jij of jouw team zijn genoemd in activiteiten", "no-native-fields": "Geen configureerbare native velden voor dit entiteitstype.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Ontdek de metrieken van uw tabel door de profiler-werkstroom uit te voeren. U zult het aantal rijen, tabelupdates, volumewijzigingen en meer zien. Bezoek onze documentatie voor de installatiestappen ", "no-profiler-title": "Voer Profiler uit om tabelinzichten te ontgrendelen", "no-properties-added": "No properties added.", + "no-recent-runs": "Geen recente uitvoeringen gevonden.", "no-recently-viewed-data": "Geen recent bekeken data.", "no-reference-available": "Geen referenties beschikbaar.", "no-related-terms-available": "Geen gerelateerde termen beschikbaar.", @@ -3638,6 +3699,7 @@ "password-error-message": "Het wachtwoord moet minimaal 8 en maximaal 56 tekens lang zijn en ten minste één hoofdletter (A-Z), één kleine letter (a-z), één cijfer en één speciaal teken (zoals !, %, @ of #) bevatten", "password-pattern-error": "Wachtwoord moet minimaal 8 en maximaal 56 tekens lang zijn, met één speciaal teken, één hoofdletter, één kleine letter", "path-of-the-dbt-files-stored": "Pad naar de map waarin de dbt-bestanden zijn opgeslagen", + "percent-complete-all-agents": "{{percent}}% voltooid voor alle agents", "permanently-delete-common-message": "Verwijder deze {{entity}} en alle bijbehorende metadata voorgoed. Dit kan niet ongedaan worden gemaakt.", "permanently-delete-ingestion-pipeline": "Als u deze <0>{{entityName}} definitief verwijdert, gaat de pijplijnconfiguratie verloren en kan deze niet worden hersteld.", "permanently-delete-metadata": "Het permanent verwijderen van deze <0>{{entityName}} verwijdert de metadata ervan permanent uit {{brandName}}.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Configuratie om in te stellen hoe ver we willen terugkijken in querylogs om gebruiksdata te verwerken.", "query-used-by-other-tables": "Query gebruikt door andere tabellen", "quick-add-tip": "Gebruik Snel Toevoegen om glossariumtermrelaties aan te maken zonder de graf te verlaten.", + "ran-for-duration": "uitgevoerd gedurende {{duration}} min", "rdf-not-enabled-for-export": "RDF moet ingeschakeld zijn om de ontologie te exporteren. Schakel RDF in via uw serverconfiguratie.", "rdf-predicate-tooltip": "De RDF-predicaat-URI voor dit relatietype (bijv. skos:broader, skos:exactMatch).", "reacted-with-emoji": "reageerde met {{type}} emoji", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Gegevens moeten bewaard worden voor <0>{{data}}.", "run-sample-data-to-ingest-sample-data": "'Voer voorbeelddata uit om voorbeeld-data-assets te ingesten in je {{brandName}}.'", "run-status-at-timestamp": "Uitvoerstatus: {{status}} op {{timestamp}}", + "run-status-click-details": "{{status}} uitvoering · klik voor details", "run-successful-test-to-continue": "Voer een geslaagde test uit om door te gaan.", "sample-data-ingestion-config-description": "Dit schema definieert de parameters die kunnen worden doorgegeven voor het verzamelen van voorbeeldgegevens.", "schedule-description": "Plan de ingestie om op een specifiek tijdstip en frequentie te draaien.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Bekijk zoekclusterstatistieken, indexdetails en beheer weesindexen.", "search-settings-description": "Zoekinstellingen voor elke entiteit gebaseerd op rankings.", "search-settings-for-entity": "Zoekinstellingen gebaseerd op ranking voor {{entity}}", + "seconds-left": "~nog {{count}}s", + "seconds-short": "{{count}}s", "see-also": "Zie ook", "see-how-to-get-started": "Zie hoe je kunt beginnen", "select-alert-type": "Selecteer een alerttype", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json index 663ac6e7b2b3..d80ec52af199 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json @@ -97,6 +97,7 @@ "advanced-configuration": "پیکربندی پیشرفته", "advanced-entity": "{{entity}} پیشرفته", "advanced-search": "جستجوی پیشرفته", + "agent": "عامل", "agent-activity": "فعالیت عامل", "agent-plural": "Agentes", "agent-setup": "Configuração do agente", @@ -189,6 +190,8 @@ "asset-plural": "دارایی‌ها", "asset-plural-lowercase": "دارایی‌ها", "asset-type": "نوع دارایی", + "assets-ingested": "دارایی‌های دریافت‌شده", + "assets-profiled": "دارایی‌های پروفایل‌شده", "assigned": "اختصاص داده شد", "assigned-entity": "{{entity}} اختصاص داده شد", "assigned-to-me": "اختصاص داده شده به من", @@ -248,6 +251,7 @@ "basic-configuration": "پیکربندی پایه", "batch-size": "اندازه دسته", "bearer-hmac-signature": "Bearer (امضای HMAC)", + "before-error": "پیش از خطا", "before-number-of-day-plural": "قبل از {{ numberOfDays}} روز", "belongs-to": "متعلق به", "belongs-to-database": "متعلق به پایگاه داده", @@ -369,6 +373,7 @@ "collapse": "فروپاشی", "collapse-all": "فروپاشی همه", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "عامل‌های Collate AI", "collection": "مجموعه", "collection-plural": "مجموعه‌ها", "color": "رنگ", @@ -492,7 +497,7 @@ "cost-analysis": "تحلیل هزینه", "count": "شمارش", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} در حال اجرا", "cover-image": "جلد", "covered": "پوشش داده‌شده", "create": "ایجاد", @@ -664,12 +669,14 @@ "dbt-source": "منبع dbt", "dbt-source-project": "پروژه منبع dbt", "deactivated": "غیرفعال شده", + "debug": "اشکال‌زدایی", "december": "دسامبر", "decision": "تصمیم", "default": "پیش‌فرض", "default-persona": "شخصیت پیش‌فرض", "default-role": "نقش پیش‌فرض", "delete": "حذف", + "delete-agent": "حذف عامل", "delete-all-nodes": "حذف همه گره‌ها", "delete-boost": "حذف تقویت", "delete-data-asset-rule": "حذف قانون دارایی داده", @@ -697,6 +704,7 @@ "deployed": "مستقر شد", "deployed-lowercase": "مستقر شد", "deploying-lowercase": "در حال استقرار", + "deployment-complete": "استقرار کامل شد", "deprecate": "Deprecate", "depth": "عمق", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "جزئیات", "details": "جزئیات", "developed-by-developer": "توسعه یافته توسط {{developer}}", + "diagnose": "تشخیص", "diagnostic-info": "اطلاعات تشخیصی", "did-not-run": "اجرا نشد", "dimension": "بُعد", @@ -784,6 +793,7 @@ "drive-plural": "درایوها", "duplicate": "تکراری", "duration": "مدت زمان", + "duration-in-minute": "{{duration}} دقیقه", "dynamic": "Dinâmico", "dynamic-assertion": "ادعای پویا", "edge": "لبه", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "ویرایش و پذیرش پیشنهاد", "edit-an-announcement": "ویرایش یک اعلان", "edit-chart-name": "ویرایش نمودار: \"{{name}}\"", + "edit-configuration": "ویرایش پیکربندی", "edit-connection": "Edit Connection", "edit-data-asset-rule": "ویرایش قانون دارایی داده", "edit-description-for": "ویرایش توضیحات برای {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "معادل", "error": "خطا", "error-plural": "خطاها", + "error-plural-lowercase": "خطاها", "esc": "Esc", + "est-remaining": "زمان تقریبی باقی‌مانده", "establish-connection": "Establish Connection", "evaluate": "ارزیابی", "evaluate-permission": "ارزیابی مجوز", @@ -972,8 +985,10 @@ "factor": "عامل", "fail-on-conflict": "شکست در صورت تعارض", "failed": "ناموفق", + "failed-at": "ناموفق در", "failed-entity": "{{entity}} ناموفق", "failed-event-plural": "رویدادهای ناموفق", + "failed-lowercase": "ناموفق", "failed-rows": "ردیف‌های ناموفق", "failed-slash-aborted-reason": "Razón de fallo/aborto", "failed-to-upload-file": "نا موفق در بارگذاری فایل", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Padrões de filtro", "filter-plural": "فیلترها", "filtered": "فیلتر شده", + "filtered-lowercase": "فیلترشده", "filtering-condition": "شرط فیلتر", "filters-configuration": "پیکربندی فیلترها", + "finished": "پایان‌یافته", + "finished-lowercase": "پایان‌یافته", "first": "اولین", "first-lowercase": "اولین", "first-name": "نام", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "پنهان کردن تنظیمات جعل هویت ({{count}})", "hide-meta-details": "مخفی‌سازی جزئیات متا", "hide-property-plural": "مخفی کردن ویژگی‌ها", + "hide-raw-logs": "پنهان کردن گزارش‌های خام", "hierarchical": "سلسله‌مراتبی", "hierarchy": "سلسله‌مراتب", "hierarchy-depth": "عمق سلسله‌مراتب", @@ -1170,6 +1189,7 @@ "homepage": "صفحه اصلی", "hour": "ساعت", "hourly": "ساعتی", + "how-to-fix": "نحوه رفع", "http-config-source": "منبع پیکربندی HTTP", "http-method": "روش HTTP", "hybrid-search-weight-plural": "وزن‌های جستجوی ترکیبی", @@ -1226,6 +1246,7 @@ "index-name": "نام شاخص", "index-states": "وضعیت‌های ایندکس", "indirect": "غیرمستقیم", + "info": "اطلاعات", "ingest-sample-data": "وارد کردن داده نمونه", "ingestion": "ورود", "ingestion-lowercase": "ورود", @@ -1297,6 +1318,7 @@ "keyword": "کلمه کلیدی", "keyword-lowercase-plural": "کلمات کلیدی", "kill": "کشتن", + "kill-run": "توقف اجرا", "knowledge": "دانش", "knowledge-article-plural": "مقالات دانش", "knowledge-center": "مرکز دانش", @@ -1508,7 +1530,9 @@ "model": "مدل", "model-name": "نام مدل", "model-plural": "مدل‌ها", + "model-plural-lowercase": "مدل‌ها", "model-store": "ذخیره‌ساز مدل", + "models-parsed": "مدل‌های تجزیه‌شده", "modified-time": "زمان تغییر", "modifier": "تغییر دهنده", "monday": "دوشنبه", @@ -1517,6 +1541,7 @@ "monthly": "ماهانه", "more": "بیشتر", "more-action": "اقدامات بیشتر", + "more-action-plural": "اقدامات بیشتر", "more-actions": "اعمال بیشتر", "more-help": "کمک بیشتر", "more-lowercase": "بیشتر", @@ -1554,6 +1579,7 @@ "native-field-plural": "فیلدهای بومی", "navigation": "ناوبری", "navigation-menu-plural": "Menús de navegación", + "need-attention": "نیازمند توجه", "need-help": "نیاز به کمک", "needs-attention": "نیاز به توجه", "needs-review": "نیاز به بررسی", @@ -1605,6 +1631,7 @@ "no-records": "بدون رکورد", "no-result-found": "نتیجه‌ای یافت نشد.", "no-reviewer": "بدون بازبین", + "no-status": "بدون وضعیت", "no-tags-added": "بدون برچسب افزوده شده", "no-tasks-yet": "هنوز وظیفه‌ای ندارید", "no-tests-run": "هیچ آزمایشی اجرا نشده است", @@ -1741,6 +1768,7 @@ "part-of": "بخشی از", "part-of-domain": "بخشی از دامنه", "partial-coverage": "پوشش جزئی", + "partial-success": "موفقیت جزئی", "partition-lowercase-plural": "پارتیشن‌ها", "partition-plural": "پارتیشن‌ها", "partitioned": "پارتیشن‌بندی شده", @@ -1885,12 +1913,15 @@ "public-team": "تیم عمومی", "published": "منتشر شده", "quality": "کیفیت", + "queries-processed": "پرس‌وجوهای پردازش‌شده", + "queries-scanned": "پرس‌وجوهای اسکن‌شده", "query": "پرس و جو", "query-log-duration": "مدت زمان لاگ پرس و جو", "query-lowercase": "پرس و جو", "query-lowercase-plural": "پرس و جوها", "query-parameter-plural": "پارامترهای کوئری", "query-plural": "پرس و جوها", + "query-plural-lowercase": "پرس‌وجوها", "query-used-in": "پرس و جو استفاده شده در", "queued": "در صف", "quick-add": "افزودن سریع", @@ -1902,11 +1933,13 @@ "range": "محدوده", "range-condition": "شرط محدوده", "raw-connection-log": "Raw Connection Log", + "raw-logs": "گزارش‌های خام", "rdf-predicate": "گزاره RDF", "rdf-store": "RDF Store", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "دوباره تخصیص دهید", "re-deploy": "دوباره منتشر کنید", + "re-deploy-sentence": "استقرار مجدد", "re-enter-new-password": "رمز عبور جدید را دوباره وارد کنید", "re-index-all": "بازسازی تمام شاخص‌ها", "re-index-elasticsearch": "بازسازی شاخص‌های Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "اخیر", "recent-event-plural": "رویدادهای اخیر", "recent-run-plural": "اجرای اخیر", + "recent-runs-sentence": "اجراهای اخیر", "recent-search-term-plural": "اصطلاحات جستجوی اخیر", "recent-views": "بازدیدهای اخیر", "recently-created": "اخیراً ایجاد شده", @@ -1931,6 +1965,8 @@ "recently-updated": "اخیراً بروزرسانی شده", "recently-viewed": "اخیراً مشاهده شده", "record-plural": "رکوردها", + "records": "رکوردها", + "records-processed": "رکوردهای پردازش‌شده", "recreate-index-plural": "بازسازی شاخص‌ها", "reference-plural": "مراجع", "refocused-to-home": "مجدداً روی صفحه اصلی متمرکز شد", @@ -2071,6 +2107,7 @@ "run": "اجرا", "run-agent-plural": "اجرای عامل‌ها", "run-at": "اجرا در", + "run-history-and-details": "تاریخچه و جزئیات اجرا", "run-in-background": "Run in background", "run-now": "الان اجرا کنید", "run-type": "نوع اجرا", @@ -2138,6 +2175,7 @@ "search-index-plural": "شاخص‌های جستجو", "search-index-setting-plural": "تنظیمات شاخص جستجو", "search-insights": "بینش‌های جستجو", + "search-logs": "جستجوی گزارش‌ها", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "جستجوی خاطرات با محتوا...", @@ -2248,6 +2286,7 @@ "show-nested": "نمایش تودرتو", "show-or-hide-advanced-config": "{{showAdv}} پیکربندی پیشرفته", "show-or-hide-column-plural": "نمایش / مخفی کردن ستون‌ها", + "show-raw-logs": "نمایش گزارش‌های خام", "showing-count-of-total-assets": "نمایش {{count}} از {{total}} دارایی", "showing-total-failure-plural": "مجموع {{total}} خطا", "sign-in": "ورود", @@ -2313,6 +2352,7 @@ "started": "شروع شد", "started-following": "شروع به دنبال کردن شد", "starting-offset": "آفست شروع", + "starts-after": "شروع پس از", "starts-with": "começa com", "state": "Estado", "static": "Estático", @@ -2322,10 +2362,13 @@ "status-success": "موفق", "stay-up-to-date": "در جریان بمانید", "step": "مرحله", + "steps": "مراحل", + "steps-lowercase": "مراحل", "steward": "Steward", "stop": "توقف", "stop-re-index-all": "متوقف کردن دوباره ایندکس", "stopped": "متوقف شد", + "stopped-lowercase": "متوقف‌شده", "storage": "ذخیره‌سازی", "storage-plural": "ذخیره‌سازی‌ها", "storage-service": "سرویس ذخیره‌سازی", @@ -2500,6 +2543,7 @@ "to-perform": "به انجام", "to-service-name": "به نام سرویس", "to-service-type": "به نوع سرویس", + "toggle-wrap": "تغییر شکستن خط", "token": "Token", "token-end-point": "نقطه پایان توکن", "token-expiration": "انقضای توکن", @@ -2673,6 +2717,7 @@ "view-plural": "مشاهدات", "view-property-plural": "مشاهده ویژگی‌ها", "view-reindex-failure-plural": "مشاهده خطاهای فهرست‌بندی مجدد", + "view-run-history": "مشاهده تاریخچه اجرا", "view-selected": "مشاهده موارد انتخاب‌شده", "visibility": "قابلیت مشاهده", "visibility-dataspace": "فضای داده", @@ -2685,8 +2730,10 @@ "volume-change": "تغییر حجم", "wall-clock": "زمان واقعی", "wants-to-access-your-account": "می‌خواهد به حساب {{username}} شما دسترسی پیدا کند", + "warn": "هشدار", "warning": "هشدار", "warning-plural": "هشدارها", + "warning-plural-lowercase": "هشدارها", "web-analytic-entity-view-report-data": "داده‌های گزارش نمای موجودیت تحلیل وب", "web-analytic-user-activity-report-data": "داده‌های گزارش فعالیت کاربر تحلیل وب", "web-analytics-report": "گزارش تحلیل وب", @@ -2722,6 +2769,8 @@ "workflow-plural": "جریان‌های کاری", "worksheet": "برگه کار", "worksheet-plural": "برگه‌های کار", + "wrap": "شکستن خط", + "wrapping-up": "در حال جمع‌بندی", "year": "سال", "yes": "بله", "yes-comma-confirm": "بله، تأیید", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "داده‌های صحیح را با استفاده از ویرایشگر نحوی با شرایط و/یا کشف کنید.", "agent-setup-description": "Configure os parâmetros principais deste agente.", + "agents-deploy-progress": "{{done}} انجام‌شده · {{running}} در حال اجرا · {{queued}} در صف{{failedSuffix}} — عامل‌ها پس از این گذر اول طبق برنامه زمان‌بندی خود اجرا می‌شوند", + "agents-deploying-ingesting": "عامل‌ها در حال استقرار و دریافت فراداده", + "agents-finished-summary": "{{done}} از {{total}} عامل پایان یافت{{attentionSuffix}}", "aggregate-domain-type-description": "دامنه‌هایی که داده‌ها را از منابع مختلف جمع‌آوری و سامان‌دهی می‌کنند تا داده‌های تجمعی و محصولات داده‌ای، مانند Customer 360، جلسات مشتریان و غیره، برای مصرف دیگر دامنه‌ها ارائه دهند.", "airflow-guide-message": "{{brandName}} از Airflow برای اجرای متصل‌کننده‌های ورود استفاده می‌کند. ما API‌های مدیریت‌شده‌ای برای استقرار متصل‌کننده‌های ورود توسعه داده‌ایم. لطفاً از نمونه Airflow {{brandName}} استفاده کنید یا به راهنمای زیر مراجعه کنید تا API‌های مدیریت‌شده را در نصب Airflow خود نصب کنید.", "airflow-host-ip-address": "{{brandName}} از IP <0>{{hostIp}} به منبع شما متصل خواهد شد. مطمئن شوید که ترافیک ورودی را در تنظیمات امنیتی شبکه خود مجاز کنید.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "برای مشاهده جزئیات، روی <0>{{text}} کلیک کنید.", "closed-this-task": "این وظیفه را بست.", "collaborate-with-other-user": "برای همکاری با کاربران دیگر.", + "collate-ai-agents-description": "با هوش مصنوعی دارایی‌های خود را به‌طور خودکار سطح‌بندی، مستندسازی و بررسی کیفیت کنید.", "collate-ai-widget-description": "نمای کلی داده‌های تولید شده توسط Collate AI برای سرویس. <0>بیشتر بدانید.", "column-bulk-operations-description": "مدیریت و ویرایش فراداده‌ها برای چندین ستون به طور همزمان. نام‌های نمایشی، توضیحات، برچسب‌ها و اصطلاحات فرهنگ‌نامه را در دارایی‌های داده خود جستجو، فیلتر و به‌روزرسانی کنید.", "column-filter-help-text": "Filtre a linhagem por tags ou nomes de colunas. Use 'tag:NomeTag' para filtragem por tag ou apenas digite o nome da coluna.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "خطا در دریافت توکن دسترسی.", "establishing-connection-ellipsis": "در حال برقراری اتصال…", "events-matching-search-query": "رویدادهای مطابق با عبارت جستجو", + "everything-healthy": "همه چیز سالم است", "example-value": "مثال: {{value}}", "exclude-system-entity-description": "هنگامی که غیرفعال است، الگوهای پیش‌فرض تعریف‌شده در طرح‌واره برای {{entity}} به‌صورت خودکار اعمال می‌شوند.", "excludes-regex-line": "استثنا می‌کند += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "توجه: هدف KPI هنوز محقق نشده است، اما هنوز زمان باقیست – سازمان شما {{count}} روز فرصت دارد. برای حفظ مسیر، لطفاً گزارش بینش داده را فعال کنید. این امکان را برای ما فراهم می‌کند که به‌روزرسانی‌های هفتگی را به تمامی تیم‌ها ارسال کنیم تا همکاری و تمرکز به سمت دستیابی به KPI‌های سازمانی حفظ شود.", "latency-sla-description": "<0>{{label}}: پاسخ پرس‌وجو باید کمتر از <0>{{data}} باشد.", "latest-offset-description": "آخرین آفست رویداد در سیستم.", + "latest-run-lines": "آخرین اجرا · {{count}} خط", "ldap-group-dn-placeholder": "مثلاً cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "این DN گروه LDAP قبلاً نگاشت شده است. هر گروه LDAP فقط یک بار قابل نگاشت است.", "learning-resources-management-description": "ویژگی‌های محصول را کشف کنید و از طریق منابع ما یاد بگیرید که چگونه کار می‌کنند", + "leave-page-ingestion-continues": "می‌توانید این صفحه را ترک کنید — دریافت داده در پس‌زمینه ادامه می‌یابد", "leave-the-team-team-name": "تیم {{teamName}} را ترک کنید.", "length-validator-error": "حداقل {{length}} {{field}} لازم است.", "lineage-ingestion-description": "استخراج lineage می‌تواند پس از تنظیم یک فرآیند استخراج متادیتا پیکربندی و پیاده‌سازی شود. جریان کاری استخراج lineage تاریخچه درخواست‌ها را به‌دست می‌آورد، درخواست‌های CREATE، INSERT، MERGE و... را تجزیه و تحلیل می‌کند و lineage بین موجودیت‌های دخیل را آماده می‌کند. فرآیند استخراج lineage می‌تواند فقط یک لوله داده برای یک سرویس پایگاه داده داشته باشد. مدت زمان لاگ درخواست و محدودیت نتیجه را تعیین کنید تا شروع شود.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "امروز چه چیزی می‌خواهید تحلیل کنید؟", "mcp-chat-placeholder": "هر چیزی بپرسید...", "mentioned-you-on-the-lowercase": "شما را در {{entity}} ذکر کرده است.", + "metadata-agents-description": "استخراج فراداده، استفاده، تبارشناسی و پروفایل‌سازی از منبع.", "metadata-agents-table-description": "عوامل متادیتا برای استخراج متادیتا از سرویس‌های منبع استفاده می‌شوند.", "metadata-ingestion-description": "بر اساس نوع سرویسی که انتخاب کرده‌اید، جزئیات الگوی فیلتر برای طرح یا جدول (پایگاه داده)، یا موضوع (پیام‌رسانی)، یا داشبورد وارد کنید. می‌توانید الگوهای فیلتر را شامل کنید یا حذف کنید. انتخاب کنید که آیا می‌خواهید نماها را شامل کنید، پروفایل داده را فعال یا غیرفعال کنید و داده نمونه را استخراج کنید.", "metadata-status-complete-description": "فراداده به‌طور کامل پر شده و در همه ستون‌ها سازگار است", @@ -3392,6 +3449,8 @@ "minimum-count-error": "حداقل {{count}} {{field}} باید انتخاب شود.", "minimum-value-error": "مقدار حداقل باید کوچکتر از مقدار حداکثر باشد.", "minute": "دقیقه", + "minutes-left": "~{{count}} دقیقه باقی‌مانده", + "minutes-short": "{{count}} دقیقه", "missing-config-value": "مقدار پیکربندی گم شده: {{field}}", "missing-description": "توضیحات موجود نیست", "modified-time-ago-by": "{{time}} قبل از {{by}} تغییر کرد", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "هیچ نگاشت نقش LDAP پیکربندی نشده است.", "no-learning-resources-available": "Arrr! No treasures of knowledge be found fer this here context.", "no-lineage-available": "هیچ اتصال lineage یافت نشد", + "no-lines-match": "هیچ خطی مطابقت ندارد.", "no-match-found": "هیچ تطبیقی یافت نشد.", "no-mentions": "به نظر می‌رسد شما و تیم‌تان در وضعیت خوبی هستید – هنوز هیچ ذکری در فعالیت‌ها نیست. به کار خوبتان ادامه دهید!", "no-native-fields": "هیچ فیلد بومی قابل پیکربندی برای این نوع موجودیت وجود ندارد.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "با اجرای جریان کاری پروفایلر، معیارهای جدول خود را کاوش کنید. شما تعداد ردیف، به‌روزرسانی‌های جدول، تغییرات حجم و موارد دیگر را خواهید دید. برای مراحل راه‌اندازی به مستندات ما مراجعه کنید ", "no-profiler-title": "Uruchom Profiler, aby odblokować wgląd w tabele", "no-properties-added": "No properties added.", + "no-recent-runs": "هیچ اجرای اخیری یافت نشد.", "no-recently-viewed-data": "شما اخیراً هیچ دارایی داده‌ای را مشاهده نکرده‌اید. کاوش کنید تا چیزی جالب پیدا کنید!", "no-reference-available": "هیچ مرجعی در دسترس نیست.", "no-related-terms-available": "هیچ واژه مرتبطی موجود نیست.", @@ -3638,6 +3699,7 @@ "password-error-message": "رمز عبور باید حداقل 8 و حداکثر 56 کاراکتر باشد و حداقل یک کاراکتر بزرگ (A-Z)، یک کاراکتر کوچک (a-z)، یک عدد و یک کاراکتر خاص (مثل !، %، @، یا #) داشته باشد.", "password-pattern-error": "رمز عبور باید حداقل 8 و حداکثر 56 کاراکتر، با یک کاراکتر خاص، یک حرف بزرگ و یک حرف کوچک باشد.", "path-of-the-dbt-files-stored": "مسیر پوشه‌ای که فایل‌های dbt در آن ذخیره شده‌اند.", + "percent-complete-all-agents": "{{percent}}% تکمیل در همه عامل‌ها", "permanently-delete-common-message": "این {{entity}} و تمام متادیتای آن را برای همیشه حذف کنید. این عمل قابل بازگشت نیست.", "permanently-delete-ingestion-pipeline": "حذف دائمی این <0>{{entityName}} منجر به از دست رفتن پیکربندی پایپ‌لاین می‌شود و قابل بازیابی نیست.", "permanently-delete-metadata": "حذف دائم این <0>{{entityName}} منجر به حذف متادیتای آن از {{brandName}} می‌شود و قابل بازیابی نخواهد بود.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "پیکربندی برای تنظیم چگونگی دوربردی که می‌خواهیم به لاگ‌های پرسش نگاه کنیم تا داده‌های استفاده را پردازش کنیم.", "query-used-by-other-tables": "پرسش استفاده‌شده توسط جداول دیگر.", "quick-add-tip": "از «افزودن سریع» برای ایجاد روابط اصطلاحات واژه‌نامه بدون خروج از نمودار استفاده کنید.", + "ran-for-duration": "به مدت {{duration}} دقیقه اجرا شد", "rdf-not-enabled-for-export": "برای خروجی هستی‌شناسی باید RDF فعال باشد. لطفاً RDF را در پیکربندی سرور خود فعال کنید.", "rdf-predicate-tooltip": "URI گزاره RDF برای معناشناسی داده پیوندی (مثلاً skos:broader)", "reacted-with-emoji": "با ایموجی {{type}} واکنش نشان داد.", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: داده‌ها باید به مدت <0>{{data}} نگه داشته شوند.", "run-sample-data-to-ingest-sample-data": "'اجرای داده نمونه برای ورود داده‌های نمونه به {{brandName}}.'", "run-status-at-timestamp": "وضعیت اجرا: {{status}} در {{timestamp}}", + "run-status-click-details": "اجرای {{status}} · برای جزئیات کلیک کنید", "run-successful-test-to-continue": "برای ادامه یک آزمایش موفق اجرا کنید.", "sample-data-ingestion-config-description": "این شِما پارامترهایی را که می‌توان برای جمع‌آوری داده نمونه ارسال کرد تعریف می‌کند.", "schedule-description": "دریافت داده را برای اجرا در زمان و فرکانس مشخصی زمان‌بندی کنید.", @@ -3740,6 +3804,8 @@ "search-insights-description": "آمار خوشه جستجو، جزئیات شاخص را مشاهده و شاخص‌های یتیم را مدیریت کنید.", "search-settings-description": "تنظیمات جستجو برای هر موجودیت بر اساس رتبه‌بندی.", "search-settings-for-entity": "تنظیمات جستجو بر اساس رتبه‌بندی برای {{entity}}", + "seconds-left": "~{{count}} ثانیه باقی‌مانده", + "seconds-short": "{{count}} ثانیه", "see-also": "همچنین ببینید", "see-how-to-get-started": "نحوه شروع را ببینید", "select-alert-type": "لطفاً نوع هشدار را انتخاب کنید.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json index 18aa335c6fa3..c4044381af9f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json @@ -97,6 +97,7 @@ "advanced-configuration": "Configuração Avançada", "advanced-entity": "{{entity}} Avançado", "advanced-search": "Busca Avançada", + "agent": "Agente", "agent-activity": "Atividade do agente", "agent-plural": "Agentes", "agent-setup": "Configuração do agente", @@ -189,6 +190,8 @@ "asset-plural": "Ativos", "asset-plural-lowercase": "ativos", "asset-type": "Tipo de ativo", + "assets-ingested": "ativos ingeridos", + "assets-profiled": "ativos perfilados", "assigned": "Atribuído", "assigned-entity": "{{entity}} Atribuído", "assigned-to-me": "Atribuído a mim", @@ -248,6 +251,7 @@ "basic-configuration": "Configuração Básica", "batch-size": "Tamanho do Lote", "bearer-hmac-signature": "Bearer (assinatura HMAC)", + "before-error": "antes do erro", "before-number-of-day-plural": "Antes de {{numberOfDays}} dias", "belongs-to": "Pertence a", "belongs-to-database": "Pertence à base de dados", @@ -369,6 +373,7 @@ "collapse": "Recolher", "collapse-all": "Recolher Tudo", "collate-ai": "Agrupar IA", + "collate-ai-agent-plural": "Agentes de IA do Collate", "collection": "Coleção", "collection-plural": "Coleções", "color": "Cor", @@ -492,7 +497,7 @@ "cost-analysis": "Análise de Custo", "count": "Contagem", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} em execução", "cover-image": "Cobrir", "covered": "Coberto", "create": "Criar", @@ -664,12 +669,14 @@ "dbt-source": "Fonte dbt", "dbt-source-project": "Projeto Fonte dbt", "deactivated": "Desativado", + "debug": "Depuração", "december": "Dezembro", "decision": "Decisão", "default": "Padrão", "default-persona": "Perfil Padrão", "default-role": "Função Padrão", "delete": "Deletar", + "delete-agent": "Excluir agente", "delete-all-nodes": "Excluir todos os nós", "delete-boost": "Excluir impulso", "delete-data-asset-rule": "Excluir Regra de Ativo de Dados", @@ -697,6 +704,7 @@ "deployed": "Implementado", "deployed-lowercase": "implantado", "deploying-lowercase": "implantando", + "deployment-complete": "Implantação concluída", "deprecate": "Deprecate", "depth": "Profundidade", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Detalhes", "details": "Detalhes", "developed-by-developer": "Desenvolvido por {{developer}}", + "diagnose": "Diagnosticar", "diagnostic-info": "Informações de diagnóstico", "did-not-run": "Não executado", "dimension": "Dimensão", @@ -784,6 +793,7 @@ "drive-plural": "Unidades", "duplicate": "Duplicar", "duration": "Duração", + "duration-in-minute": "{{duration}} min", "dynamic": "Dinâmico", "dynamic-assertion": "Asserção dinâmica", "edge": "Borda", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Editar & Aceitar Sugestão", "edit-an-announcement": "Editar um Anúncio", "edit-chart-name": "Editar Gráfico: \"{{name}}\"", + "edit-configuration": "Editar configuração", "edit-connection": "Editar conexão", "edit-data-asset-rule": "Editar Regra de Ativo de Dados", "edit-description-for": "Editar Descrição para {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "Equivalência", "error": "Erro", "error-plural": "Erros", + "error-plural-lowercase": "erros", "esc": "Esc", + "est-remaining": "restante aprox.", "establish-connection": "Estabelecer conexão", "evaluate": "Avaliar", "evaluate-permission": "Avaliar Permissão", @@ -972,8 +985,10 @@ "factor": "Fator", "fail-on-conflict": "Falhar em caso de conflito", "failed": "Falhou", + "failed-at": "Falhou em", "failed-entity": "Falha {{entity}}", "failed-event-plural": "Eventos falhos", + "failed-lowercase": "com falha", "failed-rows": "Linhas falhadas", "failed-slash-aborted-reason": "Motivo da falha/cancelamento", "failed-to-upload-file": "Falha ao carregar o arquivo", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Padrões de filtro", "filter-plural": "Filtros", "filtered": "Filtrado", + "filtered-lowercase": "filtrado", "filtering-condition": "Condição de Filtragem", "filters-configuration": "Configuração de filtros", + "finished": "Concluído", + "finished-lowercase": "concluído", "first": "Primeiro", "first-lowercase": "primeiro", "first-name": "Nome", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Ocultar configurações de representação ({{count}})", "hide-meta-details": "Ocultar detalhes meta", "hide-property-plural": "Ocultar Propriedades", + "hide-raw-logs": "Ocultar logs brutos", "hierarchical": "Hierárquica", "hierarchy": "Hierarquia", "hierarchy-depth": "Profundidade da hierarquia", @@ -1170,6 +1189,7 @@ "homepage": "Página inicial", "hour": "Hora", "hourly": "A cada hora", + "how-to-fix": "Como corrigir", "http-config-source": "Fonte de Configuração HTTP", "http-method": "Método HTTP", "hybrid-search-weight-plural": "Pesos de busca híbrida", @@ -1226,6 +1246,7 @@ "index-name": "Nome do índice", "index-states": "Estatísticas de Índice", "indirect": "Indireto", + "info": "Informação", "ingest-sample-data": "Ingestão de Dados de Amostra", "ingestion": "Ingestão", "ingestion-lowercase": "ingestão", @@ -1297,6 +1318,7 @@ "keyword": "Palavra-chave", "keyword-lowercase-plural": "palavras-chave", "kill": "Finalizar", + "kill-run": "Encerrar execução", "knowledge": "Conhecimento", "knowledge-article-plural": "Artigos de conhecimento", "knowledge-center": "Centro de conhecimento", @@ -1508,7 +1530,9 @@ "model": "Modelo", "model-name": "Nome do Modelo", "model-plural": "Modelos", + "model-plural-lowercase": "modelos", "model-store": "Loja de Modelos", + "models-parsed": "modelos analisados", "modified-time": "Hora de Modificação", "modifier": "Modificador", "monday": "Segunda-feira", @@ -1517,6 +1541,7 @@ "monthly": "Mensal", "more": "Mais", "more-action": "Mais ação", + "more-action-plural": "Mais ações", "more-actions": "Mais ações", "more-help": "Mais Ajuda", "more-lowercase": "mais", @@ -1554,6 +1579,7 @@ "native-field-plural": "Campos nativos", "navigation": "Navegação", "navigation-menu-plural": "Menus de navegação", + "need-attention": "precisam de atenção", "need-help": "Preciso de ajuda", "needs-attention": "Requer Atenção", "needs-review": "Precisa de revisão", @@ -1605,6 +1631,7 @@ "no-records": "Sem registros", "no-result-found": "Nenhum resultado encontrado.", "no-reviewer": "Sem revisor", + "no-status": "Sem status", "no-tags-added": "Nenhuma Tag adicionada", "no-tasks-yet": "Ainda não há tarefas", "no-tests-run": "Nenhum teste executado", @@ -1741,6 +1768,7 @@ "part-of": "Parte de", "part-of-domain": "Parte do domínio", "partial-coverage": "Cobertura Parcial", + "partial-success": "Sucesso parcial", "partition-lowercase-plural": "partições", "partition-plural": "Partições", "partitioned": "Particionado", @@ -1885,12 +1913,15 @@ "public-team": "Equipe Pública", "published": "Publicado", "quality": "Qualidade", + "queries-processed": "consultas processadas", + "queries-scanned": "consultas verificadas", "query": "Consulta", "query-log-duration": "Duração do Log de Consulta", "query-lowercase": "consulta", "query-lowercase-plural": "consultas", "query-parameter-plural": "Parâmetros de Consulta", "query-plural": "Consultas", + "query-plural-lowercase": "consultas", "query-used-in": "Consulta Usada em", "queued": "Na fila", "quick-add": "Adição Rápida", @@ -1902,11 +1933,13 @@ "range": "Faixa", "range-condition": "Condição de Intervalo", "raw-connection-log": "Raw Connection Log", + "raw-logs": "Logs brutos", "rdf-predicate": "Predicado RDF", "rdf-store": "Armazém RDF", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Reatribuir", "re-deploy": "Reimplantar", + "re-deploy-sentence": "Reimplantar", "re-enter-new-password": "Reinsira a Nova Senha", "re-index-all": "Reindexar Tudo", "re-index-elasticsearch": "Reindexar Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "Recente", "recent-event-plural": "Eventos recentes", "recent-run-plural": "Execuções Recentes", + "recent-runs-sentence": "Execuções recentes", "recent-search-term-plural": "Termos de Pesquisa Recentes", "recent-views": "Visualizações Recentes", "recently-created": "Criado recentemente", @@ -1931,6 +1965,8 @@ "recently-updated": "Atualizado recentemente", "recently-viewed": "Visto Recentemente", "record-plural": "Registros", + "records": "registros", + "records-processed": "registros processados", "recreate-index-plural": "Recriar Índices", "reference-plural": "Referências", "refocused-to-home": "Foco redefinido para a página inicial", @@ -2071,6 +2107,7 @@ "run": "Executar", "run-agent-plural": "Executar Agentes", "run-at": "Executar em", + "run-history-and-details": "Histórico de execuções e detalhes", "run-in-background": "Run in background", "run-now": "Executar agora", "run-type": "Tipo de Execução", @@ -2138,6 +2175,7 @@ "search-index-plural": "Índices de Pesquisa", "search-index-setting-plural": "Configurações de Índice de Pesquisa", "search-insights": "Informações de pesquisa", + "search-logs": "Pesquisar logs", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Pesquisar memórias por conteúdo...", @@ -2248,6 +2286,7 @@ "show-nested": "Mostrar Aninhados", "show-or-hide-advanced-config": "{{showAdv}} Configuração Avançada", "show-or-hide-column-plural": "Mostrar / Ocultar colunas", + "show-raw-logs": "Mostrar logs brutos", "showing-count-of-total-assets": "Exibindo {{count}} de {{total}} ativos", "showing-total-failure-plural": "Total de falhas {{total}}", "sign-in": "Entrar", @@ -2313,6 +2352,7 @@ "started": "Iniciado", "started-following": "Começou a seguir", "starting-offset": "Deslocamento inicial", + "starts-after": "Começa após", "starts-with": "começa com", "state": "Estado", "static": "Estático", @@ -2322,10 +2362,13 @@ "status-success": "Sucesso", "stay-up-to-date": "Mantenha-se Atualizado", "step": "Etapa", + "steps": "Etapas", + "steps-lowercase": "etapas", "steward": "Steward", "stop": "Parar", "stop-re-index-all": "Parar Reindexação", "stopped": "Parado", + "stopped-lowercase": "interrompido", "storage": "Armazenamento", "storage-plural": "Armazenamentos", "storage-service": "Serviço de Armazenamento", @@ -2500,6 +2543,7 @@ "to-perform": "para realizar", "to-service-name": "Para nome do serviço", "to-service-type": "Para tipo de serviço", + "toggle-wrap": "Alternar quebra de linha", "token": "Token", "token-end-point": "Endpoint do Token", "token-expiration": "Expiração do Token", @@ -2673,6 +2717,7 @@ "view-plural": "Visualizações", "view-property-plural": "Visualizar Propriedades", "view-reindex-failure-plural": "Ver falhas de reindexação", + "view-run-history": "Ver histórico de execuções", "view-selected": "Ver selecionado", "visibility": "Visibilidade", "visibility-dataspace": "Espaço de dados", @@ -2685,8 +2730,10 @@ "volume-change": "Mudança de Volume", "wall-clock": "Tempo real", "wants-to-access-your-account": "quer acessar sua conta {{username}}", + "warn": "Aviso", "warning": "Aviso", "warning-plural": "Avisos", + "warning-plural-lowercase": "avisos", "web-analytic-entity-view-report-data": "Dados de Visualização de Entidade Analítica Web", "web-analytic-user-activity-report-data": "Dados de Atividade do Usuário Analítica Web", "web-analytics-report": "Relatório de Análise da Web", @@ -2722,6 +2769,8 @@ "workflow-plural": "Fluxos de Trabalho", "worksheet": "Planilha de trabalho", "worksheet-plural": "Planilhas de trabalho", + "wrap": "Quebrar linha", + "wrapping-up": "finalizando", "year": "Ano", "yes": "Sim", "yes-comma-confirm": "Sim, confirmar", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "Descubra os ativos de dados certos usando o editor de sintaxe com condições de e/ou.", "agent-setup-description": "Configure os parâmetros principais deste agente.", + "agents-deploy-progress": "{{done}} concluídos · {{running}} em execução · {{queued}} na fila{{failedSuffix}} — os agentes são executados conforme sua programação após esta primeira passagem", + "agents-deploying-ingesting": "Agentes implantando e ingerindo metadados", + "agents-finished-summary": "{{done}} de {{total}} agentes concluídos{{attentionSuffix}}", "aggregate-domain-type-description": "Domínios que coletam e curam dados de várias fontes alinhados para fornecer dados agregados e produtos de dados, como Customer 360, sessões de clientes, etc., para outros domínios consumirem.", "airflow-guide-message": "O {{brandName}} usa o Airflow para executar Conectores de Ingestão. Desenvolvemos APIs Gerenciadas para implantar conectores de ingestão. Por favor, use a instância do Airflow do {{brandName}} ou consulte o guia abaixo para instalar as APIs gerenciadas em sua instalação do Airflow.", "airflow-host-ip-address": "O {{brandName}} se conectará ao seu recurso a partir do IP <0>{{hostIp}}. Certifique-se de permitir o tráfego de entrada nas configurações de segurança da sua rede.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Clique em <0>{{text}} para ver detalhes.", "closed-this-task": "fechou esta tarefa", "collaborate-with-other-user": "para colaborar com outros usuários.", + "collate-ai-agents-description": "Classifique por camadas, documente e verifique a qualidade dos seus ativos com IA.", "collate-ai-widget-description": "Visão geral dos dados gerados pela IA Collate para o serviço. <0>saiba mais.", "column-bulk-operations-description": "Gerencie e edite metadados de diversas colunas de uma só vez.Pesquise, filtre e atualize nomes de exibição, descrições, tags e termos de glossário em seus ativos de dados.", "column-filter-help-text": "Filtre a linhagem por tags ou nomes de colunas. Use 'tag:NomeTag' para filtrar por tag ou apenas digite o nome da coluna.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Erro ao buscar token de acesso.", "establishing-connection-ellipsis": "Estabelecendo conexão…", "events-matching-search-query": "Eventos correspondentes à consulta de pesquisa", + "everything-healthy": "tudo saudável", "example-value": "ex. {{value}}", "exclude-system-entity-description": "Quando desativado, os padrões padrão definidos no esquema para {{entity}} são aplicados automaticamente.", "excludes-regex-line": "exclui += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Não se preocupe. É hora de reestruturar seus objetivos e progredir mais rapidamente.", "latency-sla-description": "<0>{{label}}: A resposta da consulta deve estar abaixo de <0>{{data}}", "latest-offset-description": "O deslocamento mais recente do evento no sistema.", + "latest-run-lines": "Última execução · {{count}} linhas", "ldap-group-dn-placeholder": "ex. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Este DN do grupo LDAP já está mapeado. Cada grupo LDAP pode ser mapeado apenas uma vez.", "learning-resources-management-description": "Explore os recursos do produto e aprenda como eles funcionam através dos nossos recursos", + "leave-page-ingestion-continues": "Você pode sair desta página — a ingestão continua em segundo plano", "leave-the-team-team-name": "Sair da equipe {{teamName}}", "length-validator-error": "Pelo menos {{length}} {{field}} necessário", "lineage-ingestion-description": "A ingestão de linhagem pode ser configurada e implantada após uma ingestão de metadados ter sido estabelecida. O fluxo de trabalho de ingestão de linhagem obtém o histórico de consultas, analisa consultas CREATE, INSERT, MERGE... e prepara a linhagem entre as entidades envolvidas. A ingestão de linhagem pode ter apenas um pipeline para um serviço de banco de dados. Defina a Duração do Log de Consulta (em dias) e o Limite de Resultado para iniciar.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "O que você quer analisar hoje?", "mcp-chat-placeholder": "Pergunte qualquer coisa...", "mentioned-you-on-the-lowercase": "mencionou você no", + "metadata-agents-description": "Extraia metadados, uso, linhagem e perfilamento da origem.", "metadata-agents-table-description": "Os agentes de metadados são usados para extrair metadados dos serviços de origem.", "metadata-ingestion-description": "Com base no tipo de serviço selecionado, insira os detalhes do padrão de filtro para o esquema ou tabela (banco de dados), ou tópico (mensagens), ou painel. Você pode incluir ou excluir os padrões de filtro. Escolha incluir visualizações, habilitar ou desabilitar o examinador de dados e ingerir dados de amostra, conforme necessário.", "metadata-status-complete-description": "Os metadados estão totalmente preenchidos e consistentes em todas as colunas", @@ -3392,6 +3449,8 @@ "minimum-count-error": "Pelo menos {{count}} {{field}} deve ser selecionado.", "minimum-value-error": "O valor mínimo deve ser menor que o valor máximo.", "minute": "Minuto", + "minutes-left": "~{{count}} min restantes", + "minutes-short": "{{count}} min", "missing-config-value": "Valor de configuração ausente: {{field}}", "missing-description": "Descrição ausente", "modified-time-ago-by": "Modificado {{time}} atrás por {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "Nenhum mapeamento de papel LDAP configurado.", "no-learning-resources-available": "Nenhum recurso de aprendizagem disponível para este contexto.", "no-lineage-available": "Nenhuma conexão de lineage encontrada", + "no-lines-match": "Nenhuma linha corresponde.", "no-match-found": "Nenhuma correspondência encontrada", "no-mentions": "Não há instâncias em que você ou sua equipe foram mencionados em atividades", "no-native-fields": "Nenhum campo nativo configurável para este tipo de entidade.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Explore as métricas da sua tabela executando o fluxo de trabalho do profiler. Você verá Contagem de Linhas, Atualizações de Tabela, Mudanças de Volume, e mais. Visite nossa documentação para etapas de configuração ", "no-profiler-title": "Execute o Profiler para desbloquear insights da tabela", "no-properties-added": "No properties added.", + "no-recent-runs": "Nenhuma execução recente encontrada.", "no-recently-viewed-data": "Nenhum dado visualizado recentemente.", "no-reference-available": "Nenhuma referência disponível.", "no-related-terms-available": "Nenhum termo relacionado disponível.", @@ -3638,6 +3699,7 @@ "password-error-message": "A senha deve ter no mínimo 8 e no máximo 56 caracteres e conter pelo menos uma letra maiúscula (A-Z), uma letra minúscula (a-z), um número e um caractere especial (como !, %, @ ou #)", "password-pattern-error": "A senha deve ter no mínimo 8 e no máximo 56 caracteres, com pelo menos um caractere especial, uma letra maiúscula e uma letra minúscula", "path-of-the-dbt-files-stored": "Caminho da pasta onde os arquivos dbt são armazenados", + "percent-complete-all-agents": "{{percent}}% concluído em todos os agentes", "permanently-delete-common-message": "Excluir este {{entity}} e todos os seus metadados para sempre. Esta ação não pode ser desfeita.", "permanently-delete-ingestion-pipeline": "A exclusão permanente de <0>{{entityName}} resultará na perda da configuração do pipeline e não poderá ser recuperada.", "permanently-delete-metadata": "Excluir permanentemente este(a) <0>{{entityName}} removerá seus metadados do {{brandName}} permanentemente.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Configuração para ajustar até onde queremos olhar nos registros de consulta para processar dados de uso.", "query-used-by-other-tables": "Consulta usada por outras tabelas", "quick-add-tip": "Use Adição Rápida para criar relações entre termos do glossário sem sair do grafo.", + "ran-for-duration": "executado por {{duration}} min", "rdf-not-enabled-for-export": "RDF deve estar habilitado para exportar a ontologia. Por favor, habilite o RDF na configuração do seu servidor.", "rdf-predicate-tooltip": "O URI do predicado RDF para este tipo de relação (ex: skos:broader, skos:exactMatch).", "reacted-with-emoji": "reagiu com emoji {{type}}", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Os dados devem ser retidos por <0>{{data}}", "run-sample-data-to-ingest-sample-data": "Executar dados de exemplo para ingerir ativos de dados de exemplo no {{brandName}}.", "run-status-at-timestamp": "Status de execução: {{status}} em {{timestamp}}", + "run-status-click-details": "Execução {{status}} · clique para ver detalhes", "run-successful-test-to-continue": "Execute um teste bem-sucedido para continuar.", "sample-data-ingestion-config-description": "Este esquema define os parâmetros que podem ser passados para a coleta de dados de exemplo.", "schedule-description": "Programe a ingestão para ser executada em um horário e frequência específicos.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Visualize estatísticas de cluster de pesquisa, detalhes de índice e gerencie índices órfãos.", "search-settings-description": "Configurações de busca para cada entidade baseadas em rankings.", "search-settings-for-entity": "Configurações de busca baseadas em ranking para {{entity}}", + "seconds-left": "~{{count}}s restantes", + "seconds-short": "{{count}}s", "see-also": "Veja Também", "see-how-to-get-started": "Veja como começar", "select-alert-type": "Por favor, selecione um tipo de alerta", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json index 34d9672fab90..019d64b6ec6f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json @@ -97,6 +97,7 @@ "advanced-configuration": "Configuração Avançada", "advanced-entity": "{{entity}} Avançado", "advanced-search": "Busca Avançada", + "agent": "Agente", "agent-activity": "Atividade do Agente", "agent-plural": "Agentes", "agent-setup": "Configuração do agente", @@ -189,6 +190,8 @@ "asset-plural": "Ativos", "asset-plural-lowercase": "ativos", "asset-type": "Tipo de ativo", + "assets-ingested": "recursos ingeridos", + "assets-profiled": "recursos analisados", "assigned": "Atribuído", "assigned-entity": "{{entity}} Atribuído", "assigned-to-me": "Atribuído a mim", @@ -248,6 +251,7 @@ "basic-configuration": "Configuração Básica", "batch-size": "Tamanho do Lote", "bearer-hmac-signature": "Bearer (assinatura HMAC)", + "before-error": "antes do erro", "before-number-of-day-plural": "Antes de {{numberOfDays}} dias", "belongs-to": "Pertence a", "belongs-to-database": "Pertence à base de dados", @@ -369,6 +373,7 @@ "collapse": "Recolher", "collapse-all": "Recolher Tudo", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Collate AI Agentes", "collection": "Coleção", "collection-plural": "Coleções", "color": "Cor", @@ -492,7 +497,7 @@ "cost-analysis": "Análise de Custo", "count": "Contagem", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} em execução", "cover-image": "Imagem de Capa", "covered": "Coberto", "create": "Criar", @@ -664,12 +669,14 @@ "dbt-source": "Fonte dbt", "dbt-source-project": "Projeto Fonte dbt", "deactivated": "Desativado", + "debug": "Depurar", "december": "Dezembro", "decision": "Decisão", "default": "Padrão", "default-persona": "Perfil Padrão", "default-role": "Função Padrão", "delete": "Eliminar", + "delete-agent": "Eliminar agente", "delete-all-nodes": "Eliminar todos os nós", "delete-boost": "Eliminar impulso", "delete-data-asset-rule": "Eliminar Regra de Ativo de Dados", @@ -697,6 +704,7 @@ "deployed": "Implementado", "deployed-lowercase": "implantado", "deploying-lowercase": "implantando", + "deployment-complete": "Implementação concluída", "deprecate": "Deprecate", "depth": "Profundidade", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Detalhes", "details": "Detalhes", "developed-by-developer": "Desenvolvido por {{developer}}", + "diagnose": "Diagnosticar", "diagnostic-info": "Informação de Diagnóstico", "did-not-run": "Não executado", "dimension": "Dimensão", @@ -784,6 +793,7 @@ "drive-plural": "Unidades", "duplicate": "Duplicar", "duration": "Duração", + "duration-in-minute": "{{duration}} min", "dynamic": "Dinâmico", "dynamic-assertion": "Asserção Dinâmica", "edge": "Borda", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Editar & Aceitar Sugestão", "edit-an-announcement": "Editar um Anúncio", "edit-chart-name": "Editar Gráfico: \"{{name}}\"", + "edit-configuration": "Editar configuração", "edit-connection": "Editar ligação", "edit-data-asset-rule": "Editar Regra de Ativo de Dados", "edit-description-for": "Editar Descrição para {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "Equivalência", "error": "Erro", "error-plural": "Erros", + "error-plural-lowercase": "erros", "esc": "Esc", + "est-remaining": "restante est.", "establish-connection": "Estabelecer ligação", "evaluate": "Avaliar", "evaluate-permission": "Avaliar Permissão", @@ -972,8 +985,10 @@ "factor": "Fator", "fail-on-conflict": "Falhar em caso de conflito", "failed": "Falhou", + "failed-at": "Falhou em", "failed-entity": "Falha em {{entity}}", "failed-event-plural": "Eventos Falhados", + "failed-lowercase": "falhou", "failed-rows": "Linhas falhadas", "failed-slash-aborted-reason": "Motivo da falha/cancelamento", "failed-to-upload-file": "Falha ao carregar o arquivo", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Padrões de filtro", "filter-plural": "Filtros", "filtered": "Filtrado", + "filtered-lowercase": "filtrado", "filtering-condition": "Condição de Filtragem", "filters-configuration": "Configuração de filtros", + "finished": "Concluído", + "finished-lowercase": "concluído", "first": "Primeiro", "first-lowercase": "primeiro", "first-name": "Nome", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Ocultar definições de representação ({{count}})", "hide-meta-details": "Ocultar detalhes meta", "hide-property-plural": "Ocultar Propriedades", + "hide-raw-logs": "Ocultar registos em bruto", "hierarchical": "Hierárquico", "hierarchy": "Hierarquia", "hierarchy-depth": "Profundidade da hierarquia", @@ -1170,6 +1189,7 @@ "homepage": "Página inicial", "hour": "Hora", "hourly": "A cada hora", + "how-to-fix": "Como corrigir", "http-config-source": "Fonte de Configuração HTTP", "http-method": "Método HTTP", "hybrid-search-weight-plural": "Pesos da pesquisa híbrida", @@ -1226,6 +1246,7 @@ "index-name": "Nome do índice", "index-states": "Estatísticas de Índice", "indirect": "Indireto", + "info": "Informação", "ingest-sample-data": "Ingestão de Dados de Amostra", "ingestion": "Ingestão", "ingestion-lowercase": "ingestão", @@ -1297,6 +1318,7 @@ "keyword": "Palavra-chave", "keyword-lowercase-plural": "palavras-chave", "kill": "Finalizar", + "kill-run": "Terminar execução", "knowledge": "Conhecimento", "knowledge-article-plural": "Artigos de conhecimento", "knowledge-center": "Centro de conhecimento", @@ -1508,7 +1530,9 @@ "model": "Modelo", "model-name": "Nome do Modelo", "model-plural": "Modelos", + "model-plural-lowercase": "modelos", "model-store": "Loja de Modelos", + "models-parsed": "modelos analisados", "modified-time": "Hora de Modificação", "modifier": "Modificador", "monday": "Segunda-feira", @@ -1517,6 +1541,7 @@ "monthly": "Mensal", "more": "Mais", "more-action": "Mais ações", + "more-action-plural": "Mais ações", "more-actions": "Mais ações", "more-help": "Mais Ajuda", "more-lowercase": "mais", @@ -1554,6 +1579,7 @@ "native-field-plural": "Campos nativos", "navigation": "Navegação", "navigation-menu-plural": "Menus de Navegação", + "need-attention": "precisam de atenção", "need-help": "Precisa de Ajuda", "needs-attention": "Requer Atenção", "needs-review": "Precisa de revisão", @@ -1605,6 +1631,7 @@ "no-records": "Sem Registos", "no-result-found": "Nenhum resultado encontrado.", "no-reviewer": "Sem revisor", + "no-status": "Sem estado", "no-tags-added": "Nenhuma Etiqueta adicionada", "no-tasks-yet": "Ainda não há tarefas", "no-tests-run": "Nenhum teste executado", @@ -1741,6 +1768,7 @@ "part-of": "Parte de", "part-of-domain": "Parte do domínio", "partial-coverage": "Cobertura parcial", + "partial-success": "Sucesso parcial", "partition-lowercase-plural": "partições", "partition-plural": "Partições", "partitioned": "Particionado", @@ -1885,12 +1913,15 @@ "public-team": "Equipa Pública", "published": "Publicado", "quality": "Qualidade", + "queries-processed": "consultas processadas", + "queries-scanned": "consultas verificadas", "query": "Consulta", "query-log-duration": "Duração do Log de Consulta", "query-lowercase": "consulta", "query-lowercase-plural": "consultas", "query-parameter-plural": "Parâmetros de Consulta", "query-plural": "Consultas", + "query-plural-lowercase": "consultas", "query-used-in": "Consulta Usada em", "queued": "Em Fila", "quick-add": "Adição Rápida", @@ -1902,11 +1933,13 @@ "range": "Intervalo", "range-condition": "Condição de Intervalo", "raw-connection-log": "Raw Connection Log", + "raw-logs": "Registos em bruto", "rdf-predicate": "Predicado RDF", "rdf-store": "Armazém RDF", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Reatribuir", "re-deploy": "Reimplantar", + "re-deploy-sentence": "Reimplementar", "re-enter-new-password": "Reinsira a Nova Senha", "re-index-all": "Reindexar Tudo", "re-index-elasticsearch": "Reindexar Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "Recente", "recent-event-plural": "Eventos recentes", "recent-run-plural": "Execuções Recentes", + "recent-runs-sentence": "Execuções recentes", "recent-search-term-plural": "Termos de Pesquisa Recentes", "recent-views": "Visualizações Recentes", "recently-created": "Criado recentemente", @@ -1931,6 +1965,8 @@ "recently-updated": "Atualizado recentemente", "recently-viewed": "Visto Recentemente", "record-plural": "Registos", + "records": "registos", + "records-processed": "registos processados", "recreate-index-plural": "Recriar Índices", "reference-plural": "Referências", "refocused-to-home": "Foco movido para a página inicial", @@ -2071,6 +2107,7 @@ "run": "Executar", "run-agent-plural": "Executar Agentes", "run-at": "Executar em", + "run-history-and-details": "Histórico e detalhes das execuções", "run-in-background": "Run in background", "run-now": "Executar agora", "run-type": "Tipo de Execução", @@ -2138,6 +2175,7 @@ "search-index-plural": "Índices de Pesquisa", "search-index-setting-plural": "Configurações de Índice de Pesquisa", "search-insights": "Insights de pesquisa", + "search-logs": "Pesquisar registos", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Pesquisar memórias por conteúdo...", @@ -2248,6 +2286,7 @@ "show-nested": "Mostrar Aninhados", "show-or-hide-advanced-config": "{{showAdv}} Configuração Avançada", "show-or-hide-column-plural": "Mostrar / Ocultar Colunas", + "show-raw-logs": "Mostrar registos em bruto", "showing-count-of-total-assets": "A apresentar {{count}} de {{total}} ativos", "showing-total-failure-plural": "Total de {{total}} falhas", "sign-in": "Entrar", @@ -2313,6 +2352,7 @@ "started": "Iniciado", "started-following": "Começou a seguir", "starting-offset": "Offset Inicial", + "starts-after": "Começa após", "starts-with": "começa com", "state": "Estado", "static": "Estático", @@ -2322,10 +2362,13 @@ "status-success": "Sucesso", "stay-up-to-date": "Mantenha-se Atualizado", "step": "Passo", + "steps": "Passos", + "steps-lowercase": "passos", "steward": "Steward", "stop": "Parar", "stop-re-index-all": "Parar Reindexação", "stopped": "Parado", + "stopped-lowercase": "parado", "storage": "Armazenamento", "storage-plural": "Armazenamentos", "storage-service": "Serviço de Armazenamento", @@ -2500,6 +2543,7 @@ "to-perform": "a realizar", "to-service-name": "Para nome do serviço", "to-service-type": "Para tipo de serviço", + "toggle-wrap": "Alternar moldagem", "token": "Token", "token-end-point": "Endpoint do Token", "token-expiration": "Expiração do Token", @@ -2673,6 +2717,7 @@ "view-plural": "Visualizações", "view-property-plural": "Visualizar Propriedades", "view-reindex-failure-plural": "Ver falhas de reindexação", + "view-run-history": "Ver histórico de execuções", "view-selected": "Ver selecionado", "visibility": "Visibilidade", "visibility-dataspace": "Espaço de dados", @@ -2685,8 +2730,10 @@ "volume-change": "Mudança de Volume", "wall-clock": "Tempo real", "wants-to-access-your-account": "quer acessar sua conta {{username}}", + "warn": "Aviso", "warning": "Aviso", "warning-plural": "Avisos", + "warning-plural-lowercase": "avisos", "web-analytic-entity-view-report-data": "Dados do Relatório de Visualização da Entidade Analítica Web", "web-analytic-user-activity-report-data": "Dados do Relatório de Atividade do Utilizador Analítica Web", "web-analytics-report": "Relatório de Análise da Web", @@ -2722,6 +2769,8 @@ "workflow-plural": "Fluxos de Trabalho", "worksheet": "Folha de trabalho", "worksheet-plural": "Folhas de trabalho", + "wrap": "Moldar", + "wrapping-up": "a finalizar", "year": "Ano", "yes": "Sim", "yes-comma-confirm": "Sim, confirmar", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "Descubra os ativos de dados certos usando o editor de sintaxe com condições de e/ou.", "agent-setup-description": "Configure os parâmetros principais deste agente.", + "agents-deploy-progress": "{{done}} concluídos · {{running}} em execução · {{queued}} em fila{{failedSuffix}} — os agentes executam-se conforme o seu agendamento após esta primeira passagem", + "agents-deploying-ingesting": "Agentes a implementar e a ingerir metadados", + "agents-finished-summary": "{{done}} de {{total}} agentes concluídos{{attentionSuffix}}", "aggregate-domain-type-description": "Domínios que coletam e curam dados de várias fontes alinhados para fornecer dados agregados e produtos de dados, como Customer 360, sessões de clientes, etc., para outros domínios consumirem.", "airflow-guide-message": "O {{brandName}} usa o Airflow para executar Conectores de Ingestão. Desenvolvemos APIs Gerenciadas para implantar conectores de ingestão. Por favor, use a instância do Airflow do {{brandName}} ou consulte o guia abaixo para instalar as APIs gerenciadas em sua instalação do Airflow.", "airflow-host-ip-address": "O {{brandName}} se conectará ao seu recurso a partir do IP <0>{{hostIp}}. Certifique-se de permitir o tráfego de entrada nas configurações de segurança da sua rede.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Clique em <0>{{text}} para ver detalhes.", "closed-this-task": "fechou esta tarefa", "collaborate-with-other-user": "para colaborar com outros Utilizadores.", + "collate-ai-agents-description": "Classifique por nível, documente e verifique a qualidade dos seus recursos com IA.", "collate-ai-widget-description": "Visão geral dos dados gerados pela IA Collate para o serviço. <0>saber mais.", "column-bulk-operations-description": "Gerir e editar metadados para várias colunas de uma só vez. Pesquisar, filtrar e atualizar nomes de exibição, descrições, etiquetas e termos do glossário nos seus ativos de dados.", "column-filter-help-text": "Filtre a linhagem por etiquetas ou nomes de colunas. Use 'tag:NomeEtiqueta' para filtrar por etiqueta ou simplesmente introduza o nome da coluna.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Erro ao buscar token de acesso.", "establishing-connection-ellipsis": "A estabelecer ligação…", "events-matching-search-query": "Eventos correspondentes à consulta de pesquisa", + "everything-healthy": "tudo saudável", "example-value": "ex. {{value}}", "exclude-system-entity-description": "Quando desativado, os padrões predefinidos definidos no esquema para {{entity}} são aplicados automaticamente.", "excludes-regex-line": "exclui += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Aviso: O objetivo do KPI de Descrição ainda não foi atingido, mas ainda há tempo – a sua organização tem {{count}} dias restantes. Para manter o rumo, ative o Relatório de Insights de Dados. Isso permitir-nos-á enviar atualizações semanais a todas as equipas, promovendo a colaboração e o foco no cumprimento dos KPIs da nossa organização.", "latency-sla-description": "<0>{{label}}: A resposta da consulta deve estar abaixo de <0>{{data}}", "latest-offset-description": "O offset mais recente do evento no sistema.", + "latest-run-lines": "Última execução · {{count}} linhas", "ldap-group-dn-placeholder": "p.ex. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Este DN do grupo LDAP já está mapeado. Cada grupo LDAP pode ser mapeado apenas uma vez.", "learning-resources-management-description": "Explore as funcionalidades do produto e aprenda como funcionam através dos nossos recursos", + "leave-page-ingestion-continues": "Pode sair desta página — a ingestão continua em segundo plano", "leave-the-team-team-name": "Sair da equipa {{teamName}}", "length-validator-error": "Pelo menos {{length}} {{field}} necessário", "lineage-ingestion-description": "A ingestão de linhagem pode ser configurada e implantada após uma ingestão de metadados ter sido estabelecida. O fluxo de trabalho de ingestão de linhagem obtém o histórico de consultas, analisa consultas CREATE, INSERT, MERGE... e prepara a linhagem entre as entidades envolvidas. A ingestão de linhagem pode ter apenas um pipeline para um serviço de banco de dados. Defina a Duração do Log de Consulta (em dias) e o Limite de Resultado para iniciar.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "O que pretende analisar hoje?", "mcp-chat-placeholder": "Pergunte qualquer coisa...", "mentioned-you-on-the-lowercase": "mencionou você no", + "metadata-agents-description": "Extraia metadados, utilização, linhagem e criação de perfis da origem.", "metadata-agents-table-description": "Os agentes de metadados são usados para extrair metadados dos serviços de origem.", "metadata-ingestion-description": "Com base no tipo de serviço selecionado, insira os detalhes do padrão de filtro para o esquema ou tabela (banco de dados), ou tópico (mensagens), ou painel. Você pode incluir ou excluir os padrões de filtro. Escolha incluir visualizações, habilitar ou desabilitar o examinador de dados e ingerir dados de amostra, conforme necessário.", "metadata-status-complete-description": "Os metadados estão totalmente preenchidos e consistentes em todas as colunas", @@ -3392,6 +3449,8 @@ "minimum-count-error": "Pelo menos {{count}} {{field}} deve ser selecionado.", "minimum-value-error": "O valor mínimo deve ser menor que o valor máximo.", "minute": "Minuto", + "minutes-left": "~{{count}} min restantes", + "minutes-short": "{{count}} min", "missing-config-value": "Valor de configuração em falta: {{field}}", "missing-description": "Descrição em falta", "modified-time-ago-by": "Modificado {{time}} atrás por {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "Nenhum mapeamento de função LDAP configurado.", "no-learning-resources-available": "Nenhum recurso de aprendizagem disponível para este contexto.", "no-lineage-available": "Nenhuma conexão de linhagem encontrada", + "no-lines-match": "Nenhuma linha corresponde.", "no-match-found": "Nenhuma correspondência encontrada", "no-mentions": "Parece que você e a sua equipa estão em dia – sem menções em quaisquer atividades por enquanto. Continuem o bom trabalho!", "no-native-fields": "Não existem campos nativos configuráveis para este tipo de entidade.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Explore as métricas da sua tabela executando o fluxo de trabalho do profiler. Você verá Contagem de Linhas, Atualizações de Tabela, Mudanças de Volume, e mais. Visite nossa documentação para etapas de configuração ", "no-profiler-title": "Executar Profiler para desbloquear informações da tabela", "no-properties-added": "No properties added.", + "no-recent-runs": "Não foram encontradas execuções recentes.", "no-recently-viewed-data": "Ainda não visualizou nenhum ativo de dados recentemente. Explore para encontrar algo interessante!", "no-reference-available": "Nenhuma referência disponível.", "no-related-terms-available": "Nenhum termo relacionado disponível.", @@ -3638,6 +3699,7 @@ "password-error-message": "A senha deve ter no mínimo 8 e no máximo 56 caracteres e conter pelo menos uma letra maiúscula (A-Z), uma letra minúscula (a-z), um número e um caracter especial (como !, %, @ ou #)", "password-pattern-error": "A senha deve ter no mínimo 8 e no máximo 56 caracteres, com pelo menos um caracter especial, uma letra maiúscula e uma letra minúscula", "path-of-the-dbt-files-stored": "Caminho da pasta onde os arquivos dbt são armazenados", + "percent-complete-all-agents": "{{percent}}% concluído em todos os agentes", "permanently-delete-common-message": "Eliminar este {{entity}} e todos os seus metadados para sempre. Esta ação não pode ser anulada.", "permanently-delete-ingestion-pipeline": "A exclusão permanente deste <0>{{entityName}} resultará na perda da configuração do pipeline e não poderá ser recuperada.", "permanently-delete-metadata": "Excluir permanentemente este(a) <0>{{entityName}} removerá seus metadados do {{brandName}} permanentemente.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Configuração para ajustar até onde queremos olhar nos registos de consulta para processar dados de uso.", "query-used-by-other-tables": "Consulta usada por outras tabelas", "quick-add-tip": "Use Adição Rápida para criar relações entre termos do glossário sem sair do grafo.", + "ran-for-duration": "executou durante {{duration}} min", "rdf-not-enabled-for-export": "RDF deve estar ativado para exportar a ontologia. Por favor, ative o RDF na configuração do seu servidor.", "rdf-predicate-tooltip": "O URI do predicado RDF para este tipo de relação (ex: skos:broader, skos:exactMatch).", "reacted-with-emoji": "reagiu com emoji {{type}}", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Os dados devem ser retidos por <0>{{data}}", "run-sample-data-to-ingest-sample-data": "Executar dados de exemplo para ingerir ativos de dados de exemplo no {{brandName}}.", "run-status-at-timestamp": "Estado da execução: {{status}} às {{timestamp}}", + "run-status-click-details": "execução {{status}} · clique para detalhes", "run-successful-test-to-continue": "Execute um teste bem-sucedido para continuar.", "sample-data-ingestion-config-description": "Este esquema define os parâmetros que podem ser passados para a recolha de dados de exemplo.", "schedule-description": "Agendar a ingestão para ser executada numa hora e frequência específicas.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Veja as estatísticas do cluster de pesquisa, os detalhes do índice e faça a gestão dos índices órfãos.", "search-settings-description": "Definições de pesquisa para cada entidade baseadas em classificações.", "search-settings-for-entity": "Definições de pesquisa baseadas em classificação para {{entity}}", + "seconds-left": "~{{count}}s restantes", + "seconds-short": "{{count}}s", "see-also": "Ver Também", "see-how-to-get-started": "Veja como começar", "select-alert-type": "Por favor, selecione um tipo de alerta", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json index 6fa1a4b28a0e..7a0b107999a6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json @@ -97,6 +97,7 @@ "advanced-configuration": "Расширенная конфигурация", "advanced-entity": "Расширенный {{entity}}", "advanced-search": "Расширенный поиск", + "agent": "Агент", "agent-activity": "Активность агента", "agent-plural": "Агенты", "agent-setup": "Настройка агента", @@ -189,6 +190,8 @@ "asset-plural": "Объекты", "asset-plural-lowercase": "объекты", "asset-type": "Тип актива", + "assets-ingested": "объектов загружено", + "assets-profiled": "объектов профилировано", "assigned": "Назначен исполнитель", "assigned-entity": "Назначенный объект «{{entity}}»", "assigned-to-me": "Назначено на меня", @@ -248,6 +251,7 @@ "basic-configuration": "Базовая конфигурация", "batch-size": "Размер пакета", "bearer-hmac-signature": "Bearer (подпись HMAC)", + "before-error": "до ошибки", "before-number-of-day-plural": "За {{numberOfDays}} дня/дней", "belongs-to": "Относится к", "belongs-to-database": "Относится к базе данных", @@ -369,6 +373,7 @@ "collapse": "Свернуть", "collapse-all": "Свернуть все", "collate-ai": "Collate ИИ", + "collate-ai-agent-plural": "Collate AI Агенты", "collection": "Коллекция", "collection-plural": "Коллекции", "color": "Цвет", @@ -492,7 +497,7 @@ "cost-analysis": "Оценка цены", "count": "Количество", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} выполняется", "cover-image": "Обложка", "covered": "Покрыто", "create": "Создать", @@ -664,12 +669,14 @@ "dbt-source": "dbt-источник", "dbt-source-project": "Исходный проект dbt", "deactivated": "Отключено", + "debug": "Отладка", "december": "Декабрь", "decision": "Решение", "default": "По умолчанию", "default-persona": "Персона по умолчанию", "default-role": "Роль по умолчанию", "delete": "Удалить", + "delete-agent": "Удалить агента", "delete-all-nodes": "Удалить все узлы", "delete-boost": "Удалить усиление", "delete-data-asset-rule": "Удалить правило актива данных", @@ -697,6 +704,7 @@ "deployed": "Развернуто", "deployed-lowercase": "развернуто", "deploying-lowercase": "развертывание", + "deployment-complete": "Развёртывание завершено", "deprecate": "Deprecate", "depth": "Глубина", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Детали", "details": "Подробности", "developed-by-developer": "Разработано {{developer}}", + "diagnose": "Диагностика", "diagnostic-info": "Диагностическая информация", "did-not-run": "Не выполнено", "dimension": "Измерение", @@ -784,6 +793,7 @@ "drive-plural": "Диски", "duplicate": "Дубликат", "duration": "Длительность", + "duration-in-minute": "{{duration}} мин", "dynamic": "Динамический", "dynamic-assertion": "Динамическое утверждение", "edge": "связь", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Редактировать и принять предложение", "edit-an-announcement": "Редактировать объявление", "edit-chart-name": "Редактировать диаграмму: \"{{name}}\"", + "edit-configuration": "Изменить конфигурацию", "edit-connection": "Изменить подключение", "edit-data-asset-rule": "Редактировать правило актива данных", "edit-description-for": "Редактировать описание {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "Эквивалентность", "error": "Ошибка", "error-plural": "Ошибки", + "error-plural-lowercase": "ошибки", "esc": "Esc", + "est-remaining": "ост. (оценка)", "establish-connection": "Establish Connection", "evaluate": "Оценить", "evaluate-permission": "Оценить разрешение", @@ -972,8 +985,10 @@ "factor": "Фактор", "fail-on-conflict": "Ошибка при конфликте", "failed": "Провалено", + "failed-at": "Сбой на", "failed-entity": "Ошибка объекта «{{entity}}»", "failed-event-plural": "Неудачные события", + "failed-lowercase": "сбой", "failed-rows": "Неудачные строки", "failed-slash-aborted-reason": "Причина сбоя/отмены", "failed-to-upload-file": "Не удалось загрузить файл", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Шаблоны фильтров", "filter-plural": "Фильтры", "filtered": "Отфильтровано", + "filtered-lowercase": "отфильтровано", "filtering-condition": "Условие фильтрации", "filters-configuration": "Конфигурация фильтров", + "finished": "Завершено", + "finished-lowercase": "завершено", "first": "Первый", "first-lowercase": "первый", "first-name": "Имя", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Скрыть настройки имперсонации ({{count}})", "hide-meta-details": "Скрыть мета-данные", "hide-property-plural": "Скрыть свойства", + "hide-raw-logs": "Скрыть необработанные логи", "hierarchical": "Иерархический", "hierarchy": "Иерархия", "hierarchy-depth": "Глубина иерархии", @@ -1170,6 +1189,7 @@ "homepage": "Домашняя страница", "hour": "Час", "hourly": "Ежечасно", + "how-to-fix": "Как исправить", "http-config-source": "Источник конфигурации HTTP", "http-method": "HTTP-метод", "hybrid-search-weight-plural": "Веса гибридного поиска", @@ -1226,6 +1246,7 @@ "index-name": "Имя индекса", "index-states": "Статистика индекса", "indirect": "Косвенный", + "info": "Информация", "ingest-sample-data": "Получение демонстрационных данных", "ingestion": "Извлечение", "ingestion-lowercase": "извлечение", @@ -1297,6 +1318,7 @@ "keyword": "Ключевое слово", "keyword-lowercase-plural": "ключевые слова", "kill": "Уничтожить", + "kill-run": "Прервать выполнение", "knowledge": "Знания", "knowledge-article-plural": "Статьи базы знаний", "knowledge-center": "Центр знаний", @@ -1508,7 +1530,9 @@ "model": "Модель", "model-name": "Наименование модели", "model-plural": "Модели", + "model-plural-lowercase": "модели", "model-store": "Магазин моделей", + "models-parsed": "моделей разобрано", "modified-time": "Время изменения", "modifier": "Модификатор", "monday": "Понедельник", @@ -1517,6 +1541,7 @@ "monthly": "Ежемесячно", "more": "Больше", "more-action": "Больше действий", + "more-action-plural": "Ещё действия", "more-actions": "Дополнительные действия", "more-help": "Дополнительная помощь", "more-lowercase": "больше", @@ -1554,6 +1579,7 @@ "native-field-plural": "Нативные поля", "navigation": "Навигация", "navigation-menu-plural": "Меню навигации", + "need-attention": "требуют внимания", "need-help": "Нужна помощь", "needs-attention": "Требует Внимания", "needs-review": "Нуждается в проверке", @@ -1605,6 +1631,7 @@ "no-records": "Нет записей", "no-result-found": "Результаты не найдены.", "no-reviewer": "Нет согласующего", + "no-status": "Нет статуса", "no-tags-added": "Теги не добавлены", "no-tasks-yet": "Пока нет задач", "no-tests-run": "Тесты не запущены", @@ -1741,6 +1768,7 @@ "part-of": "Часть", "part-of-domain": "Часть домена", "partial-coverage": "Частичное покрытие", + "partial-success": "Частичный успех", "partition-lowercase-plural": "разделы", "partition-plural": "Разделы", "partitioned": "Разделенный", @@ -1885,12 +1913,15 @@ "public-team": "Открытая команда", "published": "Опубликовано", "quality": "Качество", + "queries-processed": "запросов обработано", + "queries-scanned": "запросов просканировано", "query": "Запрос", "query-log-duration": "Длительность лога запроса", "query-lowercase": "запрос", "query-lowercase-plural": "запросы", "query-parameter-plural": "Параметры Запроса", "query-plural": "Запросы", + "query-plural-lowercase": "запросы", "query-used-in": "Копировать в другие таблицы", "queued": "В ожидании", "quick-add": "Быстрое добавление", @@ -1902,11 +1933,13 @@ "range": "Диапазон", "range-condition": "Условие диапазона", "raw-connection-log": "Raw Connection Log", + "raw-logs": "Необработанные логи", "rdf-predicate": "RDF-предикат", "rdf-store": "RDF-хранилище", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Переназначить", "re-deploy": "Повторное развертывание", + "re-deploy-sentence": "Развернуть заново", "re-enter-new-password": "Повторно введите новый пароль", "re-index-all": "Переиндексировать все", "re-index-elasticsearch": "Переиндексировать Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "Недавние", "recent-event-plural": "Недавние события", "recent-run-plural": "Недавние запуски", + "recent-runs-sentence": "Недавние выполнения", "recent-search-term-plural": "Недавние условия поиска", "recent-views": "Вы смотрели", "recently-created": "Недавно созданные", @@ -1931,6 +1965,8 @@ "recently-updated": "Недавно обновленные", "recently-viewed": "Недавно просмотренные", "record-plural": "Записи", + "records": "записи", + "records-processed": "записей обработано", "recreate-index-plural": "Воссоздать индексы", "reference-plural": "Связанные ссылки", "refocused-to-home": "Фокус установлен на главную страницу", @@ -2071,6 +2107,7 @@ "run": "Запустить", "run-agent-plural": "Запустить агенты", "run-at": "Запустить в ", + "run-history-and-details": "История и сведения о выполнениях", "run-in-background": "Run in background", "run-now": "Запустить сейчас", "run-type": "Тип запуска", @@ -2138,6 +2175,7 @@ "search-index-plural": "Индексы поиска", "search-index-setting-plural": "Настройки индексов поиска", "search-insights": "Поисковая статистика", + "search-logs": "Поиск в логах", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Поиск воспоминаний по содержимому...", @@ -2248,6 +2286,7 @@ "show-nested": "Показать вложенные", "show-or-hide-advanced-config": "{{showAdv}} Расширенная конфигурация", "show-or-hide-column-plural": "Показать / скрыть столбцы", + "show-raw-logs": "Показать необработанные логи", "showing-count-of-total-assets": "Показано {{count}} из {{total}} активов", "showing-total-failure-plural": "Всего ошибок {{total}}", "sign-in": "Войти", @@ -2313,6 +2352,7 @@ "started": "Начато", "started-following": "Начало отслеживания", "starting-offset": "Начальное смещение", + "starts-after": "Начинается после", "starts-with": "начинается с", "state": "Состояние", "static": "Статический", @@ -2322,10 +2362,13 @@ "status-success": "Успешно", "stay-up-to-date": "Будьте в курсе последних событий", "step": "Шаг", + "steps": "Шаги", + "steps-lowercase": "шаги", "steward": "Steward", "stop": "Остановить", "stop-re-index-all": "Остановить переиндексацию", "stopped": "Остановлено", + "stopped-lowercase": "остановлено", "storage": "Хранилище", "storage-plural": "Хранилища", "storage-service": "Сервис хранения данных", @@ -2500,6 +2543,7 @@ "to-perform": "выполнить", "to-service-name": "Имени сервиса", "to-service-type": "Типу сервиса", + "toggle-wrap": "Переключить перенос", "token": "Token", "token-end-point": "Endpoint токена", "token-expiration": "Истечение срока действия токена", @@ -2673,6 +2717,7 @@ "view-plural": "Просмотры", "view-property-plural": "Показать свойства", "view-reindex-failure-plural": "Просмотр ошибок переиндексации", + "view-run-history": "Показать историю выполнений", "view-selected": "Просмотреть выбранное", "visibility": "Видимость", "visibility-dataspace": "Пространство данных", @@ -2685,8 +2730,10 @@ "volume-change": "Объем изменений", "wall-clock": "Реальное время", "wants-to-access-your-account": "хочет получить доступ к аккаунту {{username}}", + "warn": "Предупреждение", "warning": "Предупреждение", "warning-plural": "Предупреждения", + "warning-plural-lowercase": "предупреждения", "web-analytic-entity-view-report-data": "Данные отчёта о просмотре сущности в веб-аналитике", "web-analytic-user-activity-report-data": "Данные отчёта о активности пользователя в веб-аналитике", "web-analytics-report": "Отчет web-аналитики", @@ -2722,6 +2769,8 @@ "workflow-plural": "Рабочие процессы", "worksheet": "Рабочий лист", "worksheet-plural": "Рабочие листы", + "wrap": "Перенос", + "wrapping-up": "завершение", "year": "Год", "yes": "Да", "yes-comma-confirm": "Продолжить", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "Ищите нужные объекты данных, используя логические условия И/ИЛИ.", "agent-setup-description": "Настройте основные параметры для этого агента.", + "agents-deploy-progress": "{{done}} готово · {{running}} выполняется · {{queued}} в очереди{{failedSuffix}} — после первого прохода агенты работают по своему расписанию", + "agents-deploying-ingesting": "Агенты развёртываются и загружают метаданные", + "agents-finished-summary": "{{done}} из {{total}} агентов завершено{{attentionSuffix}}", "aggregate-domain-type-description": "Домены, которые собирают и обрабатывают данные из нескольких источников, согласованных между собой, для предоставления агрегированных данных и продуктов данных, таких как Customer 360, сеансы клиентов и т. д., для потребления другими доменами.", "airflow-guide-message": "{{brandName}} использует Airflow для запуска Ingestion Connectors. Мы разработали управляемые API для развертывания коннекторов приема. Пожалуйста, используйте экземпляр {{brandName}} Airflow или обратитесь к приведенному ниже руководству, чтобы установить управляемые API в вашей установке Airflow.", "airflow-host-ip-address": "{{brandName}} подключится к вашему ресурсу с IP-адреса <0>{{hostIp}}. Обязательно разрешите входящий трафик в настройках сетевой безопасности.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Нажмите <0>{{text}}, чтобы просмотреть подробности.", "closed-this-task": "задача закрыта", "collaborate-with-other-user": "для совместной работы с другими пользователями.", + "collate-ai-agents-description": "Автоматически распределяйте по уровням, документируйте и проверяйте качество своих объектов с помощью ИИ.", "collate-ai-widget-description": "Обзор данных, сгенерированных Collate ИИ для сервиса. <0>Узнать больше.", "column-bulk-operations-description": "Управляйте и редактируйте метаданные для нескольких столбцов одновременно.Ищите, фильтруйте и обновляйте отображаемые имена, описания, теги и термины глоссария в ваших ресурсах данных.", "column-filter-help-text": "Фильтруйте происхождение по тегам или именам колонок. Используйте 'tag:ИмяТега' для фильтрации по тегам или просто введите имя колонки.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Ошибка при получении токена доступа.", "establishing-connection-ellipsis": "Установка соединения…", "events-matching-search-query": "События, соответствующие поисковому запросу", + "everything-healthy": "всё в порядке", "example-value": "например: {{value}}", "exclude-system-entity-description": "При отключении стандартные шаблоны, определённые в схеме для {{entity}}, применяются автоматически.", "excludes-regex-line": "исключает += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Не беспокойтесь. Пришло время перестроить свои цели и двигаться быстрее.", "latency-sla-description": "<0>{{label}}: Время ответа на запрос должно быть меньше <0>{{data}}.", "latest-offset-description": "Последнее смещение события в системе.", + "latest-run-lines": "Последнее выполнение · {{count}} строк", "ldap-group-dn-placeholder": "например cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Этот DN группы LDAP уже сопоставлен. Каждая группа LDAP может быть сопоставлена только один раз.", "learning-resources-management-description": "Изучайте возможности продукта и узнавайте, как они работают, с помощью наших ресурсов", + "leave-page-ingestion-continues": "Вы можете покинуть эту страницу — загрузка продолжится в фоновом режиме", "leave-the-team-team-name": "Покинуть команду «{{teamName}}»", "length-validator-error": "Требуется не менее {{length}} {{field}}", "lineage-ingestion-description": "Прием происхождения можно настроить и развернуть после настройки приема метаданных. Рабочий процесс приема происхождения получает историю запросов, анализирует запросы CREATE, INSERT, MERGE... и подготавливает происхождение между вовлеченными сущности. У приема происхождения может быть только один конвейер для службы базы данных. Определите продолжительность журнала запросов (в днях) и лимит результатов для запуска.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "Что вы хотите проанализировать сегодня?", "mcp-chat-placeholder": "Спросите что угодно...", "mentioned-you-on-the-lowercase": "упомянул(а) вас в", + "metadata-agents-description": "Извлекайте метаданные, использование, происхождение и профилирование из источника.", "metadata-agents-table-description": "Агенты метаданных используются для извлечения метаданных из исходных сервисов.", "metadata-ingestion-description": "В зависимости от выбранного типа службы введите сведения о шаблоне фильтра для схемы, таблицы (база данных), раздела (обмен сообщениями) или панели мониторинга. Вы можете включить или исключить шаблоны фильтров. При необходимости включите представления, включите или отключите профилировщик данных и примите образцы данных.", "metadata-status-complete-description": "Метаданные полностью заполнены и согласованы во всех столбцах", @@ -3392,6 +3449,8 @@ "minimum-count-error": "Необходимо выбрать как минимум {{count}} {{field}}.", "minimum-value-error": "Максимальное значение должно быть больше минимального.", "minute": "Минута", + "minutes-left": "~осталось {{count}} мин", + "minutes-short": "{{count}} мин", "missing-config-value": "Отсутствует значение конфигурации: {{field}}", "missing-description": "Описание отсутствует", "modified-time-ago-by": "Изменено {{time}} назад {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "Сопоставления ролей LDAP не настроены.", "no-learning-resources-available": "Для этого контекста нет доступных учебных ресурсов.", "no-lineage-available": "Не найдено связей lineage", + "no-lines-match": "Нет совпадающих строк.", "no-match-found": "Совпадения не найдены", "no-mentions": "Вас или вашу команду не упоминали в каких-либо действиях.", "no-native-fields": "Для этого типа сущности нет настраиваемых нативных полей.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Профайлер данных — это необязательная конфигурация при получении данных. Включите профилировщик данных, следуя документации.", "no-profiler-title": "Запустите профайлер, чтобы разблокировать статистику таблицы", "no-properties-added": "No properties added.", + "no-recent-runs": "Недавние выполнения не найдены.", "no-recently-viewed-data": "Нет недавно просмотренных данных.", "no-reference-available": "Нет доступных ссылок.", "no-related-terms-available": "Нет доступных связанных терминов.", @@ -3638,6 +3699,7 @@ "password-error-message": "Пароль должен содержать не менее 8 и не более 56 символов, включая как минимум один символ верхнего регистра (A-Z), один символ нижнего регистра (az), одну цифру и один специальный символ (например, !, %, @ или #). )", "password-pattern-error": "Пароль должен состоять минимум из 8 и максимум из 56 символов, включая один специальный, один верхний и один нижний регистр.", "path-of-the-dbt-files-stored": "Путь к папке, в которой хранятся файлы dbt", + "percent-complete-all-agents": "{{percent}}% завершено по всем агентам", "permanently-delete-common-message": "Удалить этот {{entity}} и все его метаданные навсегда. Это действие нельзя отменить.", "permanently-delete-ingestion-pipeline": "Безвозвратное удаление <0>{{entityName}} приведет к потере конфигурации конвейера, и его нельзя будет восстановить.", "permanently-delete-metadata": "Внимание! Удаление объекта <0>{{entityName}} невозможно отменить — все метаданные будут утеряны.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Конфигурация того, как далеко мы хотим заглянуть в журналы логов для обработки данных об использовании.", "query-used-by-other-tables": "Запрос, используемый другими таблицами", "quick-add-tip": "Используйте «Быстрое добавление» для создания связей между терминами глоссария, не покидая граф.", + "ran-for-duration": "выполнялось {{duration}} мин", "rdf-not-enabled-for-export": "Для экспорта онтологии необходимо включить RDF. Пожалуйста, включите RDF в настройках сервера.", "rdf-predicate-tooltip": "URI RDF-предиката для этого типа связи (например, skos:broader, skos:exactMatch).", "reacted-with-emoji": "поставил(а) реакцию {{type}}", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Данные должны храниться в течение <0>{{data}}.", "run-sample-data-to-ingest-sample-data": "Запустите образцы данных, чтобы добавить образцы данных в свои {{brandName}}.", "run-status-at-timestamp": "Статус запуска: {{status}} в {{timestamp}}", + "run-status-click-details": "выполнение {{status}} · нажмите для сведений", "run-successful-test-to-continue": "Выполните успешный тест для продолжения.", "sample-data-ingestion-config-description": "Эта схема определяет параметры, которые могут быть переданы для сбора примеров данных.", "schedule-description": "Запланируйте запуск извлечения в определенное время и с определенной частотой.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Просматривайте статистику поискового кластера, сведения об индексах и управляйте потерянными индексами.", "search-settings-description": "Настройки поиска для каждой сущности на основе рейтингов.", "search-settings-for-entity": "Настройки поиска на основе рейтинга для объекта «{{entity}}»", + "seconds-left": "~осталось {{count}} с", + "seconds-short": "{{count}} с", "see-also": "Смотри также", "see-how-to-get-started": "Узнайте, как начать", "select-alert-type": "Выберите тип оповещения", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json index a73a38c4c9c9..2f82ce367940 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json @@ -97,6 +97,7 @@ "advanced-configuration": "Avancerad konfiguration", "advanced-entity": "Avancerad {{entity}}", "advanced-search": "Avancerad sökning", + "agent": "Agent", "agent-activity": "Agentaktivitet", "agent-plural": "Agenter", "agent-setup": "Agentinställning", @@ -189,6 +190,8 @@ "asset-plural": "Tillgångar", "asset-plural-lowercase": "tillgångar", "asset-type": "Tillgångstyp", + "assets-ingested": "tillgångar inlästa", + "assets-profiled": "tillgångar profilerade", "assigned": "Tilldelad", "assigned-entity": "Tilldelad {{entity}}", "assigned-to-me": "Tilldelad till mig", @@ -248,6 +251,7 @@ "basic-configuration": "Grundkonfiguration", "batch-size": "Batchstorlek", "bearer-hmac-signature": "Bearer (HMAC-signatur)", + "before-error": "före fel", "before-number-of-day-plural": "Före {{numberOfDays}} dagar", "belongs-to": "Tillhör", "belongs-to-database": "Tillhör databas", @@ -369,6 +373,7 @@ "collapse": "Komprimera", "collapse-all": "Fäll ihop alla", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Collate AI Agenter", "collection": "Samling", "collection-plural": "Samlingar", "color": "Färg", @@ -492,7 +497,7 @@ "cost-analysis": "Kostnadsanalys", "count": "Antal", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} körs", "cover-image": "Omslag", "covered": "Täckt", "create": "Skapa", @@ -664,12 +669,14 @@ "dbt-source": "dbt-källa", "dbt-source-project": "dbt-projekt", "deactivated": "Inaktiverad", + "debug": "Felsök", "december": "December", "decision": "Beslut", "default": "Standard", "default-persona": "Standardpersona", "default-role": "Standardroll", "delete": "Ta bort", + "delete-agent": "Ta bort agent", "delete-all-nodes": "Ta bort alla noder", "delete-boost": "Ta bort boost", "delete-data-asset-rule": "Ta bort regel för datatillgång", @@ -697,6 +704,7 @@ "deployed": "Distribuerad", "deployed-lowercase": "distribuerad", "deploying-lowercase": "distribuerar", + "deployment-complete": "Distribution slutförd", "deprecate": "Deprecate", "depth": "Djup", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Detaljer", "details": "Detaljer", "developed-by-developer": "Utvecklad av {{developer}}", + "diagnose": "Diagnostisera", "diagnostic-info": "Diagnostikinformation", "did-not-run": "Kördes inte", "dimension": "Dimension", @@ -784,6 +793,7 @@ "drive-plural": "Enheter", "duplicate": "Duplicera", "duration": "Varaktighet", + "duration-in-minute": "{{duration}} min", "dynamic": "Dynamisk", "dynamic-assertion": "Dynamisk assertion", "edge": "Kant", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Redigera och godkänn förslag", "edit-an-announcement": "Redigera ett tillkännagivande", "edit-chart-name": "Redigera diagram: \"{{name}}\"", + "edit-configuration": "Redigera konfiguration", "edit-connection": "Redigera anslutning", "edit-data-asset-rule": "Redigera datatillgångsregel", "edit-description-for": "Redigera beskrivning för {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "Ekvivalens", "error": "Fel", "error-plural": "Fel", + "error-plural-lowercase": "fel", "esc": "Esc", + "est-remaining": "beräknat kvar", "establish-connection": "Upprätta anslutning", "evaluate": "Utvärdera", "evaluate-permission": "Utvärdera behörighet", @@ -972,8 +985,10 @@ "factor": "Faktor", "fail-on-conflict": "Misslyckas vid konflikt", "failed": "Misslyckades", + "failed-at": "Misslyckades vid", "failed-entity": "Misslyckad {{entity}}", "failed-event-plural": "Misslyckade händelser", + "failed-lowercase": "misslyckades", "failed-rows": "Misslyckade rader", "failed-slash-aborted-reason": "Orsak till misslyckad/avbruten", "failed-to-upload-file": "Det gick inte att ladda upp filen", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Filtermönster", "filter-plural": "Filter", "filtered": "Filtrerad", + "filtered-lowercase": "filtrerade", "filtering-condition": "Filtreringsvillkor", "filters-configuration": "Filterkonfiguration", + "finished": "Klar", + "finished-lowercase": "klar", "first": "Första", "first-lowercase": "första", "first-name": "Förnamn", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Dölj inställningar för personifiering ({{count}})", "hide-meta-details": "Dölj metadetaljer", "hide-property-plural": "Dölj egenskaper", + "hide-raw-logs": "Dölj råloggar", "hierarchical": "Hierarkisk", "hierarchy": "Hierarki", "hierarchy-depth": "Hierarkidjup", @@ -1170,6 +1189,7 @@ "homepage": "Startsida", "hour": "Timme", "hourly": "Varje timme", + "how-to-fix": "Så här åtgärdar du", "http-config-source": "HTTP-konfigurationskälla", "http-method": "HTTP-metod", "hybrid-search-weight-plural": "Hybridsökningsvikter", @@ -1226,6 +1246,7 @@ "index-name": "Indexnamn", "index-states": "Indexstatistik", "indirect": "Indirekt", + "info": "Info", "ingest-sample-data": "Mata in exempeldata", "ingestion": "Inmatning", "ingestion-lowercase": "inmatning", @@ -1297,6 +1318,7 @@ "keyword": "Nyckelord", "keyword-lowercase-plural": "nyckelord", "kill": "Avsluta", + "kill-run": "Avbryt körning", "knowledge": "Kunskap", "knowledge-article-plural": "Kunskapsartiklar", "knowledge-center": "Kunskapscenter", @@ -1508,7 +1530,9 @@ "model": "Modell", "model-name": "Modellnamn", "model-plural": "Modeller", + "model-plural-lowercase": "modeller", "model-store": "Modellager", + "models-parsed": "modeller tolkade", "modified-time": "Ändringstid", "modifier": "Modifierare", "monday": "Måndag", @@ -1517,6 +1541,7 @@ "monthly": "Månadsvis", "more": "Mer", "more-action": "Fler åtgärder", + "more-action-plural": "Fler åtgärder", "more-actions": "Fler åtgärder", "more-help": "Mer hjälp", "more-lowercase": "mer", @@ -1554,6 +1579,7 @@ "native-field-plural": "Native Fields", "navigation": "Navigering", "navigation-menu-plural": "Navigeringsmenyer", + "need-attention": "kräver uppmärksamhet", "need-help": "Behöver du hjälp", "needs-attention": "Kräver uppmärksamhet", "needs-review": "Behöver granskas", @@ -1605,6 +1631,7 @@ "no-records": "Inga poster", "no-result-found": "Inget resultat hittades.", "no-reviewer": "Ingen granskare", + "no-status": "Ingen status", "no-tags-added": "Inga taggar tillagda", "no-tasks-yet": "Inga uppgifter ännu", "no-tests-run": "Inga tester körda", @@ -1741,6 +1768,7 @@ "part-of": "Del av", "part-of-domain": "Del av domän", "partial-coverage": "Delvis täckning", + "partial-success": "Delvis lyckad", "partition-lowercase-plural": "partitioner", "partition-plural": "Partitioner", "partitioned": "Partitionerad", @@ -1885,12 +1913,15 @@ "public-team": "Offentligt team", "published": "Publicerad", "quality": "Kvalitet", + "queries-processed": "frågor bearbetade", + "queries-scanned": "frågor skannade", "query": "Fråga", "query-log-duration": "Varaktighet för frågelogg", "query-lowercase": "fråga", "query-lowercase-plural": "frågor", "query-parameter-plural": "Frågeparametrar", "query-plural": "Frågor", + "query-plural-lowercase": "frågor", "query-used-in": "Fråga används i", "queued": "I kö", "quick-add": "Snabblägg till", @@ -1902,11 +1933,13 @@ "range": "Intervall", "range-condition": "Intervallvillkor", "raw-connection-log": "Rå anslutningslogg", + "raw-logs": "Råloggar", "rdf-predicate": "RDF-predikat", "rdf-store": "RDF-lager", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Tilldela om", "re-deploy": "Distribuera om", + "re-deploy-sentence": "Distribuera om", "re-enter-new-password": "Ange nytt lösenord igen", "re-index-all": "Indexera om alla", "re-index-elasticsearch": "Indexera om Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "Senaste", "recent-event-plural": "Senaste händelser", "recent-run-plural": "Senaste körningar", + "recent-runs-sentence": "Senaste körningar", "recent-search-term-plural": "Senaste sökord", "recent-views": "Senaste visningar", "recently-created": "Nyligen skapad", @@ -1931,6 +1965,8 @@ "recently-updated": "Nyligen uppdaterad", "recently-viewed": "Nyligen visad", "record-plural": "Poster", + "records": "poster", + "records-processed": "poster bearbetade", "recreate-index-plural": "Återskapa index", "reference-plural": "Referenser", "refocused-to-home": "Återfokuserad till start", @@ -2071,6 +2107,7 @@ "run": "Kör", "run-agent-plural": "Kör agenter", "run-at": "Kör vid", + "run-history-and-details": "Körhistorik och detaljer", "run-in-background": "Run in background", "run-now": "Kör nu", "run-type": "Körtyp", @@ -2138,6 +2175,7 @@ "search-index-plural": "Sökindex", "search-index-setting-plural": "Inställningar för sökindex", "search-insights": "Sökinsikter", + "search-logs": "Sök i loggar", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Sök minnen efter innehåll...", @@ -2248,6 +2286,7 @@ "show-nested": "Visa nästlade", "show-or-hide-advanced-config": "{{showAdv}} avancerad konfiguration", "show-or-hide-column-plural": "Visa / dölj kolumner", + "show-raw-logs": "Visa råloggar", "showing-count-of-total-assets": "Visar {{count}} av {{total}} tillgångar", "showing-total-failure-plural": "Totalt {{total}} misslyckanden", "sign-in": "Logga in", @@ -2313,6 +2352,7 @@ "started": "Startad", "started-following": "Började följa", "starting-offset": "Startförskjutning", + "starts-after": "Startar efter", "starts-with": "starts with", "state": "Tillstånd", "static": "Statisk", @@ -2322,10 +2362,13 @@ "status-success": "Lyckades", "stay-up-to-date": "Håll dig uppdaterad", "step": "Steg", + "steps": "Steg", + "steps-lowercase": "steg", "steward": "Steward", "stop": "Stoppa", "stop-re-index-all": "Stoppa omindexering", "stopped": "Stoppad", + "stopped-lowercase": "stoppad", "storage": "Lagring", "storage-plural": "Lagringar", "storage-service": "Lagringstjänst", @@ -2500,6 +2543,7 @@ "to-perform": "att utföra", "to-service-name": "Till tjänstnamn", "to-service-type": "Till tjänsttyp", + "toggle-wrap": "Växla radbrytning", "token": "Token", "token-end-point": "TokenEndpoint", "token-expiration": "Tokenutgång", @@ -2673,6 +2717,7 @@ "view-plural": "Vyer", "view-property-plural": "Visa egenskaper", "view-reindex-failure-plural": "Visa omindexeringsfel", + "view-run-history": "Visa körhistorik", "view-selected": "Visa valda", "visibility": "Synlighet", "visibility-dataspace": "Dataspace", @@ -2685,8 +2730,10 @@ "volume-change": "Volymförändring", "wall-clock": "Realtid", "wants-to-access-your-account": "vill komma åt ditt {{username}}-konto", + "warn": "Varning", "warning": "Varning", "warning-plural": "Varningar", + "warning-plural-lowercase": "varningar", "web-analytic-entity-view-report-data": "Rapportdata för webbanalys av entitetsvisningar", "web-analytic-user-activity-report-data": "Rapportdata för webbanalys av användaraktivitet", "web-analytics-report": "Webbanalysrapport", @@ -2722,6 +2769,8 @@ "workflow-plural": "Arbetsflöden", "worksheet": "Kalkylblad", "worksheet-plural": "Kalkylblad", + "wrap": "Radbryt", + "wrapping-up": "avslutar", "year": "År", "yes": "Ja", "yes-comma-confirm": "Ja, bekräfta", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Alternativ på drivrutinsnivå — anslutningsargument, schema och tidsgränser. De flesta anslutningar behöver aldrig dessa.", "advanced-search-message": "Hitta rätt datatillgångar med syntaxredigeraren och och/eller-villkor.", "agent-setup-description": "Konfigurera kärnparametrarna för denna agent.", + "agents-deploy-progress": "{{done}} klara · {{running}} körs · {{queued}} i kö{{failedSuffix}} — agenterna körs enligt sitt schema efter denna första omgång", + "agents-deploying-ingesting": "Agenter distribueras och läser in metadata", + "agents-finished-summary": "{{done}} av {{total}} agenter klara{{attentionSuffix}}", "aggregate-domain-type-description": "Domäner som samlar in och kurerar data från flera källanpassade domäner för att tillhandahålla aggregerade data och dataprodukter, såsom Customer 360, kundsessioner osv., för andra domäner att använda.", "airflow-guide-message": "{{brandName}} använder Airflow för att köra inmatningsanslutningar. Vi har utvecklat hanterade API:er för att driftsätta inmatningsanslutningar. Använd {{brandName}}-instansen av Airflow eller se guiden nedan för att installera de hanterade API:erna i din Airflow-installation.", "airflow-host-ip-address": "{{brandName}} ansluter till din resurs från IP-adressen <0>{{hostIp}}. Se till att tillåta inkommande trafik i dina nätverkssäkerhetsinställningar.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Klicka på <0>{{text}} för att visa detaljer.", "closed-this-task": "stängde den här uppgiften", "collaborate-with-other-user": "för att samarbeta med andra användare.", + "collate-ai-agents-description": "Klassificera automatiskt, dokumentera och kvalitetskontrollera dina tillgångar med AI.", "collate-ai-widget-description": "Översikt över de data som genererats av Collate AI för tjänsten. <0>läs mer.", "column-bulk-operations-description": "Hantera och redigera metadata för flera kolumner samtidigt. Sök, filtrera och uppdatera visningsnamn, beskrivningar, taggar och ordlistetermer över dina datatillgångar.", "column-filter-help-text": "Filtrera härkomst efter kolumntaggar eller namn. Använd 'tag:TagName' för taggfiltrering eller ange bara kolumnnamnet.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Fel vid hämtning av åtkomsttoken.", "establishing-connection-ellipsis": "Upprättar anslutning…", "events-matching-search-query": "Händelser som matchar sökfrågan", + "everything-healthy": "allt fungerar bra", "example-value": "t.ex. {{value}}", "exclude-system-entity-description": "När inaktiverat tillämpas de standardschema-definierade mönstren för {{entity}} automatiskt.", "excludes-regex-line": "utesluter += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Observera: KPI-målet för Beskrivning har ännu inte uppnåtts, men det finns fortfarande tid – din organisation har {{count}} dagar kvar. För att hålla dig på rätt spår, aktivera Data Insights-rapporten. Detta gör att vi kan skicka veckovisa uppdateringar till alla team, vilket främjar samarbete och fokus mot att uppnå din organisations KPI:er.", "latency-sla-description": "<0>{{label}}: Frågesvar måste vara under <0>{{data}}", "latest-offset-description": "Den senaste offseten för händelsen i systemet.", + "latest-run-lines": "Senaste körning · {{count}} rader", "ldap-group-dn-placeholder": "t.ex. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Detta LDAP-grupp-DN är redan mappat. Varje LDAP-grupp kan endast mappas en gång.", "learning-resources-management-description": "Utforska produktfunktioner och lär dig hur de fungerar genom våra resurser", + "leave-page-ingestion-continues": "Du kan lämna den här sidan — inläsningen fortsätter i bakgrunden", "leave-the-team-team-name": "Lämna teamet {{teamName}}", "length-validator-error": "Minst {{length}} {{field}} krävs", "lineage-ingestion-description": "Härkomstinmatning kan konfigureras och distribueras efter att en metadatainmatning har konfigurerats. Härkomstinmatningens arbetsflöde hämtar frågehistoriken, tolkar CREATE-, INSERT-, MERGE...-frågor och förbereder härkomsten mellan de involverade entiteterna. Härkomstinmatningen kan endast ha en pipeline för en databastjänst. Definiera frågeloggens varaktighet (i dagar) och resultatgräns för att börja.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "Vad vill du analysera idag?", "mcp-chat-placeholder": "Fråga vad som helst...", "mentioned-you-on-the-lowercase": "nämnde dig på", + "metadata-agents-description": "Extrahera metadata, användning, härkomst och profilering från källan.", "metadata-agents-table-description": "Metadataagenter används för att extrahera metadata från källtjänsterna.", "metadata-ingestion-description": "Baserat på vald tjänsttyp, ange filtermönsterdetaljer för schemat eller tabellen (databas), eller ämnet (meddelanden), eller instrumentpanelen. Du kan inkludera eller exkludera filtermönstren. Välj att inkludera vyer, aktivera eller inaktivera dataprofileraren och mata in exempeldata efter behov.", "metadata-status-complete-description": "Metadata är helt ifyllda och konsekventa över alla kolumner", @@ -3392,6 +3449,8 @@ "minimum-count-error": "Minst {{count}} {{field}} måste väljas.", "minimum-value-error": "Det minimala värdet bör vara mindre än det maximala värdet.", "minute": "Minut", + "minutes-left": "~{{count}} min kvar", + "minutes-short": "{{count}} min", "missing-config-value": "Konfigurationsvärde saknas: {{field}}", "missing-description": "Beskrivning saknas", "modified-time-ago-by": "Ändrad för {{time}} sedan av {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "Inga LDAP-rollmappningar konfigurerade.", "no-learning-resources-available": "Inga utbildningsresurser tillgängliga för detta sammanhang.", "no-lineage-available": "Inga härkomstanslutningar hittades", + "no-lines-match": "Inga rader matchar.", "no-match-found": "Ingen matchning hittades", "no-mentions": "Det ser ut som att du och ditt team är helt à jour – inga omnämnanden i några aktiviteter ännu. Fortsätt med det fina arbetet!", "no-native-fields": "No configurable native fields for this entity type.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Utforska din tabells mätvärden genom att köra profilerararbetsflödet. Du ser radantal, tabelluppdateringar, volymförändringar och mer. Besök vår dokumentation för installationssteg ", "no-profiler-title": "Kör profileraren för att låsa upp tabellinsikter", "no-properties-added": "Inga egenskaper har lagts till.", + "no-recent-runs": "Inga senaste körningar hittades.", "no-recently-viewed-data": "Du har inte visat några datatillgångar nyligen. Utforska för att hitta något intressant!", "no-reference-available": "Inga referenser tillgängliga.", "no-related-terms-available": "Inga relaterade termer tillgängliga.", @@ -3638,6 +3699,7 @@ "password-error-message": "Lösenordet måste vara minst 8 och högst 56 tecken långt och innehålla minst ett versalt tecken (A-Z), ett gement tecken (a-z), en siffra och ett specialtecken (såsom !, %, @ eller #)", "password-pattern-error": "Lösenordet måste vara minst 8 och högst 56 tecken, med ett specialtecken, ett versalt och ett gement tecken", "path-of-the-dbt-files-stored": "Sökväg till mappen där dbt-filerna lagras", + "percent-complete-all-agents": "{{percent}}% klart för alla agenter", "permanently-delete-common-message": "Ta bort denna {{entity}} och alla dess metadata för alltid. Detta kan inte ångras.", "permanently-delete-ingestion-pipeline": "Att permanent ta bort denna <0>{{entityName}} resulterar i förlust av pipelinekonfigurationen, och den kan inte återställas.", "permanently-delete-metadata": "Att permanent ta bort denna <0>{{entityName}} resulterar i att dess metadata tas bort från {{brandName}}, och den kan inte återställas.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Konfiguration för att finjustera hur långt tillbaka vi vill titta i frågeloggar för att bearbeta användningsdata.", "query-used-by-other-tables": "Fråga som används av andra tabeller", "quick-add-tip": "Använd Snabbtillägg för att skapa relationer mellan ordlistetermer utan att lämna grafen.", + "ran-for-duration": "kördes i {{duration}} min", "rdf-not-enabled-for-export": "RDF måste vara aktiverat för att exportera ontologi. Aktivera RDF i din serverkonfiguration.", "rdf-predicate-tooltip": "RDF-predikat-URI:n för den här relationstypen (t.ex. skos:broader, skos:exactMatch).", "reacted-with-emoji": "reagerade med {{type}}-emoji", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Data ska behållas i <0>{{data}}", "run-sample-data-to-ingest-sample-data": "'Kör exempeldata för att mata in exempeldatatillgångar i din {{brandName}}.'", "run-status-at-timestamp": "Körningsstatus: {{status}} vid {{timestamp}}", + "run-status-click-details": "körning {{status}} · klicka för detaljer", "run-successful-test-to-continue": "Kör ett lyckat test för att fortsätta.", "sample-data-ingestion-config-description": "Detta schema definierar de parametrar som kan skickas för insamling av exempeldata.", "schedule-description": "Schemalägg inmatningen att köras vid en viss tidpunkt och frekvens.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Visa statistik för sökkluster, indexdetaljer och hantera föräldralösa index.", "search-settings-description": "Sökinställningar för varje entitet baserat på rangordningar.", "search-settings-for-entity": "Sök inställningar baserat på rankning för {{entity}}", + "seconds-left": "~{{count}}s kvar", + "seconds-short": "{{count}}s", "see-also": "Se även", "see-how-to-get-started": "Se hur du kommer igång", "select-alert-type": "Välj en aviseringstyp", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json index c904bac1793f..1aad270d3103 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json @@ -97,6 +97,7 @@ "advanced-configuration": "การกำหนดค่าขั้นสูง", "advanced-entity": "ขั้นสูง {{entity}}", "advanced-search": "การค้นหาขั้นสูง", + "agent": "เอเจนต์", "agent-activity": "กิจกรรมของตัวแทน", "agent-plural": "เอเจนต์", "agent-setup": "ตั้งค่าตัวแทน", @@ -189,6 +190,8 @@ "asset-plural": "ทรัพย์สินหลายรายการ", "asset-plural-lowercase": "ทรัพย์สิน", "asset-type": "ประเภทสินทรัพย์", + "assets-ingested": "แอสเซทที่นำเข้าแล้ว", + "assets-profiled": "แอสเซทที่ทำโปรไฟล์แล้ว", "assigned": "มอบหมายแล้ว", "assigned-entity": "มอบหมาย {{entity}}", "assigned-to-me": "มอบหมายให้ฉัน", @@ -248,6 +251,7 @@ "basic-configuration": "การกำหนดค่าพื้นฐาน", "batch-size": "ขนาดชุดข้อมูล", "bearer-hmac-signature": "Bearer (ลายเซ็น HMAC)", + "before-error": "ก่อนเกิดข้อผิดพลาด", "before-number-of-day-plural": "ก่อน {{numberOfDays}} วัน", "belongs-to": "เป็นของ", "belongs-to-database": "เป็นของฐานข้อมูล", @@ -369,6 +373,7 @@ "collapse": "ย่อ", "collapse-all": "ย่อทั้งหมด", "collate-ai": "รวบรวม AI", + "collate-ai-agent-plural": "Collate AI Agents", "collection": "การรวบรวม", "collection-plural": "การรวบรวมหลายรายการ", "color": "สี", @@ -492,7 +497,7 @@ "cost-analysis": "การวิเคราะห์ต้นทุน", "count": "จำนวน", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} กำลังรัน", "cover-image": "ปก", "covered": "ครอบคลุม", "create": "สร้าง", @@ -664,12 +669,14 @@ "dbt-source": "แหล่งที่มาของ dbt", "dbt-source-project": "โปรเจกต์ต้นทาง dbt", "deactivated": "ถูกปิดการใช้งาน", + "debug": "ดีบัก", "december": "ธันวาคม", "decision": "การตัดสินใจ", "default": "ค่าเริ่มต้น", "default-persona": "บุคลิกภาพเริ่มต้น", "default-role": "บทบาทเริ่มต้น", "delete": "ลบ", + "delete-agent": "ลบเอเจนต์", "delete-all-nodes": "ลบโหนดทั้งหมด", "delete-boost": "ลบการเพิ่มประสิทธิภาพ", "delete-data-asset-rule": "ลบกฎสินทรัพย์ข้อมูล", @@ -697,6 +704,7 @@ "deployed": "เรียกใช้แล้ว", "deployed-lowercase": "ถูกเรียกใช้", "deploying-lowercase": "กำลังเรียกใช้", + "deployment-complete": "ปรับใช้เสร็จสมบูรณ์", "deprecate": "Deprecate", "depth": "ความลึก", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "รายละเอียด", "details": "รายละเอียด", "developed-by-developer": "พัฒนาโดย {{developer}}", + "diagnose": "วินิจฉัย", "diagnostic-info": "ข้อมูลการวินิจฉัย", "did-not-run": "ไม่ได้รัน", "dimension": "มิติ", @@ -784,6 +793,7 @@ "drive-plural": "ไดรฟ์", "duplicate": "ซ้ำกัน", "duration": "ระยะเวลา", + "duration-in-minute": "{{duration}} นาที", "dynamic": "ไดนามิก", "dynamic-assertion": "การยืนยันแบบไดนามิก", "edge": "ขอบ", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "แก้ไข & ยอมรับข้อเสนอแนะ", "edit-an-announcement": "แก้ไขประกาศ", "edit-chart-name": "แก้ไขกราฟ: \"{{name}}\"", + "edit-configuration": "แก้ไขการกำหนดค่า", "edit-connection": "แก้ไขการเชื่อมต่อ", "edit-data-asset-rule": "แก้ไขกฎสินทรัพย์ข้อมูล", "edit-description-for": "แก้ไขคำอธิบายสำหรับ {{entityName}}", @@ -909,7 +920,9 @@ "equivalence": "ความเท่าเทียม", "error": "ข้อผิดพลาด", "error-plural": "ข้อผิดพลาดหลายรายการ", + "error-plural-lowercase": "ข้อผิดพลาด", "esc": "Esc", + "est-remaining": "โดยประมาณที่เหลือ", "establish-connection": "Establish Connection", "evaluate": "ประเมินผล", "evaluate-permission": "ประเมินสิทธิ์", @@ -972,8 +985,10 @@ "factor": "ปัจจัย", "fail-on-conflict": "ล้มเหลวเมื่อมีความขัดแย้ง", "failed": "ล้มเหลว", + "failed-at": "ล้มเหลวที่", "failed-entity": "{{entity}} ที่ล้มเหลว", "failed-event-plural": "เหตุการณ์ที่ล้มเหลว", + "failed-lowercase": "ล้มเหลว", "failed-rows": "แถวที่ล้มเหลว", "failed-slash-aborted-reason": "เหตุผลที่ล้มเหลว/ยกเลิก", "failed-to-upload-file": "ลงทะเบียนไฟล์ล้มเหลว", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "รูปแบบตัวกรอง", "filter-plural": "ตัวกรองหลายรายการ", "filtered": "ถูกกรอง", + "filtered-lowercase": "กรองแล้ว", "filtering-condition": "เงื่อนไขการกรอง", "filters-configuration": "การกำหนดค่าตัวกรอง", + "finished": "เสร็จสิ้น", + "finished-lowercase": "เสร็จสิ้น", "first": "แรก", "first-lowercase": "แรก", "first-name": "ชื่อ", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "ซ่อนการตั้งค่าการแอบอ้างตัวตน ({{count}})", "hide-meta-details": "ซ่อนรายละเอียดเมตา", "hide-property-plural": "ซ่อนคุณลักษณะ", + "hide-raw-logs": "ซ่อนล็อกดิบ", "hierarchical": "ลำดับชั้น", "hierarchy": "ลำดับชั้น", "hierarchy-depth": "ความลึกของลำดับชั้น", @@ -1170,6 +1189,7 @@ "homepage": "หน้าแรก", "hour": "ชั่วโมง", "hourly": "รายชั่วโมง", + "how-to-fix": "วิธีแก้ไข", "http-config-source": "แหล่งที่มาของการตั้งค่า HTTP", "http-method": "วิธี HTTP", "hybrid-search-weight-plural": "น้ำหนักการค้นหาแบบไฮบริด", @@ -1226,6 +1246,7 @@ "index-name": "ชื่อดัชนี", "index-states": "สถานะดัชนี", "indirect": "โดยอ้อม", + "info": "ข้อมูล", "ingest-sample-data": "นำเข้าข้อมูลตัวอย่าง", "ingestion": "การนำเข้า", "ingestion-lowercase": "การนำเข้า", @@ -1297,6 +1318,7 @@ "keyword": "คำสำคัญ", "keyword-lowercase-plural": "คำสำคัญ", "kill": "ฆ่า", + "kill-run": "หยุดการรัน", "knowledge": "ความรู้", "knowledge-article-plural": "บทความความรู้", "knowledge-center": "ศูนย์ความรู้", @@ -1508,7 +1530,9 @@ "model": "โมเดล", "model-name": "ชื่อโมเดล", "model-plural": "โมเดลหลายรายการ", + "model-plural-lowercase": "โมเดล", "model-store": "ที่เก็บโมเดล", + "models-parsed": "โมเดลที่แจงแล้ว", "modified-time": "เวลาที่แก้ไข", "modifier": "ตัวปรับแต่ง", "monday": "วันจันทร์", @@ -1517,6 +1541,7 @@ "monthly": "รายเดือน", "more": "เพิ่มเติม", "more-action": "การดำเนินการเพิ่มเติม", + "more-action-plural": "การดำเนินการเพิ่มเติม", "more-actions": "การดำเนินการเพิ่มเติม", "more-help": "ช่วยเหลือเพิ่มเติม", "more-lowercase": "เพิ่มเติม", @@ -1554,6 +1579,7 @@ "native-field-plural": "ฟิลด์เนทีฟ", "navigation": "การนำทาง", "navigation-menu-plural": "เมนูนำทาง", + "need-attention": "ต้องการความสนใจ", "need-help": "ต้องการความช่วยเหลือ", "needs-attention": "ต้องให้ความสนใจ", "needs-review": "ต้องการการตรวจสอบ", @@ -1605,6 +1631,7 @@ "no-records": "ไม่มีบันทึก", "no-result-found": "ไม่พบผลลัพธ์", "no-reviewer": "ไม่มีผู้ตรวจสอบ", + "no-status": "ไม่มีสถานะ", "no-tags-added": "ไม่มีแท็กที่เพิ่ม", "no-tasks-yet": "ไม่มีงานที่คุณต้องทำ", "no-tests-run": "ไม่มีการเรียกใช้การทดสอบ", @@ -1741,6 +1768,7 @@ "part-of": "ส่วนของ", "part-of-domain": "เป็นส่วนหนึ่งของโดเมน", "partial-coverage": "ครอบคลุมบางส่วน", + "partial-success": "สำเร็จบางส่วน", "partition-lowercase-plural": "พาร์ติชัน", "partition-plural": "พาร์ติชันหลายรายการ", "partitioned": "แบ่งพาร์ติชัน", @@ -1885,12 +1913,15 @@ "public-team": "ทีมสาธารณะ", "published": "เผยแพร่แล้ว", "quality": "คุณภาพ", + "queries-processed": "เคียวรีที่ประมวลผลแล้ว", + "queries-scanned": "เคียวรีที่สแกนแล้ว", "query": "การสอบถาม", "query-log-duration": "ระยะเวลาบันทึกการสอบถาม", "query-lowercase": "การสอบถาม", "query-lowercase-plural": "การสอบถามหลายรายการ", "query-parameter-plural": "พารามิเตอร์ค้นหา", "query-plural": "การสอบถาม", + "query-plural-lowercase": "เคียวรี", "query-used-in": "การสอบถามที่ใช้ใน", "queued": "อยู่ในคิว", "quick-add": "เพิ่มด่วน", @@ -1902,11 +1933,13 @@ "range": "ช่วง", "range-condition": "เงื่อนไขช่วง", "raw-connection-log": "Raw Connection Log", + "raw-logs": "ล็อกดิบ", "rdf-predicate": "RDF Predicate", "rdf-store": "RDF Store", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "มอบหมายใหม่", "re-deploy": "เรียกใช้ใหม่", + "re-deploy-sentence": "ปรับใช้ใหม่", "re-enter-new-password": "ป้อนรหัสผ่านใหม่อีกครั้ง", "re-index-all": "สร้างดัชนีใหม่ทั้งหมด", "re-index-elasticsearch": "สร้างดัชนีใหม่ใน Elasticsearch", @@ -1924,6 +1957,7 @@ "recent-chat": "ล่าสุด", "recent-event-plural": "เหตุการณ์ล่าสุด", "recent-run-plural": "การรันล่าสุด", + "recent-runs-sentence": "การรันล่าสุด", "recent-search-term-plural": "คำค้นหาล่าสุด", "recent-views": "การเข้าชมล่าสุด", "recently-created": "สร้างเมื่อเร็วๆ นี้", @@ -1931,6 +1965,8 @@ "recently-updated": "อัปเดตเมื่อเร็วๆ นี้", "recently-viewed": "ดูล่าสุด", "record-plural": "บันทึก", + "records": "เรกคอร์ด", + "records-processed": "เรกคอร์ดที่ประมวลผลแล้ว", "recreate-index-plural": "สร้างดัชนีใหม่", "reference-plural": "การอ้างอิงหลายรายการ", "refocused-to-home": "โฟกัสกลับไปที่หน้าแรก", @@ -2071,6 +2107,7 @@ "run": "รัน", "run-agent-plural": "รันเอเจนต์", "run-at": "รันที่", + "run-history-and-details": "ประวัติการรันและรายละเอียด", "run-in-background": "Run in background", "run-now": "รันตอนนี้", "run-type": "ประเภทการรัน", @@ -2138,6 +2175,7 @@ "search-index-plural": "ดัชนีการค้นหาหลายรายการ", "search-index-setting-plural": "การตั้งค่าดัชนีการค้นหา", "search-insights": "ข้อมูลเชิงลึกการค้นหา", + "search-logs": "ค้นหาล็อก", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "ค้นหาความทรงจำตามเนื้อหา...", @@ -2248,6 +2286,7 @@ "show-nested": "แสดงแบบซ้อน", "show-or-hide-advanced-config": "{{showAdv}} การกำหนดค่าขั้นสูง", "show-or-hide-column-plural": "แสดง / ซ่อนคอลัมน์", + "show-raw-logs": "แสดงล็อกดิบ", "showing-count-of-total-assets": "แสดง {{count}} จาก {{total}} สินทรัพย์", "showing-total-failure-plural": "ความล้มเหลวทั้งหมด {{total}} รายการ", "sign-in": "เข้าสู่ระบบ", @@ -2313,6 +2352,7 @@ "started": "เริ่มต้นแล้ว", "started-following": "เริ่มติดตาม", "starting-offset": "ออฟเซ็ตเริ่มต้น", + "starts-after": "เริ่มหลังจาก", "starts-with": "ขึ้นต้นด้วย", "state": "สถานะ", "static": "สถิต", @@ -2322,10 +2362,13 @@ "status-success": "สำเร็จ", "stay-up-to-date": "อัปเดตอยู่เสมอ", "step": "ขั้นตอน", + "steps": "ขั้นตอน", + "steps-lowercase": "ขั้นตอน", "steward": "Steward", "stop": "หยุด", "stop-re-index-all": "หยุดการสร้างดัชนีใหม่ทั้งหมด", "stopped": "หยุดแล้ว", + "stopped-lowercase": "หยุดแล้ว", "storage": "ที่จัดเก็บ", "storage-plural": "ที่จัดเก็บหลายรายการ", "storage-service": "บริการเก็บข้อมูล", @@ -2500,6 +2543,7 @@ "to-perform": "ทำ", "to-service-name": "ชื่อบริการ", "to-service-type": "ประเภทบริการ", + "toggle-wrap": "สลับการตัดบรรทัด", "token": "Token", "token-end-point": "Token Endpoint", "token-expiration": "การหมดอายุของโทเค็น", @@ -2673,6 +2717,7 @@ "view-plural": "การเข้าชม", "view-property-plural": "ดูคุณลักษณะ", "view-reindex-failure-plural": "ดูการสร้างดัชนีใหม่ที่ล้มเหลว", + "view-run-history": "ดูประวัติการรัน", "view-selected": "ดูที่เลือก", "visibility": "การมองเห็น", "visibility-dataspace": "พื้นที่ข้อมูล", @@ -2685,8 +2730,10 @@ "volume-change": "การเปลี่ยนแปลงปริมาณ", "wall-clock": "เวลาจริง", "wants-to-access-your-account": "ต้องการเข้าถึงบัญชี {{username}} ของคุณ", + "warn": "เตือน", "warning": "คำเตือน", "warning-plural": "คำเตือนหลายรายการ", + "warning-plural-lowercase": "คำเตือน", "web-analytic-entity-view-report-data": "ข้อมูลรายงานการดูเอนทิตี้วิเคราะห์เว็บ", "web-analytic-user-activity-report-data": "ข้อมูลรายงานกิจกรรมผู้ใช้วิเคราะห์เว็บ", "web-analytics-report": "รายงานการวิเคราะห์เว็บ", @@ -2722,6 +2769,8 @@ "workflow-plural": "กระบวนการทำงาน", "worksheet": "เวิร์กชีต", "worksheet-plural": "เวิร์กชีต", + "wrap": "ตัดบรรทัด", + "wrapping-up": "กำลังสรุป", "year": "ปี", "yes": "ใช่", "yes-comma-confirm": "ใช่, ยืนยัน", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "ค้นหาสินทรัพย์ข้อมูลที่เหมาะสมด้วยการใช้เอดิเตอร์ไวยากรณ์และเงื่อนไขและ/หรือ", "agent-setup-description": "กำหนดค่าพารามิเตอร์หลักสำหรับตัวแทนนี้", + "agents-deploy-progress": "{{done}} เสร็จแล้ว · {{running}} กำลังรัน · {{queued}} อยู่ในคิว{{failedSuffix}} — เอเจนต์จะรันตามกำหนดการหลังจากรอบแรกนี้", + "agents-deploying-ingesting": "เอเจนต์กำลังปรับใช้และนำเข้าเมทาดาทา", + "agents-finished-summary": "เอเจนต์เสร็จสิ้น {{done}} จาก {{total}}{{attentionSuffix}}", "aggregate-domain-type-description": "โดเมนที่รวบรวมและปรับแต่งข้อมูลจากหลายแหล่งที่มาที่ถูกจัดเรียงเพื่อให้ข้อมูลรวมและผลิตภัณฑ์ข้อมูล เช่น Customer 360, การเซสชันของลูกค้า ฯลฯ สำหรับโดเมนอื่น ๆ ที่จะใช้", "airflow-guide-message": "{{brandName}} ใช้ Airflow ในการเรียกใช้งาน Ingestion Connectors เราได้พัฒนา Managed APIs เพื่อเรียกใช้ Ingestion connectors โปรดใช้ {{brandName}} Airflow instance หรือดูที่คู่มือล่างเพื่อติดตั้ง Managed APIs ในการติดตั้ง Airflow ของคุณ", "airflow-host-ip-address": "{{brandName}} จะเชื่อมต่อกับทรัพย์สินของคุณจาก IP <0>{{hostIp}}. ตรวจสอบให้แน่ใจว่าอนุญาตการเข้าชมจากภายนอกในการตั้งค่าความปลอดภัยของเครือข่ายของคุณ", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "คลิก <0>{{text}} เพื่อดูรายละเอียด", "closed-this-task": "ปิดงานนี้แล้ว", "collaborate-with-other-user": "เพื่อร่วมมือกับผู้ใช้คนอื่น", + "collate-ai-agents-description": "จัดระดับ จัดทำเอกสาร และตรวจสอบคุณภาพแอสเซทของคุณโดยอัตโนมัติด้วย AI", "collate-ai-widget-description": "ภาพรวมของข้อมูลที่สร้างโดย Collate AI สำหรับบริการ <0>เรียนรู้เพิ่มเติม", "column-bulk-operations-description": "จัดการและแก้ไขข้อมูลเมตาสำหรับหลายคอลัมน์พร้อมกัน ค้นหา ตัวกรอง และอัปเดตชื่อแสดง คำอธิบาย แท็ก และคำในสารานุกรมในทรัพย์สินข้อมูลของคุณ", "column-filter-help-text": "กรองสายโยงตามแท็กคอลัมน์หรือชื่อ ใช้ 'tag:ชื่อแท็ก' สำหรับการกรองแท็ก หรือเพียงแค่ป้อนชื่อคอลัมน์", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "เกิดข้อผิดพลาดขณะดึงโทเค็นการเข้าถึง", "establishing-connection-ellipsis": "กำลังสร้างการเชื่อมต่อ…", "events-matching-search-query": "เหตุการณ์ที่ตรงกับคำค้นหา", + "everything-healthy": "ทุกอย่างปกติดี", "example-value": "เช่น {{value}}", "exclude-system-entity-description": "เมื่อปิดใช้งาน รูปแบบเริ่มต้นที่กำหนดไว้ในสคีมาสำหรับ {{entity}} จะถูกนำไปใช้โดยอัตโนมัติ", "excludes-regex-line": "ไม่รวม += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "หมายเหตุ: เป้าหมาย KPI คำอธิบายยังไม่ได้รับการบรรลุ แต่ยังมีเวลา – องค์กรของคุณมีเวลาที่เหลือ {{count}} วัน เพื่อให้มีเวลาติดตาม กรุณาเปิดใช้รายงานข้อมูลเชิงลึก ซึ่งจะทำให้เราสามารถส่งอัปเดตประจำสัปดาห์ไปยังทีมทั้งหมด เพื่อส่งเสริมการร่วมมือและมุ่งเน้นไปที่การบรรลุ KPIs ขององค์กรของเรา", "latency-sla-description": "<0>{{label}}: เวลาตอบสนองของคำค้นต้องต่ำกว่า <0>{{data}}", "latest-offset-description": "ออฟเซ็ตล่าสุดของเหตุการณ์ในระบบ", + "latest-run-lines": "การรันล่าสุด · {{count}} บรรทัด", "ldap-group-dn-placeholder": "เช่น cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "LDAP group DN นี้ได้ถูกแมปแล้ว แต่ละกลุ่ม LDAP สามารถแมปได้เพียงครั้งเดียวเท่านั้น", "learning-resources-management-description": "สำรวจคุณสมบัติของผลิตภัณฑ์และเรียนรู้วิธีการทำงานผ่านทรัพยากรของเรา", + "leave-page-ingestion-continues": "คุณสามารถออกจากหน้านี้ได้ — การนำเข้าจะดำเนินต่อในเบื้องหลัง", "leave-the-team-team-name": "ออกจากทีม {{teamName}}", "length-validator-error": "จำเป็นต้องมีอย่างน้อย {{length}} {{field}}", "lineage-ingestion-description": "การนำเข้าลำดับชั้นสามารถตั้งค่าและเรียกใช้งานได้หลังจากการนำเข้าข้อมูลเมตาถูกตั้งค่าแล้ว กระบวนการนำเข้าลำดับชั้นจะได้รับประวัติการค้นหา, วิเคราะห์คำสั่ง CREATE, INSERT, MERGE... และเตรียมลำดับชั้นระหว่างเอนทิตีที่เกี่ยวข้อง การนำเข้าลำดับชั้นสามารถมีเพียงหนึ่งท่อสำหรับบริการฐานข้อมูล กำหนดระยะเวลาในบันทึกการค้นหา (เป็นวัน) และขีดจำกัดผลลัพธ์เพื่อเริ่มต้น", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "คุณต้องการวิเคราะห์อะไรวันนี้?", "mcp-chat-placeholder": "ถามอะไรก็ได้...", "mentioned-you-on-the-lowercase": "กล่าวถึงคุณบน", + "metadata-agents-description": "แยกเมทาดาทา การใช้งาน สายข้อมูล และการทำโปรไฟล์จากแหล่งที่มา", "metadata-agents-table-description": "Metadata Agents ใช้สำหรับดึงข้อมูลจากบริการต้นทาง", "metadata-ingestion-description": "ตามประเภทบริการที่เลือก ให้ใส่รายละเอียดรูปแบบตัวกรองสำหรับสคีมาหรือตาราง (ฐานข้อมูล) หรือหัวข้อ (การส่งข้อความ) หรือแดชบอร์ด คุณสามารถรวมหรือยกเว้นรูปแบบตัวกรองได้ เลือกที่จะรวมมุมมอง เปิดหรือปิดตัวสร้างโปรไฟล์ข้อมูล และนำเข้าข้อมูลตัวอย่างตามต้องการ", "metadata-status-complete-description": "เมตาดาต้าถูกกรอกครบถ้วนและสอดคล้องกันในทุกคอลัมน์", @@ -3392,6 +3449,8 @@ "minimum-count-error": "ต้องเลือกอย่างน้อย {{count}} {{field}}", "minimum-value-error": "ค่าต่ำสุดควรน้อยกว่าค่าสูงสุด", "minute": "นาที", + "minutes-left": "เหลือประมาณ {{count}} นาที", + "minutes-short": "{{count}} นาที", "missing-config-value": "ค่าการกำหนดค่าที่หายไป: {{field}}", "missing-description": "ไม่มีคำอธิบาย", "modified-time-ago-by": "แก้ไข {{time}} ก่อนหน้า {{by}}", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "ไม่มีการกำหนดค่าการแมปบทบาท LDAP", "no-learning-resources-available": "ไม่มีทรัพยากรการเรียนรู้สำหรับบริบทนี้", "no-lineage-available": "ไม่พบการเชื่อมโยง lineage", + "no-lines-match": "ไม่มีบรรทัดที่ตรงกัน", "no-match-found": "ไม่พบการจับคู่", "no-mentions": "ดูเหมือนว่าคุณและทีมของคุณไม่มีการกล่าวถึงในกิจกรรมใด ๆ ตอนนี้ รับมือกับงานของคุณอย่างยอดเยี่ยม!", "no-native-fields": "ไม่มีฟิลด์เนทีฟที่กำหนดค่าได้สำหรับประเภทเอนทิตีนี้", @@ -3513,6 +3573,7 @@ "no-profiler-message": "สำรวจเมตริกของตารางของคุณโดยเรียกใช้งานเวิร์กโฟลว์โปรไฟล์เลอร์ คุณจะได้เห็นจำนวนแถว การอัพเดตตาราง การเปลี่ยนแปลงปริมาณ และอื่น ๆ เยี่ยมชมเอกสารของเราเพื่อดูขั้นตอนการตั้งค่า", "no-profiler-title": "เรียกใช้ Profiler เพื่อปลดล็อกข้อมูลเชิงลึกของตาราง", "no-properties-added": "No properties added.", + "no-recent-runs": "ไม่พบการรันล่าสุด", "no-recently-viewed-data": "คุณยังไม่ได้ดูสินทรัพย์ข้อมูลใด ๆ เมื่อเร็ว ๆ นี้ สำรวจเพื่อค้นหาสิ่งที่น่าสนใจ!", "no-reference-available": "ไม่มีการอ้างอิงที่ใช้งานได้", "no-related-terms-available": "ไม่มีคำที่เกี่ยวข้องที่สามารถใช้งานได้", @@ -3638,6 +3699,7 @@ "password-error-message": "รหัสผ่านต้องมีความยาวขั้นต่ำ 8 ตัวและสูงสุด 56 ตัว และต้องมีอย่างน้อยหนึ่งตัวอักษรพิมพ์ใหญ่ (A-Z), หนึ่งตัวอักษรพิมพ์เล็ก (a-z), หนึ่งตัวเลข, และหนึ่งอักขระพิเศษ (เช่น !, %, @, หรือ #)", "password-pattern-error": "รหัสผ่านต้องมีความยาวขั้นต่ำ 8 ตัวและสูงสุด 56 ตัว มีอักขระพิเศษหนึ่งตัว, ตัวอักษรพิมพ์ใหญ่หนึ่งตัว, ตัวอักษรพิมพ์เล็กหนึ่งตัว", "path-of-the-dbt-files-stored": "เส้นทางของโฟลเดอร์ที่จัดเก็บไฟล์ dbt", + "percent-complete-all-agents": "เสร็จ {{percent}}% จากทุกเอเจนต์", "permanently-delete-common-message": "ลบ {{entity}} นี้และข้อมูลเมตาทั้งหมดอย่างถาวร การดำเนินการนี้ไม่สามารถยกเลิกได้", "permanently-delete-ingestion-pipeline": "การลบ <0>{{entityName}} นี้อย่างถาวรจะทำให้การตั้งค่าท่อสูญหายและไม่สามารถกู้คืนได้", "permanently-delete-metadata": "การลบ <0>{{entityName}} นี้อย่างถาวรจะทำให้ข้อมูลเมตาของมันถูกลบออกจาก {{brandName}} และไม่สามารถกู้คืนได้", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "การตั้งค่าเพื่อปรับแต่งระยะเวลาที่เราต้องการดูย้อนหลังในบันทึกคำสั่งเพื่อประมวลผลข้อมูลการใช้งาน", "query-used-by-other-tables": "คำถามที่ใช้โดยตารางอื่น", "quick-add-tip": "ใช้ \"เพิ่มด่วน\" เพื่อสร้างความสัมพันธ์ของคำศัพท์โดยไม่ต้องออกจากกราฟ", + "ran-for-duration": "รันไป {{duration}} นาที", "rdf-not-enabled-for-export": "ต้องเปิดใช้งาน RDF เพื่อส่งออกออนโทโลยี กรุณาเปิดใช้งาน RDF ในการตั้งค่าเซิร์ฟเวอร์ของคุณ", "rdf-predicate-tooltip": "URI ของ RDF predicate สำหรับประเภทความสัมพันธ์นี้ (เช่น skos:broader, skos:exactMatch)", "reacted-with-emoji": "แสดงความคิดเห็นด้วยอิโมจิ {{type}}", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: ข้อมูลควรถูกเก็บไว้เป็นเวลา <0>{{data}}", "run-sample-data-to-ingest-sample-data": "'รันข้อมูลตัวอย่างเพื่อนำเข้าทรัพย์สินข้อมูลตัวอย่างเข้าสู่ {{brandName}} ของคุณ.'", "run-status-at-timestamp": "สถานะการรัน: {{status}} ที่ {{timestamp}}", + "run-status-click-details": "การรัน {{status}} · คลิกเพื่อดูรายละเอียด", "run-successful-test-to-continue": "เรียกใช้การทดสอบที่สำเร็จเพื่อดำเนินการต่อ", "sample-data-ingestion-config-description": "สคีมานี้กำหนดพารามิเตอร์ที่สามารถส่งผ่านสำหรับการเก็บรวบรวมข้อมูลตัวอย่าง", "schedule-description": "กำหนดเวลาการนำเข้าให้ดำเนินการในเวลาที่เฉพาะและความถี่ที่กำหนด", @@ -3740,6 +3804,8 @@ "search-insights-description": "ดูสถิติคลัสเตอร์การค้นหา รายละเอียดดัชนี และจัดการดัชนีกำพร้า", "search-settings-description": "การตั้งค่าการค้นหาสำหรับแต่ละเอนทิตีตามการจัดอันดับ", "search-settings-for-entity": "การตั้งค่าการค้นหาตามการจัดอันดับสำหรับ {{entity}}", + "seconds-left": "เหลือประมาณ {{count}} วินาที", + "seconds-short": "{{count}} วินาที", "see-also": "ดูเพิ่มเติม", "see-how-to-get-started": "ดูวิธีการเริ่มต้น", "select-alert-type": "โปรดเลือกประเภทการแจ้งเตือน", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json index 9c954006063d..78cdabf22fbd 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json @@ -97,6 +97,7 @@ "advanced-configuration": "Gelişmiş Yapılandırma", "advanced-entity": "Gelişmiş {{entity}}", "advanced-search": "Gelişmiş Arama", + "agent": "Aracı", "agent-activity": "Aracı Etkinliği", "agent-plural": "Agent'lar", "agent-setup": "Ajan kurulumu", @@ -189,6 +190,8 @@ "asset-plural": "Varlıklar", "asset-plural-lowercase": "varlıklar", "asset-type": "Varlık Türü", + "assets-ingested": "alınan varlıklar", + "assets-profiled": "profillenen varlıklar", "assigned": "Atanmış", "assigned-entity": "Atanmış {{entity}}", "assigned-to-me": "Bana Atananlar", @@ -248,6 +251,7 @@ "basic-configuration": "Temel Yapılandırma", "batch-size": "Toplu İş Boyutu", "bearer-hmac-signature": "Bearer (HMAC İmzası)", + "before-error": "hatadan önce", "before-number-of-day-plural": "{{numberOfDays}} gün önce", "belongs-to": "Şuna ait", "belongs-to-database": "Veritabanına ait", @@ -369,6 +373,7 @@ "collapse": "Daralt", "collapse-all": "Tümünü Daralt", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Collate AI Aracıları", "collection": "Koleksiyon", "collection-plural": "Koleksiyonlar", "color": "Renk", @@ -492,7 +497,7 @@ "cost-analysis": "Maliyet Analizi", "count": "Sayı", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} çalışıyor", "cover-image": "Kapak", "covered": "Kapsanan", "create": "Oluştur", @@ -664,12 +669,14 @@ "dbt-source": "dbt Kaynağı", "dbt-source-project": "dbt Kaynak Projesi", "deactivated": "Devre Dışı Bırakıldı", + "debug": "Hata Ayıklama", "december": "Aralık", "decision": "Karar", "default": "Varsayılan", "default-persona": "Varsayılan Persona", "default-role": "Varsayılan Rol", "delete": "Sil", + "delete-agent": "Aracıyı sil", "delete-all-nodes": "Tüm Düğümleri Sil", "delete-boost": "Desteği Sil", "delete-data-asset-rule": "Veri Varlığı Kuralını Sil", @@ -697,6 +704,7 @@ "deployed": "Dağıtıldı", "deployed-lowercase": "dağıtıldı", "deploying-lowercase": "dağıtılıyor", + "deployment-complete": "Dağıtım tamamlandı", "deprecate": "Deprecate", "depth": "Derinlik", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "Detaylar", "details": "Ayrıntılar", "developed-by-developer": "{{developer}} tarafından geliştirildi", + "diagnose": "Tanılama", "diagnostic-info": "Tanı Bilgisi", "did-not-run": "Çalıştırılmadı", "dimension": "Boyut", @@ -784,6 +793,7 @@ "drive-plural": "Sürücüler", "duplicate": "Kopya", "duration": "Süre", + "duration-in-minute": "{{duration}} dk", "dynamic": "Dinamik", "dynamic-assertion": "Dinamik Beyan", "edge": "Kenar", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "Düzenle ve Öneriyi Kabul Et", "edit-an-announcement": "Bir Duyuruyu Düzenle", "edit-chart-name": "Grafiği Düzenle: \"{{name}}\"", + "edit-configuration": "Yapılandırmayı düzenle", "edit-connection": "Bağlantıyı düzenle", "edit-data-asset-rule": "Veri Varlığı Kuralını Düzenle", "edit-description-for": "{{entityName}} için Açıklamayı Düzenle", @@ -909,7 +920,9 @@ "equivalence": "Denklik", "error": "Hata", "error-plural": "Hatalar", + "error-plural-lowercase": "hatalar", "esc": "Esc", + "est-remaining": "tah. kalan", "establish-connection": "Establish Connection", "evaluate": "Değerlendir", "evaluate-permission": "İzni Değerlendir", @@ -972,8 +985,10 @@ "factor": "Faktör", "fail-on-conflict": "Çakışmada Başarısız Ol", "failed": "Başarısız", + "failed-at": "Şurada başarısız oldu", "failed-entity": "Başarısız {{entity}}", "failed-event-plural": "Başarısız Olaylar", + "failed-lowercase": "başarısız", "failed-rows": "Başarısız Satırlar", "failed-slash-aborted-reason": "Başarısızlık/iptal nedeni", "failed-to-upload-file": "Dosya yüklenemedi", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "Filtre kalıpları", "filter-plural": "Filtreler", "filtered": "Filtrelenmiş", + "filtered-lowercase": "filtrelendi", "filtering-condition": "Filtreleme Koşulu", "filters-configuration": "Filtre Yapılandırması", + "finished": "Tamamlandı", + "finished-lowercase": "tamamlandı", "first": "İlk", "first-lowercase": "ilk", "first-name": "Ad", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "Kimlik taklidi ayarlarını gizle ({{count}})", "hide-meta-details": "Meta Detaylarını Gizle", "hide-property-plural": "Özellikleri Gizle", + "hide-raw-logs": "Ham günlükleri gizle", "hierarchical": "Hiyerarşik", "hierarchy": "Hiyerarşi", "hierarchy-depth": "Hiyerarşi Derinliği", @@ -1170,6 +1189,7 @@ "homepage": "Ana Sayfa", "hour": "Saat", "hourly": "Saatlik", + "how-to-fix": "Nasıl düzeltilir", "http-config-source": "HTTP Yapılandırma Kaynağı", "http-method": "HTTP Metodu", "hybrid-search-weight-plural": "Hibrit Arama Ağırlıkları", @@ -1226,6 +1246,7 @@ "index-name": "Dizin Adı", "index-states": "Dizin istatistikleri", "indirect": "Dolaylı", + "info": "Bilgi", "ingest-sample-data": "Örnek Veri Al", "ingestion": "Alım", "ingestion-lowercase": "alım", @@ -1297,6 +1318,7 @@ "keyword": "Anahtar kelime", "keyword-lowercase-plural": "anahtar kelimeler", "kill": "Durdur", + "kill-run": "Çalıştırmayı durdur", "knowledge": "Bilgi", "knowledge-article-plural": "Bilgi Makaleleri", "knowledge-center": "Bilgi Merkezi", @@ -1508,7 +1530,9 @@ "model": "Model", "model-name": "Model Adı", "model-plural": "Modeller", + "model-plural-lowercase": "modeller", "model-store": "Model Mağazası", + "models-parsed": "ayrıştırılan modeller", "modified-time": "Değiştirme Zamanı", "modifier": "Değiştirici", "monday": "Pazartesi", @@ -1517,6 +1541,7 @@ "monthly": "Aylık", "more": "Daha Fazla", "more-action": "Daha Fazla İşlem", + "more-action-plural": "Diğer Eylemler", "more-actions": "Daha fazla işlem", "more-help": "Daha Fazla Yardım", "more-lowercase": "daha fazla", @@ -1554,6 +1579,7 @@ "native-field-plural": "Yerel alanlar", "navigation": "Navigasyon", "navigation-menu-plural": "Navigasyon Menüleri", + "need-attention": "dikkat gerektiriyor", "need-help": "Yardıma İhtiyacınız Var Mı?", "needs-attention": "Dikkat Gerektiriyor", "needs-review": "İnceleme gerekiyor", @@ -1605,6 +1631,7 @@ "no-records": "Kayıt yok", "no-result-found": "Sonuç bulunamadı.", "no-reviewer": "İnceleyici yok", + "no-status": "Durum yok", "no-tags-added": "Etiket eklenmedi", "no-tasks-yet": "Henüz görev yok", "no-tests-run": "Çalıştırılan test yok", @@ -1741,6 +1768,7 @@ "part-of": "Parçası", "part-of-domain": "Alan adının parçası", "partial-coverage": "Kısmi Kapsama", + "partial-success": "Kısmi Başarı", "partition-lowercase-plural": "bölümler", "partition-plural": "Bölümler", "partitioned": "Bölümlenmiş", @@ -1885,12 +1913,15 @@ "public-team": "Herkese Açık Takım", "published": "Yayınlandı", "quality": "Kalite", + "queries-processed": "işlenen sorgular", + "queries-scanned": "taranan sorgular", "query": "Sorgu", "query-log-duration": "Sorgu Günlüğü Süresi", "query-lowercase": "sorgu", "query-lowercase-plural": "sorgular", "query-parameter-plural": "Sorgu Parametreleri", "query-plural": "Sorgular", + "query-plural-lowercase": "sorgular", "query-used-in": "Sorgunun Kullanıldığı Yer", "queued": "Sırada", "quick-add": "Hızlı Ekle", @@ -1902,11 +1933,13 @@ "range": "Aralık", "range-condition": "Aralık Koşulu", "raw-connection-log": "Raw Connection Log", + "raw-logs": "Ham günlükler", "rdf-predicate": "RDF Yüklemi", "rdf-store": "RDF Deposu", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "Yeniden Ata", "re-deploy": "Yeniden Dağıt", + "re-deploy-sentence": "Yeniden dağıt", "re-enter-new-password": "Yeni Şifreyi Tekrar Girin", "re-index-all": "Tümünü Yeniden İndeksle", "re-index-elasticsearch": "Elasticsearch'ü Yeniden İndeksle", @@ -1924,6 +1957,7 @@ "recent-chat": "Son", "recent-event-plural": "Son Olaylar", "recent-run-plural": "Son Çalışmalar", + "recent-runs-sentence": "Son çalıştırmalar", "recent-search-term-plural": "Son Arama Terimleri", "recent-views": "Son Görüntülemeler", "recently-created": "Yeni oluşturuldu", @@ -1931,6 +1965,8 @@ "recently-updated": "Yeni güncellendi", "recently-viewed": "Son Görüntülenenler", "record-plural": "Kayıtlar", + "records": "kayıtlar", + "records-processed": "işlenen kayıtlar", "recreate-index-plural": "Dizinleri Yeniden Oluştur", "reference-plural": "Referanslar", "refocused-to-home": "Ana sayfaya yeniden odaklandı", @@ -2071,6 +2107,7 @@ "run": "Çalıştır", "run-agent-plural": "Agent'ları Çalıştır", "run-at": "Şu zamanda çalıştır", + "run-history-and-details": "Çalıştırma geçmişi ve ayrıntılar", "run-in-background": "Run in background", "run-now": "Şimdi çalıştır", "run-type": "Çalıştırma Türü", @@ -2138,6 +2175,7 @@ "search-index-plural": "Arama Dizinleri", "search-index-setting-plural": "Arama Dizini Ayarları", "search-insights": "Arama İçgörüleri", + "search-logs": "Günlüklerde ara", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "Anıları içeriğe göre ara...", @@ -2248,6 +2286,7 @@ "show-nested": "Yuvalanmışları Göster", "show-or-hide-advanced-config": "{{showAdv}} Gelişmiş Yapılandırma", "show-or-hide-column-plural": "Sütunları göster/gizle", + "show-raw-logs": "Ham günlükleri göster", "showing-count-of-total-assets": "{{total}} varlıktan {{count}} tanesi gösteriliyor", "showing-total-failure-plural": "Toplam {{total}} hata", "sign-in": "Giriş Yap", @@ -2313,6 +2352,7 @@ "started": "Başlatıldı", "started-following": "Takip etmeye başladı", "starting-offset": "Başlangıç Ofseti", + "starts-after": "Şundan sonra başlar", "starts-with": "ile başlar", "state": "Durum", "static": "Statik", @@ -2322,10 +2362,13 @@ "status-success": "Başarılı", "stay-up-to-date": "Güncel Kalın", "step": "Adım", + "steps": "Adımlar", + "steps-lowercase": "adımlar", "steward": "Steward", "stop": "Durdur", "stop-re-index-all": "Yeniden İndekslemeyi Durdur", "stopped": "Durduruldu", + "stopped-lowercase": "durduruldu", "storage": "Depolama", "storage-plural": "Depolamalar", "storage-service": "Depolama Servisi", @@ -2500,6 +2543,7 @@ "to-perform": "yapmak", "to-service-name": "Hizmet Adı", "to-service-type": "Hizmet Türü", + "toggle-wrap": "Kaydırmayı Aç/Kapat", "token": "Token", "token-end-point": "AnahtarBitişNoktası", "token-expiration": "Anahtar Geçerlilik Süresi", @@ -2673,6 +2717,7 @@ "view-plural": "Görünümler", "view-property-plural": "Özellikleri Görüntüle", "view-reindex-failure-plural": "Yeniden Dizinleme Hatalarını Görüntüle", + "view-run-history": "Çalıştırma geçmişini görüntüle", "view-selected": "Seçileni Görüntüle", "visibility": "Görünürlük", "visibility-dataspace": "Veri alanı", @@ -2685,8 +2730,10 @@ "volume-change": "Hacim Değişikliği", "wall-clock": "Gerçek Zaman", "wants-to-access-your-account": "{{username}} hesabınıza erişmek istiyor", + "warn": "Uyarı", "warning": "Uyarı", "warning-plural": "Uyarılar", + "warning-plural-lowercase": "uyarılar", "web-analytic-entity-view-report-data": "Web Analitik Varlık Görüntüleme Rapor Verileri", "web-analytic-user-activity-report-data": "Web Analitik Kullanıcı Aktivite Rapor Verileri", "web-analytics-report": "Web Analitik Raporu", @@ -2722,6 +2769,8 @@ "workflow-plural": "İş Akışları", "worksheet": "Çalışma sayfası", "worksheet-plural": "Çalışma sayfaları", + "wrap": "Kaydır", + "wrapping-up": "tamamlanıyor", "year": "Yıl", "yes": "Evet", "yes-comma-confirm": "Evet, onayla", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "Ve/veya koşullarıyla sözdizimi düzenleyiciyi kullanarak doğru veri varlıklarını keşfedin.", "agent-setup-description": "Bu ajan için temel parametreleri yapılandırın.", + "agents-deploy-progress": "{{done}} tamamlandı · {{running}} çalışıyor · {{queued}} sırada{{failedSuffix}} — aracılar bu ilk geçişten sonra kendi zamanlamalarına göre çalışır", + "agents-deploying-ingesting": "Aracılar dağıtılıyor ve meta veriler alınıyor", + "agents-finished-summary": "{{total}} aracıdan {{done}} tanesi tamamlandı{{attentionSuffix}}", "aggregate-domain-type-description": "Diğer alanların tüketmesi için Müşteri 360, Müşteri oturumları vb. gibi toplu veriler ve veri ürünleri sağlamak üzere birden çok kaynaktan veri toplayan ve düzenleyen alan adları.", "airflow-guide-message": "{{brandName}}, Alım Bağlayıcılarını çalıştırmak için Airflow kullanır. Alım bağlayıcılarını dağıtmak için Yönetilen API'ler geliştirdik. Lütfen {{brandName}} Airflow örneğini kullanın veya yönetilen API'leri Airflow kurulumunuza yüklemek için aşağıdaki kılavuza bakın.", "airflow-host-ip-address": "{{brandName}}, kaynağınıza <0>{{hostIp}} IP adresinden bağlanacaktır. Ağ güvenlik ayarlarınızda gelen trafiğe izin verdiğinizden emin olun.", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "Detayları görüntülemek için <0>{{text}} tıklayın.", "closed-this-task": "bu görevi kapattı", "collaborate-with-other-user": "diğer kullanıcılarla işbirliği yapmak için.", + "collate-ai-agents-description": "Varlıklarınızı yapay zeka ile otomatik olarak katmanlandırın, belgeleyin ve kalite denetiminden geçirin.", "collate-ai-widget-description": "Collate AI tarafından servis için oluşturulan verilere genel bakış. <0>daha fazla bilgi edinin.", "column-bulk-operations-description": "Birden fazla sütun için meta verileri aynı anda yönetin ve düzenleyin. Veri varlıklarınızdaki görünen adları, açıklamaları, etiketleri ve sözlük terimlerini arayın, filtreleyin ve güncelleyin.", "column-filter-help-text": "Sütun etiketlerine veya adlarına göre soyağacı filtreleyin. Etiket filtrelemesi için 'tag:EtiketAdı' kullanın veya sadece sütun adını girin.", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "Erişim anahtarı alınırken hata oluştu.", "establishing-connection-ellipsis": "Bağlantı kuruluyor…", "events-matching-search-query": "Arama sorgusuyla eşleşen olaylar", + "everything-healthy": "her şey sağlıklı", "example-value": "örn. {{value}}", "exclude-system-entity-description": "Devre dışı bırakıldığında, şemada tanımlanan {{entity}} için varsayılan desenler otomatik olarak uygulanır.", "excludes-regex-line": "hariç tutar += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "Uyarı: Açıklama KPI hedefi henüz karşılanmadı, ancak hala zaman var – kuruluşunuzun {{count}} günü kaldı. Takipte kalmak için lütfen Veri Analizleri Raporunu etkinleştirin. Bu, tüm ekiplere haftalık güncellemeler göndermemizi sağlayacak, böylece kuruluşumuzun KPI'larına ulaşma yönünde işbirliğini ve odaklanmayı teşvik edecektir.", "latency-sla-description": "<0>{{label}}: Sorgu yanıtı <0>{{data}}'den az olmalıdır.", "latest-offset-description": "Sistemdeki olayın en son ofseti.", + "latest-run-lines": "Son çalıştırma · {{count}} satır", "ldap-group-dn-placeholder": "örn. cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "Bu LDAP grup DN'i zaten eşlenmiştir. Her LDAP grubu sadece bir kez eşlenebilir.", "learning-resources-management-description": "Ürün özelliklerini keşfedin ve kaynaklarımız aracılığıyla nasıl çalıştıklarını öğrenin", + "leave-page-ingestion-continues": "Bu sayfadan ayrılabilirsiniz — veri alımı arka planda devam eder", "leave-the-team-team-name": "{{teamName}} takımından ayrıl", "length-validator-error": "En az {{length}} {{field}} gerekli", "lineage-ingestion-description": "Veri soyu alımı, bir metadata alımı ayarlandıktan sonra yapılandırılabilir ve dağıtılabilir. Veri soyu alım iş akışı, sorgu geçmişini alır, CREATE, INSERT, MERGE... sorgularını ayrıştırır ve ilgili varlıklar arasındaki veri soyunu hazırlar. Veri soyu alımının bir veritabanı servisi için yalnızca bir iş akışı olabilir. Başlamak için Sorgu Günlüğü Süresini (gün olarak) ve Sonuç Sınırını tanımlayın.", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "Bugün ne analiz etmek istersiniz?", "mcp-chat-placeholder": "Her şeyi sorun...", "mentioned-you-on-the-lowercase": "sizi şurada bahsetti:", + "metadata-agents-description": "Kaynaktan meta veri, kullanım, veri kökeni ve profil çıkarın.", "metadata-agents-table-description": "Metadata Agent'ları, kaynak servislerden metadata çıkarmak için kullanılır.", "metadata-ingestion-description": "Seçilen servis türüne bağlı olarak, şema veya tablo (veritabanı), konu (mesajlaşma) veya kontrol paneli için filtre deseni ayrıntılarını girin. Filtre desenlerini dahil edebilir veya hariç tutabilirsiniz. Görünümleri dahil etmeyi, veri profilleyiciyi etkinleştirmeyi veya devre dışı bırakmayı ve gerektiğinde örnek veri almayı seçin.", "metadata-status-complete-description": "Meta veriler tüm sütunlarda tamamen doldurulmuş ve tutarlıdır", @@ -3392,6 +3449,8 @@ "minimum-count-error": "En az {{count}} {{field}} seçilmelidir.", "minimum-value-error": "Minimum değer maksimum değerden küçük olmalıdır.", "minute": "Dakika", + "minutes-left": "~{{count}} dk kaldı", + "minutes-short": "{{count}} dk", "missing-config-value": "Eksik yapılandırma değeri: {{field}}", "missing-description": "Açıklama eksik", "modified-time-ago-by": "{{time}} önce {{by}} tarafından değiştirildi", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "LDAP rol eşlemeleri yapılandırılmamış.", "no-learning-resources-available": "Bu bağlam için kullanılabilir öğrenme kaynağı yok.", "no-lineage-available": "Lineage bağlantıları bulunamadı", + "no-lines-match": "Eşleşen satır yok.", "no-match-found": "Eşleşme bulunamadı", "no-mentions": "Görünüşe göre siz ve ekibiniz tamamen temizsiniz – henüz herhangi bir aktivitede bahsetme yok. Harika çalışmaya devam edin!", "no-native-fields": "Bu varlık türü için yapılandırılabilir yerel alan yok.", @@ -3513,6 +3573,7 @@ "no-profiler-message": "Profilleyici iş akışını çalıştırarak tablonuzun metriklerini keşfedin. Satır Sayısı, Tablo Güncellemeleri, Hacim Değişiklikleri ve daha fazlasını göreceksiniz. Kurulum adımları için belgelerimizi ziyaret edin ", "no-profiler-title": "Tablo İçgörülerinin Kilidini Açmak İçin Profiler'ı Çalıştırın", "no-properties-added": "No properties added.", + "no-recent-runs": "Son çalıştırma bulunamadı.", "no-recently-viewed-data": "Son zamanlarda herhangi bir veri varlığı görüntülemediniz. İlginç bir şey bulmak için keşfedin!", "no-reference-available": "Kullanılabilir referans yok.", "no-related-terms-available": "Kullanılabilir ilgili terim yok.", @@ -3638,6 +3699,7 @@ "password-error-message": "Şifre en az 8 ve en fazla 56 karakter uzunluğunda olmalı ve en az bir büyük harf (A-Z), bir küçük harf (a-z), bir rakam ve bir özel karakter ( !, %, @ veya # gibi) içermelidir.", "password-pattern-error": "Şifre en az 8 ve en fazla 56 karakterden oluşmalı, bir özel karakter, bir büyük harf, bir küçük harf içermelidir", "path-of-the-dbt-files-stored": "dbt dosyalarının saklandığı klasörün yolu", + "percent-complete-all-agents": "tüm aracılarda %{{percent}} tamamlandı", "permanently-delete-common-message": "Bu {{entity}} ve tüm meta verilerini kalıcı olarak silin. Bu işlem geri alınamaz.", "permanently-delete-ingestion-pipeline": "Bu <0>{{entityName}} kalıcı olarak silinmesi, iş akışı yapılandırmasının kaybolmasına neden olacak ve kurtarılamayacaktır.", "permanently-delete-metadata": "Bu <0>{{entityName}} kalıcı olarak silinmesi, metadatasının {{brandName}}'dan kaldırılmasına neden olacak ve kurtarılamayacaktır.", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "Kullanım verilerini işlemek için sorgu günlüklerine ne kadar geriye bakmak istediğimizi ayarlamak için yapılandırma.", "query-used-by-other-tables": "Diğer tablolar tarafından kullanılan sorgu", "quick-add-tip": "Grafikten ayrılmadan sözlük terimi ilişkileri oluşturmak için Hızlı Ekle'yi kullanın.", + "ran-for-duration": "{{duration}} dk boyunca çalıştı", "rdf-not-enabled-for-export": "Ontoloji dışarı aktarımı için RDF etkinleştirilmelidir. Lütfen sunucu yapılandırmanızda RDF'yi etkinleştirin.", "rdf-predicate-tooltip": "Bu ilişki türü için RDF yüklem URI'si (örn. skos:broader, skos:exactMatch).", "reacted-with-emoji": "{{type}} emojisi ile tepki verdi", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}: Veriler <0>{{data}} süreyle saklanmalıdır.", "run-sample-data-to-ingest-sample-data": "'{{brandName}}'nıza örnek veri varlıkları almak için örnek verileri çalıştırın.'", "run-status-at-timestamp": "Çalışma durumu: {{status}} , zaman damgası: {{timestamp}}", + "run-status-click-details": "{{status}} çalıştırma · ayrıntılar için tıklayın", "run-successful-test-to-continue": "Devam etmek için başarılı bir test çalıştırın.", "sample-data-ingestion-config-description": "Bu şema, örnek veri toplama için iletilebilecek parametreleri tanımlar.", "schedule-description": "Alımı belirli bir zamanda ve sıklıkta çalışacak şekilde zamanlayın.", @@ -3740,6 +3804,8 @@ "search-insights-description": "Arama kümesi istatistiklerini, dizin ayrıntılarını görüntüleyin ve yetim dizinleri yönetin.", "search-settings-description": "Sıralamaya göre her varlık için arama ayarları.", "search-settings-for-entity": "{{entity}} için sıralamaya dayalı arama ayarları", + "seconds-left": "~{{count}}sn kaldı", + "seconds-short": "{{count}}sn", "see-also": "Ayrıca Bakınız", "see-how-to-get-started": "Nasıl başlanacağını görün", "select-alert-type": "Lütfen bir uyarı türü seçin", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json index 5cafafad7123..47c51dbe54f4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json @@ -97,6 +97,7 @@ "advanced-configuration": "高级配置", "advanced-entity": "高级{{entity}}", "advanced-search": "高级搜索", + "agent": "代理", "agent-activity": "代理活动", "agent-plural": "代理", "agent-setup": "代理设置", @@ -189,6 +190,8 @@ "asset-plural": "资产", "asset-plural-lowercase": "资产", "asset-type": "资产类型", + "assets-ingested": "已提取资产", + "assets-profiled": "已剖析资产", "assigned": "已分配", "assigned-entity": "已分配{{entity}}", "assigned-to-me": "分配给我的", @@ -248,6 +251,7 @@ "basic-configuration": "基本配置", "batch-size": "批大小", "bearer-hmac-signature": "Bearer(HMAC 签名)", + "before-error": "出错前", "before-number-of-day-plural": "{{numberOfDays}}天前", "belongs-to": "属于", "belongs-to-database": "属于数据库", @@ -369,6 +373,7 @@ "collapse": "折叠", "collapse-all": "全部折叠", "collate-ai": "整理 AI", + "collate-ai-agent-plural": "Collate AI 代理", "collection": "收藏", "collection-plural": "收藏", "color": "颜色", @@ -492,7 +497,7 @@ "cost-analysis": "成本分析", "count": "计数", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} 个运行中", "cover-image": "覆盖", "covered": "覆盖", "create": "新建", @@ -664,12 +669,14 @@ "dbt-source": "dbt 源", "dbt-source-project": "dbt 源项目", "deactivated": "已停用", + "debug": "调试", "december": "十二月", "decision": "决定", "default": "默认", "default-persona": "默认用户角色", "default-role": "默认角色", "delete": "删除", + "delete-agent": "删除代理", "delete-all-nodes": "删除所有节点", "delete-boost": "删除提升", "delete-data-asset-rule": "删除数据资产规则", @@ -697,6 +704,7 @@ "deployed": "已部署", "deployed-lowercase": "已部署", "deploying-lowercase": "部署", + "deployment-complete": "部署完成", "deprecate": "Deprecate", "depth": "深度", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "详情", "details": "细节", "developed-by-developer": "由 {{developer}} 开发", + "diagnose": "诊断", "diagnostic-info": "诊断信息", "did-not-run": "未运行", "dimension": "维度", @@ -784,6 +793,7 @@ "drive-plural": "驱动器", "duplicate": "复制", "duration": "持续时间", + "duration-in-minute": "{{duration}} 分钟", "dynamic": "动态", "dynamic-assertion": "动态断言", "edge": "连线", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "编辑并接受建议", "edit-an-announcement": "编辑公告", "edit-chart-name": "编辑图表:\"{{name}}\"", + "edit-configuration": "编辑配置", "edit-connection": "编辑连接", "edit-data-asset-rule": "编辑数据资产规则", "edit-description-for": "编辑{{entityName}}的描述", @@ -909,7 +920,9 @@ "equivalence": "等价", "error": "错误", "error-plural": "错误", + "error-plural-lowercase": "错误", "esc": "Esc", + "est-remaining": "预计剩余", "establish-connection": "建立连接", "evaluate": "评价", "evaluate-permission": "评估权限", @@ -972,8 +985,10 @@ "factor": "因子", "fail-on-conflict": "冲突时失败", "failed": "失败", + "failed-at": "失败于", "failed-entity": "失败 {{entity}}", "failed-event-plural": "失败事件", + "failed-lowercase": "失败", "failed-rows": "失败行", "failed-slash-aborted-reason": "失败/中止原因", "failed-to-upload-file": "上传文件失败", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "过滤模式", "filter-plural": "过滤", "filtered": "已过滤", + "filtered-lowercase": "已过滤", "filtering-condition": "过滤条件", "filters-configuration": "过滤器配置", + "finished": "已完成", + "finished-lowercase": "已完成", "first": "第一", "first-lowercase": "第一", "first-name": "名", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "隐藏模拟设置 ({{count}})", "hide-meta-details": "隐藏元数据详情", "hide-property-plural": "隐藏属性", + "hide-raw-logs": "隐藏原始日志", "hierarchical": "分层的", "hierarchy": "等级制度", "hierarchy-depth": "层次深度", @@ -1170,6 +1189,7 @@ "homepage": "主页", "hour": "小时", "hourly": "每小时", + "how-to-fix": "如何修复", "http-config-source": "HTTP 配置源", "http-method": "HTTP 方法", "hybrid-search-weight-plural": "混合搜索权重", @@ -1226,6 +1246,7 @@ "index-name": "指数名称", "index-states": "索引状态", "indirect": "间接", + "info": "信息", "ingest-sample-data": "提取样本数据", "ingestion": "提取", "ingestion-lowercase": "提取", @@ -1297,6 +1318,7 @@ "keyword": "关键词", "keyword-lowercase-plural": "关键词", "kill": "终止", + "kill-run": "终止运行", "knowledge": "知识", "knowledge-article-plural": "知识文章", "knowledge-center": "知识中心", @@ -1508,7 +1530,9 @@ "model": "模型", "model-name": "模型名称", "model-plural": "模型", + "model-plural-lowercase": "模型", "model-store": "模型 Store", + "models-parsed": "已解析模型", "modified-time": "修改时间", "modifier": "修饰符", "monday": "星期一", @@ -1517,6 +1541,7 @@ "monthly": "每月", "more": "更多", "more-action": "更多行动", + "more-action-plural": "更多操作", "more-actions": "更多操作", "more-help": "更多帮助", "more-lowercase": "更多", @@ -1554,6 +1579,7 @@ "native-field-plural": "原生字段", "navigation": "导航", "navigation-menu-plural": "导航菜单", + "need-attention": "需要关注", "need-help": "需要帮助", "needs-attention": "需要关注", "needs-review": "需要审核", @@ -1605,6 +1631,7 @@ "no-records": "没有记录", "no-result-found": "未找到结果", "no-reviewer": "无评审人", + "no-status": "无状态", "no-tags-added": "没有标签", "no-tasks-yet": "暂无任务", "no-tests-run": "未运行测试", @@ -1741,6 +1768,7 @@ "part-of": "属于", "part-of-domain": "属于域", "partial-coverage": "部分覆盖", + "partial-success": "部分成功", "partition-lowercase-plural": "分区", "partition-plural": "分区", "partitioned": "已分区", @@ -1885,12 +1913,15 @@ "public-team": "公开的团队", "published": "已发布", "quality": "质控", + "queries-processed": "已处理查询", + "queries-scanned": "已扫描查询", "query": "查询", "query-log-duration": "查询日志时长", "query-lowercase": "查询", "query-lowercase-plural": "查询", "query-parameter-plural": "查询参数", "query-plural": "查询", + "query-plural-lowercase": "查询", "query-used-in": "查询语句被使用在", "queued": "排队中", "quick-add": "快速添加", @@ -1902,11 +1933,13 @@ "range": "范围", "range-condition": "范围条件", "raw-connection-log": "Raw Connection Log", + "raw-logs": "原始日志", "rdf-predicate": "RDF谓词", "rdf-store": "RDF存储", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "重新分配", "re-deploy": "重新部署", + "re-deploy-sentence": "重新部署", "re-enter-new-password": "再次输入新密码", "re-index-all": "重建全部索引", "re-index-elasticsearch": "重建 Elasticsearch 索引", @@ -1924,6 +1957,7 @@ "recent-chat": "最近", "recent-event-plural": "最近事件", "recent-run-plural": "最近运行", + "recent-runs-sentence": "最近运行", "recent-search-term-plural": "最近搜索", "recent-views": "最近查看", "recently-created": "最近创建", @@ -1931,6 +1965,8 @@ "recently-updated": "最近更新", "recently-viewed": "最近查看过", "record-plural": "记录", + "records": "条记录", + "records-processed": "已处理记录", "recreate-index-plural": "重建索引", "reference-plural": "参考资料", "refocused-to-home": "已重新聚焦到主页", @@ -2071,6 +2107,7 @@ "run": "运行", "run-agent-plural": "运行代理", "run-at": "运行于", + "run-history-and-details": "运行历史和详情", "run-in-background": "Run in background", "run-now": "立即运行", "run-type": "运行类型", @@ -2138,6 +2175,7 @@ "search-index-plural": "搜索索引", "search-index-setting-plural": "搜索索引设置", "search-insights": "搜索见解", + "search-logs": "搜索日志", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "按内容搜索记忆...", @@ -2248,6 +2286,7 @@ "show-nested": "显示嵌套", "show-or-hide-advanced-config": "{{showAdv}}高级配置", "show-or-hide-column-plural": "显示/隐藏列", + "show-raw-logs": "显示原始日志", "showing-count-of-total-assets": "显示 {{total}} 个资产中的 {{count}} 个", "showing-total-failure-plural": "总共 {{total}} 次失败", "sign-in": "登入", @@ -2313,6 +2352,7 @@ "started": "已开始", "started-following": "开始关注", "starting-offset": "起始偏移量", + "starts-after": "开始于", "starts-with": "开头为", "state": "状态", "static": "静态", @@ -2322,10 +2362,13 @@ "status-success": "成功", "stay-up-to-date": "保持最新", "step": "步骤", + "steps": "步骤", + "steps-lowercase": "步骤", "steward": "Steward", "stop": "停止", "stop-re-index-all": "停止重新索引", "stopped": "已停止", + "stopped-lowercase": "已停止", "storage": "存储", "storage-plural": "存储", "storage-service": "存储服务", @@ -2500,6 +2543,7 @@ "to-perform": "执行", "to-service-name": "服务名称", "to-service-type": "服务类型", + "toggle-wrap": "切换换行", "token": "Token", "token-end-point": "令牌端点", "token-expiration": "令牌过期时间", @@ -2673,6 +2717,7 @@ "view-plural": "查看", "view-property-plural": "查看属性", "view-reindex-failure-plural": "查看重建索引失败", + "view-run-history": "查看运行历史", "view-selected": "查看所选内容", "visibility": "可见性", "visibility-dataspace": "数据空间", @@ -2685,8 +2730,10 @@ "volume-change": "数据量变化", "wall-clock": "实际时间", "wants-to-access-your-account": "希望访问您的 {{username}} 账号", + "warn": "警告", "warning": "警告", "warning-plural": "警告", + "warning-plural-lowercase": "警告", "web-analytic-entity-view-report-data": "网页分析实体查看报告数据", "web-analytic-user-activity-report-data": "网页分析用户活动报告数据", "web-analytics-report": "网络分析报告", @@ -2722,6 +2769,8 @@ "workflow-plural": "工作流", "worksheet": "工作表", "worksheet-plural": "工作表", + "wrap": "换行", + "wrapping-up": "即将完成", "year": "年", "yes": "是", "yes-comma-confirm": "是, 确认", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "使用具有 and/or 条件的语法编辑器找到正确的数据资产", "agent-setup-description": "为此代理配置核心参数。", + "agents-deploy-progress": "{{done}} 个已完成 · {{running}} 个运行中 · {{queued}} 个排队中{{failedSuffix}} — 首次运行后,代理将按其计划运行", + "agents-deploying-ingesting": "代理正在部署并提取元数据", + "agents-finished-summary": "{{total}} 个代理中已完成 {{done}} 个{{attentionSuffix}}", "aggregate-domain-type-description": "从多个来源收集和整理数据的域, 以提供汇总数据和数据产品, 如客户360、客户会话等, 供其他域使用。", "airflow-guide-message": "{{brandName}} 使用 Airflow 运行提取连接器, 我们开发了专门的托管 API 来部署提取连接器。请使用 {{brandName}} 专属的 Airflow 实例, 或参考下面的指南:在您的 Airflow 实例中安装我们开发的托管 API 程序。", "airflow-host-ip-address": "{{brandName}} 将从 IP 地址 <0>{{hostIp}} 连接到您的资源, 请确保在您的网络安全设置中允许该地址的入站访问", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "点击<0>{{text}}查看详情", "closed-this-task": "关闭了此任务", "collaborate-with-other-user": "与其他用户协作", + "collate-ai-agents-description": "使用 AI 自动分级、记录并检查资产质量。", "collate-ai-widget-description": "服务中由 Collate AI 生成的数据概览。<0>了解更多。", "column-bulk-operations-description": "一次管理和编辑多个列的元数据。搜索、过滤和更新数据资产中的显示名称、描述、标签和术语表术语。", "column-filter-help-text": "按列标签或名称过滤血缘。使用 'tag:标签名' 进行标签过滤,或直接输入列名。", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "获取访问令牌时出现错误", "establishing-connection-ellipsis": "正在建立连接…", "events-matching-search-query": "与搜索查询匹配的事件", + "everything-healthy": "一切正常", "example-value": "例如 {{value}}", "exclude-system-entity-description": "禁用时,架构中为{{entity}}定义的默认模式将自动应用。", "excludes-regex-line": "排除 += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "没关系, 现在是重新制定目标并更快进展的时候了。", "latency-sla-description": "<0>{{label}}:查询响应时间必须小于 <0>{{data}}。", "latest-offset-description": "系统中事件的最新偏移量。", + "latest-run-lines": "最近运行 · {{count}} 行", "ldap-group-dn-placeholder": "例如 cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "此LDAP组DN已被映射。每个LDAP组只能映射一次。", "learning-resources-management-description": "探索产品功能,通过我们的资源了解它们的工作原理", + "leave-page-ingestion-continues": "您可以离开此页面 — 提取将在后台继续", "leave-the-team-team-name": "离开团队{{teamName}}", "length-validator-error": "至少需要{{length}}个{{field}}", "lineage-ingestion-description": "在设置元数据提取后, 可以配置并部署血缘提取。血缘提取工作流获取查询历史记录, 解析 CREATE、INSERT、MERGE... 查询, 并整理相关实体之间的血缘。一个数据库服务只能定义一个血缘提取工作流。定义查询日志持续时间(天数)和结果限制即可开始。", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "今天想分析什么?", "mcp-chat-placeholder": "随便问什么都行...", "mentioned-you-on-the-lowercase": "在以下地方提到了您", + "metadata-agents-description": "从数据源提取元数据、使用情况、血缘和剖析信息。", "metadata-agents-table-description": "元数据代理用于从源服务中提取元数据。", "metadata-ingestion-description": "根据选择的服务类型, 输入 Schema(模式)或表(数据库)、消息主题(消息队列)或仪表板的过滤规则详细信息。根据需要选择包括视图, 启用或禁用数据分析器, 并提取样本数据。", "metadata-status-complete-description": "元数据在所有列中已完整填写且一致", @@ -3392,6 +3449,8 @@ "minimum-count-error": "至少必须选择 {{count}} 个 {{field}}。", "minimum-value-error": "最小值应小于最大值", "minute": "分钟", + "minutes-left": "剩余约 {{count}} 分钟", + "minutes-short": "{{count}} 分钟", "missing-config-value": "缺少配置值:{{field}}", "missing-description": "缺少描述", "modified-time-ago-by": "{{time}} 前由 {{by}} 修改", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "未配置LDAP角色映射。", "no-learning-resources-available": "此上下文没有可用的学习资源。", "no-lineage-available": "未找到 lineage 连接", + "no-lines-match": "没有匹配的行。", "no-match-found": "未找到匹配项", "no-mentions": "近期您或您的团队没有被任何项目提及", "no-native-fields": "此实体类型没有可配置的原生字段。", @@ -3513,6 +3573,7 @@ "no-profiler-message": "通过运行分析器工作流探索您的表的指标。您将看到行数、表更新、体积变化等。访问我们的文档以获取设置步骤 ", "no-profiler-title": "运行分析器以解锁表洞察", "no-properties-added": "No properties added.", + "no-recent-runs": "未找到最近的运行。", "no-recently-viewed-data": "无最近查看过的数据", "no-reference-available": "无可用参考", "no-related-terms-available": "无相关术语可用", @@ -3638,6 +3699,7 @@ "password-error-message": "密码必须为8到56个字符, 至少包括一个大写字母(A-Z)、一个小写字母(a-z), 和一个特殊字符(例如:!, %, @, or #)", "password-pattern-error": "密码必须为8到56个字符, 至少包括一个特殊字符、一个大写字母、一个小写字母", "path-of-the-dbt-files-stored": "存储 dbt 文件的文件夹路径", + "percent-complete-all-agents": "所有代理已完成 {{percent}}%", "permanently-delete-common-message": "永久删除此{{entity}}及其所有元数据。此操作无法撤销。", "permanently-delete-ingestion-pipeline": "永久删除此 <0>{{entityName}} 将导致管道配置丢失,并且无法恢复。", "permanently-delete-metadata": "永久删除此<0>{{entityName}}将永久从 {{brandName}} 中删除其元数据", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "该配置用来调整日志回溯时长, 以处理使用情况数据", "query-used-by-other-tables": "被其他数据表使用的查询", "quick-add-tip": "使用快速添加可以在不离开图的情况下创建术语表术语关系。", + "ran-for-duration": "运行了 {{duration}} 分钟", "rdf-not-enabled-for-export": "导出本体需要启用RDF。请在服务器配置中启用RDF。", "rdf-predicate-tooltip": "此关系类型的RDF谓词URI(例如 skos:broader, skos:exactMatch)。", "reacted-with-emoji": "使用{{type}}表情符号做出回复", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}:数据应保留 <0>{{data}}。", "run-sample-data-to-ingest-sample-data": "'运行样本数据以提取样本数据资产到 {{brandName}}'", "run-status-at-timestamp": "运行状态: {{status}} 在 {{timestamp}}", + "run-status-click-details": "{{status}} 运行 · 点击查看详情", "run-successful-test-to-continue": "运行成功的测试以继续。", "sample-data-ingestion-config-description": "此架构定义了可用于示例数据收集的参数。", "schedule-description": "安排摄取在特定时间和频率运行。", @@ -3740,6 +3804,8 @@ "search-insights-description": "查看搜索集群统计信息、索引详细信息并管理孤立索引。", "search-settings-description": "基于排名的每个实体的搜索设置。", "search-settings-for-entity": "基于排名的{{entity}}搜索设置", + "seconds-left": "剩余约 {{count}} 秒", + "seconds-short": "{{count}} 秒", "see-also": "另请参阅", "see-how-to-get-started": "查看如何开始", "select-alert-type": "请选择一种提醒类型", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json index b3b18f2f3780..a7f0d1e92fe8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json @@ -97,6 +97,7 @@ "advanced-configuration": "進階組態", "advanced-entity": "進階 {{entity}}", "advanced-search": "進階搜尋", + "agent": "代理程式", "agent-activity": "代理活動", "agent-plural": "代理程式", "agent-setup": "代理程式設定", @@ -189,6 +190,8 @@ "asset-plural": "資產", "asset-plural-lowercase": "資產", "asset-type": "資產類型", + "assets-ingested": "已擷取的資產", + "assets-profiled": "已剖析的資產", "assigned": "已指派", "assigned-entity": "已指派的 {{entity}}", "assigned-to-me": "已指派給我", @@ -248,6 +251,7 @@ "basic-configuration": "基本組態", "batch-size": "批次大小", "bearer-hmac-signature": "Bearer(HMAC 簽名)", + "before-error": "錯誤發生前", "before-number-of-day-plural": "{{numberOfDays}} 天前", "belongs-to": "屬於", "belongs-to-database": "屬於資料庫", @@ -369,6 +373,7 @@ "collapse": "收合", "collapse-all": "全部收合", "collate-ai": "Collate AI", + "collate-ai-agent-plural": "Collate AI 代理程式", "collection": "集合", "collection-plural": "集合", "color": "顏色", @@ -492,7 +497,7 @@ "cost-analysis": "成本分析", "count": "計數", "count-jobs-running": "{{count}} jobs running…", - "count-running": "{{count}} running", + "count-running": "{{count}} 個執行中", "cover-image": "封面", "covered": "已涵蓋", "create": "建立", @@ -664,12 +669,14 @@ "dbt-source": "dbt 來源", "dbt-source-project": "dbt 原始專案", "deactivated": "已停用", + "debug": "偵錯", "december": "十二月", "decision": "決策", "default": "預設", "default-persona": "預設角色", "default-role": "預設角色", "delete": "刪除", + "delete-agent": "刪除代理程式", "delete-all-nodes": "刪除所有節點", "delete-boost": "刪除權重", "delete-data-asset-rule": "刪除資料資產規則", @@ -697,6 +704,7 @@ "deployed": "已部署", "deployed-lowercase": "已部署", "deploying-lowercase": "正在部署", + "deployment-complete": "部署完成", "deprecate": "Deprecate", "depth": "深度", "derive-glossary-term-plural": "Derive Glossary Terms", @@ -718,6 +726,7 @@ "detail-plural": "詳情", "details": "詳細資料", "developed-by-developer": "由 {{developer}} 開發", + "diagnose": "診斷", "diagnostic-info": "診斷資訊", "did-not-run": "未執行", "dimension": "維度", @@ -784,6 +793,7 @@ "drive-plural": "驅動器", "duplicate": "重複", "duration": "持續時間", + "duration-in-minute": "{{duration}} 分鐘", "dynamic": "動態", "dynamic-assertion": "動態斷言", "edge": "邊緣", @@ -795,6 +805,7 @@ "edit-amp-accept-suggestion": "編輯並接受建議", "edit-an-announcement": "編輯公告", "edit-chart-name": "編輯圖表:\"{{name}}\"", + "edit-configuration": "編輯設定", "edit-connection": "編輯連線", "edit-data-asset-rule": "編輯資料資產規則", "edit-description-for": "編輯 {{entityName}} 的描述", @@ -909,7 +920,9 @@ "equivalence": "等價", "error": "錯誤", "error-plural": "錯誤", + "error-plural-lowercase": "錯誤", "esc": "Esc", + "est-remaining": "預估剩餘時間", "establish-connection": "Establish Connection", "evaluate": "評估", "evaluate-permission": "評估權限", @@ -972,8 +985,10 @@ "factor": "因素", "fail-on-conflict": "冲突时失败", "failed": "失敗", + "failed-at": "失敗於", "failed-entity": "失敗的 {{entity}}", "failed-event-plural": "失敗的事件", + "failed-lowercase": "失敗", "failed-rows": "失敗行", "failed-slash-aborted-reason": "失敗/中止原因", "failed-to-upload-file": "檔案上傳失敗", @@ -1023,8 +1038,11 @@ "filter-pattern-plural": "篩選模式", "filter-plural": "篩選器", "filtered": "已篩選", + "filtered-lowercase": "已篩選", "filtering-condition": "篩選條件", "filters-configuration": "篩選器組態", + "finished": "已完成", + "finished-lowercase": "已完成", "first": "第一個", "first-lowercase": "第一個", "first-name": "名", @@ -1155,6 +1173,7 @@ "hide-impersonation-settings": "隱藏模擬設定 ({{count}})", "hide-meta-details": "隱藏元數據詳情", "hide-property-plural": "隱藏屬性", + "hide-raw-logs": "隱藏原始日誌", "hierarchical": "階層式", "hierarchy": "階層", "hierarchy-depth": "階層深度", @@ -1170,6 +1189,7 @@ "homepage": "首頁", "hour": "小時", "hourly": "每小時", + "how-to-fix": "如何修正", "http-config-source": "HTTP 組態來源", "http-method": "HTTP 方法", "hybrid-search-weight-plural": "混合搜尋權重", @@ -1226,6 +1246,7 @@ "index-name": "索引名稱", "index-states": "索引狀態", "indirect": "間接", + "info": "資訊", "ingest-sample-data": "擷取範例資料", "ingestion": "擷取", "ingestion-lowercase": "擷取", @@ -1297,6 +1318,7 @@ "keyword": "關鍵字", "keyword-lowercase-plural": "關鍵字", "kill": "終止", + "kill-run": "終止執行", "knowledge": "知識", "knowledge-article-plural": "知識文章", "knowledge-center": "知識中心", @@ -1508,7 +1530,9 @@ "model": "模型", "model-name": "模型名稱", "model-plural": "模型", + "model-plural-lowercase": "模型", "model-store": "模型儲存", + "models-parsed": "已剖析的模型", "modified-time": "修改時間", "modifier": "修飾詞", "monday": "星期一", @@ -1517,6 +1541,7 @@ "monthly": "每月", "more": "更多", "more-action": "更多動作", + "more-action-plural": "更多操作", "more-actions": "更多操作", "more-help": "更多說明", "more-lowercase": "更多", @@ -1554,6 +1579,7 @@ "native-field-plural": "原生欄位", "navigation": "導覽", "navigation-menu-plural": "導覽選單", + "need-attention": "需要注意", "need-help": "需要協助", "needs-attention": "需要關注", "needs-review": "需要審核", @@ -1605,6 +1631,7 @@ "no-records": "無記錄", "no-result-found": "找不到結果。", "no-reviewer": "無審核者", + "no-status": "無狀態", "no-tags-added": "未新增標籤", "no-tasks-yet": "尚無任務", "no-tests-run": "未运行测试", @@ -1741,6 +1768,7 @@ "part-of": "屬於", "part-of-domain": "屬於領域", "partial-coverage": "部分涵蓋", + "partial-success": "部分成功", "partition-lowercase-plural": "分割區", "partition-plural": "分割區", "partitioned": "已分割", @@ -1885,12 +1913,15 @@ "public-team": "公開團隊", "published": "已發布", "quality": "品質", + "queries-processed": "已處理的查詢", + "queries-scanned": "已掃描的查詢", "query": "查詢", "query-log-duration": "查詢日誌持續時間", "query-lowercase": "查詢", "query-lowercase-plural": "查詢", "query-parameter-plural": "查詢參數", "query-plural": "查詢", + "query-plural-lowercase": "查詢", "query-used-in": "用於查詢", "queued": "已排入佇列", "quick-add": "快速新增", @@ -1902,11 +1933,13 @@ "range": "範圍", "range-condition": "範圍條件", "raw-connection-log": "Raw Connection Log", + "raw-logs": "原始日誌", "rdf-predicate": "RDF謂詞", "rdf-store": "RDF儲存", "rdf-xml-rdf": "RDF/XML (.rdf)", "re-assign": "重新指派", "re-deploy": "重新部署", + "re-deploy-sentence": "重新部署", "re-enter-new-password": "重新輸入新密碼", "re-index-all": "全部重建索引", "re-index-elasticsearch": "重建 Elasticsearch 索引", @@ -1924,6 +1957,7 @@ "recent-chat": "最近", "recent-event-plural": "最近的事件", "recent-run-plural": "最近的執行", + "recent-runs-sentence": "最近的執行", "recent-search-term-plural": "最近的搜尋詞彙", "recent-views": "最近檢視", "recently-created": "最近創建", @@ -1931,6 +1965,8 @@ "recently-updated": "最近更新", "recently-viewed": "最近檢視", "record-plural": "記錄", + "records": "記錄", + "records-processed": "已處理的記錄", "recreate-index-plural": "重建索引", "reference-plural": "參考", "refocused-to-home": "已將焦點重新設為首頁", @@ -2071,6 +2107,7 @@ "run": "執行", "run-agent-plural": "執行代理程式", "run-at": "執行於", + "run-history-and-details": "執行歷程與詳細資料", "run-in-background": "Run in background", "run-now": "立即執行", "run-type": "執行類型", @@ -2138,6 +2175,7 @@ "search-index-plural": "搜尋索引", "search-index-setting-plural": "搜尋索引設定", "search-insights": "搜尋洞察", + "search-logs": "搜尋日誌", "search-mapping": "Search Mapping", "search-mapping-plural": "Search Mappings", "search-memories": "按內容搜索記憶...", @@ -2248,6 +2286,7 @@ "show-nested": "顯示嵌套", "show-or-hide-advanced-config": "{{showAdv}} 進階組態", "show-or-hide-column-plural": "顯示/隱藏欄位", + "show-raw-logs": "顯示原始日誌", "showing-count-of-total-assets": "顯示 {{total}} 個資產中的 {{count}} 個", "showing-total-failure-plural": "共 {{total}} 次失敗", "sign-in": "登入", @@ -2313,6 +2352,7 @@ "started": "已開始", "started-following": "開始追蹤", "starting-offset": "起始偏移量", + "starts-after": "開始條件", "starts-with": "開頭為", "state": "狀態", "static": "靜態", @@ -2322,10 +2362,13 @@ "status-success": "成功", "stay-up-to-date": "保持最新", "step": "步驟", + "steps": "步驟", + "steps-lowercase": "步驟", "steward": "Steward", "stop": "停止", "stop-re-index-all": "停止重建索引", "stopped": "已停止", + "stopped-lowercase": "已停止", "storage": "儲存", "storage-plural": "儲存", "storage-service": "儲存服務", @@ -2500,6 +2543,7 @@ "to-perform": "執行", "to-service-name": "服務名稱", "to-service-type": "服務類型", + "toggle-wrap": "切換自動換行", "token": "Token", "token-end-point": "權杖端點", "token-expiration": "權杖到期", @@ -2673,6 +2717,7 @@ "view-plural": "檢視", "view-property-plural": "檢視屬性", "view-reindex-failure-plural": "檢視重新索引失敗", + "view-run-history": "檢視執行歷程", "view-selected": "檢視已選取", "visibility": "可見性", "visibility-dataspace": "資料空間", @@ -2685,8 +2730,10 @@ "volume-change": "量變更", "wall-clock": "實際時間", "wants-to-access-your-account": "想要存取您的 {{username}} 帳戶", + "warn": "警告", "warning": "警告", "warning-plural": "警告", + "warning-plural-lowercase": "警告", "web-analytic-entity-view-report-data": "Web 分析實體檢視報告資料", "web-analytic-user-activity-report-data": "Web 分析使用者活動報告資料", "web-analytics-report": "Web 分析報告", @@ -2722,6 +2769,8 @@ "workflow-plural": "工作流程", "worksheet": "工作表", "worksheet-plural": "工作表", + "wrap": "自動換行", + "wrapping-up": "即將完成", "year": "年", "yes": "是", "yes-comma-confirm": "是,確認", @@ -2758,6 +2807,9 @@ "advanced-config-section-description": "Driver-level options — connection arguments, scheme, and timeouts. Most connections never need these.", "advanced-search-message": "使用帶有 and/or 條件的語法編輯器來探索正確的資料資產。", "agent-setup-description": "為此代理程式設定核心參數。", + "agents-deploy-progress": "{{done}} 已完成 · {{running}} 執行中 · {{queued}} 排隊中{{failedSuffix}} — 完成此首次執行後,代理程式將依排程執行", + "agents-deploying-ingesting": "代理程式正在部署並擷取中繼資料", + "agents-finished-summary": "{{total}} 個代理程式中已完成 {{done}} 個{{attentionSuffix}}", "aggregate-domain-type-description": "從多個來源收集和整理資料的領域,以提供彙總資料和資料產品,例如客戶 360 度、客戶工作階段等,供其他領域使用。", "airflow-guide-message": "{{brandName}} 使用 Airflow 來執行擷取連接器。我們開發了受管理的 API 來部署擷取連接器。請使用 {{brandName}} Airflow 執行個體或參考以下指南在您的 Airflow 安裝中安裝受管理的 API。", "airflow-host-ip-address": "{{brandName}} 將從 IP <0>{{hostIp}} 連線到您的資源。請確保在您的網路安全設定中允許傳入流量。", @@ -2884,6 +2936,7 @@ "click-text-to-view-details": "點擊 <0>{{text}} 查看詳情。", "closed-this-task": "已關閉此任務", "collaborate-with-other-user": "與其他使用者協作。", + "collate-ai-agents-description": "運用 AI 為您的資產自動分級、建立文件並進行品質檢查。", "collate-ai-widget-description": "Collate AI 為服務產生的資料概觀。<0>了解更多。", "column-bulk-operations-description": "一次管理和編輯多個欄位的元資料。搜尋、篩選和更新資料資產中的顯示名稱、描述、標籤和詞彙表術語。", "column-filter-help-text": "按欄位標籤或名稱篩選血緣。使用 'tag:標籤名稱' 進行標籤篩選,或直接輸入欄位名稱。", @@ -3127,6 +3180,7 @@ "error-while-fetching-access-token": "擷取存取權杖時發生錯誤。", "establishing-connection-ellipsis": "正在建立連線…", "events-matching-search-query": "符合搜尋查詢的事件", + "everything-healthy": "一切正常", "example-value": "例如 {{value}}", "exclude-system-entity-description": "停用時,架構中為{{entity}}定義的預設模式將自動套用。", "excludes-regex-line": "排除 += {{regex}}", @@ -3331,9 +3385,11 @@ "kpi-target-overdue": "注意:描述 KPI 目標尚未達成,但還有時間——您的組織還有 {{count}} 天。為保持進度,請啟用資料洞察報告。這將使我們能夠向所有團隊發送每週更新,促進協作並專注於實現我們組織的 KPI。", "latency-sla-description": "<0>{{label}}:查詢回應時間必須低於 <0>{{data}}。", "latest-offset-description": "系統中事件的最新偏移量。", + "latest-run-lines": "最近的執行 · {{count}} 行", "ldap-group-dn-placeholder": "例如 cn=admins,ou=groups,dc=example,dc=com", "ldap-group-duplicate-error": "此LDAP群組DN已被對應。每個LDAP群組只能對應一次。", "learning-resources-management-description": "探索產品功能,透過我們的資源了解它們的運作方式", + "leave-page-ingestion-continues": "您可以離開此頁面 — 擷取作業將在背景繼續進行", "leave-the-team-team-name": "離開團隊 {{teamName}}", "length-validator-error": "至少需要 {{length}} 個 {{field}}", "lineage-ingestion-description": "在設定元資料擷取後,可以設定和部署血緣擷取。血緣擷取工作流程會取得查詢歷史,剖析 CREATE、INSERT、MERGE... 等查詢,並準備相關實體之間的血緣。血緣擷取對於一個資料庫服務只能有一個管線。定義查詢日誌持續時間(天)和結果限制以開始。", @@ -3372,6 +3428,7 @@ "mcp-chat-empty": "今天想分析什麼?", "mcp-chat-placeholder": "隨便問什麼都行...", "mentioned-you-on-the-lowercase": "在...上提到了您", + "metadata-agents-description": "從來源擷取中繼資料、使用情況、譜系與剖析資訊。", "metadata-agents-table-description": "元資料代理程式用於從來源服務中擷取元資料。", "metadata-ingestion-description": "根據所選的服務類型,輸入結構或資料表(資料庫)、主題(訊息傳遞)或儀表板的篩選模式詳細資料。您可以包含或排除篩選模式。根據需要選擇包含檢視、啟用或停用資料分析器,以及擷取範例資料。", "metadata-status-complete-description": "中繼資料在所有欄位中已完整填寫且一致", @@ -3392,6 +3449,8 @@ "minimum-count-error": "至少必須選擇 {{count}} 個 {{field}}。", "minimum-value-error": "最小值應小於最大值。", "minute": "分鐘", + "minutes-left": "剩餘約 {{count}} 分鐘", + "minutes-short": "{{count}} 分鐘", "missing-config-value": "缺少組態值:{{field}}", "missing-description": "缺少描述", "modified-time-ago-by": "{{time}} 前由 {{by}} 修改", @@ -3491,6 +3550,7 @@ "no-ldap-role-mappings": "未設定LDAP角色對應。", "no-learning-resources-available": "此上下文沒有可用的學習資源。", "no-lineage-available": "未找到 lineage 連接", + "no-lines-match": "沒有符合的行。", "no-match-found": "找不到相符項目", "no-mentions": "看來您和您的團隊一切順利——目前還沒有在任何活動中被提及。繼續保持!", "no-native-fields": "此實體類型沒有可設定的原生欄位。", @@ -3513,6 +3573,7 @@ "no-profiler-message": "透過執行分析器工作流程來探索您資料表的指標。您將看到資料列計數、資料表更新、量變更等等。請造訪我們的文件以了解設定步驟", "no-profiler-title": "執行分析器以解鎖表洞察", "no-properties-added": "No properties added.", + "no-recent-runs": "找不到最近的執行。", "no-recently-viewed-data": "您最近沒有檢視任何資料資產。探索以尋找有趣的東西!", "no-reference-available": "沒有可用的參考。", "no-related-terms-available": "沒有可用的相關術語。", @@ -3638,6 +3699,7 @@ "password-error-message": "密碼長度必須介於 8 到 56 個字元之間,並包含至少一個大寫字母 (A-Z)、一個小寫字母 (a-z)、一個數字和一個特殊字元(如 !、%、@ 或 #)", "password-pattern-error": "密碼長度必須介於 8 到 56 個字元之間,並包含一個特殊字元、一個大寫字母和一個小寫字母", "path-of-the-dbt-files-stored": "儲存 dbt 檔案的資料夾路徑", + "percent-complete-all-agents": "所有代理程式已完成 {{percent}}%", "permanently-delete-common-message": "永久刪除此{{entity}}及其所有中繼資料。此操作無法復原。", "permanently-delete-ingestion-pipeline": "永久刪除 <0>{{entityName}} 將導致管線組態遺失,且無法復原。", "permanently-delete-metadata": "永久刪除 <0>{{entityName}} 將導致其元資料從 {{brandName}} 中移除,且無法復原。", @@ -3679,6 +3741,7 @@ "query-log-duration-message": "設定我們希望在查詢日誌中回溯多遠以處理使用量資料的組態。", "query-used-by-other-tables": "其他資料表使用的查詢", "quick-add-tip": "使用快速新增可在不離開圖表的情況下建立詞彙表術語關係。", + "ran-for-duration": "已執行 {{duration}} 分鐘", "rdf-not-enabled-for-export": "匯出本體需要啟用RDF。請在伺服器設定中啟用RDF。", "rdf-predicate-tooltip": "此關係類型的RDF謂詞URI(例如 skos:broader, skos:exactMatch)。", "reacted-with-emoji": "用 {{type}} 表情符號回應", @@ -3718,6 +3781,7 @@ "retention-sla-description": "<0>{{label}}:資料應保留 <0>{{data}}。", "run-sample-data-to-ingest-sample-data": "「執行範例資料以將範例資料資產擷取到您的 {{brandName}} 中。」", "run-status-at-timestamp": "執行狀態:{{status}} 於 {{timestamp}}", + "run-status-click-details": "{{status}} 執行 · 按一下以檢視詳細資料", "run-successful-test-to-continue": "執行成功的測試以繼續。", "sample-data-ingestion-config-description": "此結構描述定義了可用於範例資料收集的參數。", "schedule-description": "排程擷取在特定時間和頻率下執行。", @@ -3740,6 +3804,8 @@ "search-insights-description": "檢視搜尋叢集統計、索引詳細資料並管理孤立索引。", "search-settings-description": "根據排名對每個實體進行搜尋設定。", "search-settings-for-entity": "根據 {{entity}} 的排名進行搜尋設定", + "seconds-left": "剩餘約 {{count}} 秒", + "seconds-short": "{{count}} 秒", "see-also": "另請參閱", "see-how-to-get-started": "看看如何開始", "select-alert-type": "請選擇警示類型", diff --git a/openmetadata-ui/src/main/resources/ui/src/mocks/Ingestion.mock.ts b/openmetadata-ui/src/main/resources/ui/src/mocks/Ingestion.mock.ts index 3f5f3e3c9c54..bf8ef66fd575 100644 --- a/openmetadata-ui/src/main/resources/ui/src/mocks/Ingestion.mock.ts +++ b/openmetadata-ui/src/main/resources/ui/src/mocks/Ingestion.mock.ts @@ -223,6 +223,7 @@ const mockCurrentHandleSearchChange = jest.fn(); const mockCurrentOnPageChange = jest.fn(); export const ingestionProps: IngestionProps = { + agents: [], ingestionPipelineList: mockIngestionWorkFlow.data .data as unknown as IngestionPipeline[], serviceDetails: mockService, diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/EditIngestionPage/EditIngestionPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/EditIngestionPage/EditIngestionPage.component.tsx index 5bdebfd0739b..4b2b03b037a5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/EditIngestionPage/EditIngestionPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/EditIngestionPage/EditIngestionPage.component.tsx @@ -307,6 +307,7 @@ const EditIngestionPage = () => {
, + popoverProps: { open: true }, +}; + +describe('Certification', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockGetTags.mockResolvedValue({ + data: mockCertifications, + paging: { total: 3 }, + }); + }); + + it('should render the trigger children', () => { + render(); + + expect(screen.getByTestId('certification-trigger')).toBeInTheDocument(); + }); + + it('should fetch certifications when the popover opens', async () => { + render(); + + await waitFor(() => { + expect(mockGetTags).toHaveBeenCalledWith({ + parent: 'Certification', + limit: 50, + after: undefined, + disabled: false, + }); + }); + }); + + it('should sort certifications with Gold, Silver, and Bronze first', async () => { + render(); + + await waitFor(() => { + expect(screen.getByTestId('certification-cards')).toBeInTheDocument(); + }); + + const radioButtons = screen.getAllByTestId(/radio-btn-/); + + expect(radioButtons[0]).toHaveAttribute( + 'data-testid', + 'radio-btn-Certification.Gold' + ); + expect(radioButtons[1]).toHaveAttribute( + 'data-testid', + 'radio-btn-Certification.Silver' + ); + expect(radioButtons[2]).toHaveAttribute( + 'data-testid', + 'radio-btn-Certification.Bronze' + ); + }); + + it('should show an empty state when no certifications are available', async () => { + mockGetTags.mockResolvedValueOnce({ + data: [], + paging: { total: 0 }, + }); + + render(); + + await waitFor(() => { + expect(screen.getByText('label.no-entity-available')).toBeInTheDocument(); + }); + }); + + it('should select a certification when a card is clicked', async () => { + render(); + + await waitFor(() => { + expect( + screen.getByTestId('radio-btn-Certification.Silver') + ).toBeInTheDocument(); + }); + + fireEvent.click(screen.getByTestId('radio-btn-Certification.Silver')); + + expect(screen.getByTestId('radio-btn-Certification.Silver')).toBeChecked(); + }); + + it('should call onCertificationUpdate with the selected certification', async () => { + render(); + + await waitFor(() => { + expect( + screen.getByTestId('radio-btn-Certification.Gold') + ).toBeInTheDocument(); + }); + + await act(async () => { + fireEvent.click(screen.getByTestId('update-certification')); + }); + + await waitFor(() => { + expect(mockOnCertificationUpdate).toHaveBeenCalledWith( + expect.objectContaining({ + fullyQualifiedName: 'Certification.Gold', + }) + ); + }); + }); + + it('should clear the certification when clear is clicked', async () => { + render(); + + await waitFor(() => { + expect(screen.getByTestId('clear-certification')).toBeInTheDocument(); + }); + + await act(async () => { + fireEvent.click(screen.getByTestId('clear-certification')); + }); + + await waitFor(() => { + expect(mockOnCertificationUpdate).toHaveBeenCalledWith(undefined); + }); + }); + + it('should call onClose when the close button is clicked', async () => { + render(); + + await waitFor(() => { + expect(screen.getByTestId('close-certification')).toBeInTheDocument(); + }); + + fireEvent.click(screen.getByTestId('close-certification')); + + expect(mockOnClose).toHaveBeenCalledTimes(1); + }); + + it('should show an error toast when fetching certifications fails', async () => { + const fetchError = new Error('fetch failed'); + mockGetTags.mockRejectedValueOnce(fetchError); + + render(); + + await waitFor(() => { + expect(showErrorToast).toHaveBeenCalledWith( + fetchError, + 'server.entity-fetch-error' + ); + }); + }); + + it('should fetch certifications when the trigger is clicked', async () => { + render( + + ); + + fireEvent.click(screen.getByTestId('certification-trigger')); + + await waitFor(() => { + expect(mockGetTags).toHaveBeenCalledWith({ + parent: 'Certification', + limit: 50, + after: undefined, + disabled: false, + }); + }); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CertificationTag/CertificationTag.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/CertificationTag/CertificationTag.test.tsx new file mode 100644 index 000000000000..aa3297ccef06 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CertificationTag/CertificationTag.test.tsx @@ -0,0 +1,149 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { render, screen } from '@testing-library/react'; +import { MemoryRouter } from 'react-router-dom'; +import { AssetCertification } from '../../../generated/type/assetCertification'; +import { LabelType, State, TagSource } from '../../../generated/type/tagLabel'; +import { getClassificationTagPath } from '../../../utils/RouterUtils'; +import CertificationTag from './CertificationTag'; + +jest.mock('../../../assets/svg/ic-certification.svg', () => ({ + ReactComponent: () =>
, +})); + +jest.mock('../../../utils/IconUtils', () => ({ + renderIcon: jest.fn(), +})); + +const { renderIcon } = jest.requireMock('../../../utils/IconUtils'); + +const mockCertification: AssetCertification = { + tagLabel: { + tagFQN: 'Certification.Gold', + name: 'Gold', + displayName: 'Gold Medal', + description: 'Gold certified data asset', + style: { + color: '#FFD700', + iconURL: 'https://example.com/gold.png', + }, + source: TagSource.Classification, + labelType: LabelType.Manual, + state: State.Confirmed, + }, + appliedDate: 1732814645688, + expiryDate: 1735406645688, +}; + +const renderCertificationTag = ( + certification = mockCertification, + showName = false +) => + render( + + + + ); + +describe('CertificationTag', () => { + beforeEach(() => { + jest.clearAllMocks(); + renderIcon.mockReturnValue( + icon + ); + }); + + it('should render a link with the certification tag test id', () => { + renderCertificationTag(); + + expect( + screen.getByTestId('certification-Certification.Gold') + ).toBeInTheDocument(); + }); + + it('should link to the classification tag path', () => { + renderCertificationTag(); + + const link = screen.getByTestId('certification-Certification.Gold'); + + expect(link).toHaveAttribute( + 'href', + getClassificationTagPath('Certification.Gold') + ); + }); + + it('should render the certification name when showName is true', () => { + renderCertificationTag(mockCertification, true); + + expect(screen.getByText('Gold Medal')).toBeInTheDocument(); + }); + + it('should not render the certification name when showName is false', () => { + renderCertificationTag(mockCertification, false); + + expect(screen.queryByText('Gold Medal')).not.toBeInTheDocument(); + }); + + it('should render a custom icon when iconURL is provided', () => { + renderCertificationTag(); + + expect(screen.getByTestId('custom-certification-icon')).toBeInTheDocument(); + expect(renderIcon).toHaveBeenCalledWith( + 'https://example.com/gold.png', + expect.objectContaining({ + size: 28, + className: 'certification-img', + alt: 'certification: Gold Medal', + }) + ); + }); + + it('should use a smaller icon size when showName is true', () => { + renderCertificationTag(mockCertification, true); + + expect(renderIcon).toHaveBeenCalledWith( + 'https://example.com/gold.png', + expect.objectContaining({ + size: 16, + }) + ); + }); + + it('should render the default icon when iconURL is not provided', () => { + renderIcon.mockReturnValue(null); + + const certificationWithoutIcon: AssetCertification = { + ...mockCertification, + tagLabel: { + ...mockCertification.tagLabel, + style: { + color: '#FFD700', + }, + }, + }; + + renderCertificationTag(certificationWithoutIcon); + + expect( + screen.getByTestId('default-certification-icon') + ).toBeInTheDocument(); + }); + + it('should apply background color styling when showName is true', () => { + renderCertificationTag(mockCertification, true); + + const link = screen.getByTestId('certification-Certification.Gold'); + + expect(link).toHaveStyle({ backgroundColor: '#FFD70033' }); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CertificationTag/CertificationTag.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/CertificationTag/CertificationTag.tsx index dcad3660e47f..a4c585338889 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CertificationTag/CertificationTag.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CertificationTag/CertificationTag.tsx @@ -17,7 +17,7 @@ import { Link } from 'react-router-dom'; import { ReactComponent as CertificationIcon } from '../../../assets/svg/ic-certification.svg'; import { AssetCertification } from '../../../generated/entity/data/table'; import { getEntityName } from '../../../utils/EntityNameUtils'; -import { getTagImageSrc } from '../../../utils/IconUtils'; +import { renderIcon } from '../../../utils/IconUtils'; import { getClassificationTagPath } from '../../../utils/RouterUtils'; import { getTagTooltip } from '../../../utils/TagsUtils'; import './certification-tag.less'; @@ -30,23 +30,28 @@ const CertificationTag = ({ showName?: boolean; }) => { const imageItem = useMemo(() => { - if (certification.tagLabel.style?.iconURL) { - const name = getEntityName(certification.tagLabel); - const tagSrc = getTagImageSrc(certification.tagLabel.style.iconURL); + const iconURL = certification.tagLabel.style?.iconURL; + const name = getEntityName(certification.tagLabel); + + if (iconURL) { + const iconSize = showName ? 16 : 28; + const renderedIcon = renderIcon(iconURL, { + size: iconSize, + className: 'certification-img', + alt: `certification: ${name}`, + }); - return ( - {`certification: - ); + if (renderedIcon) { + return renderedIcon; + } } - const iconSize = showName ? 14 : 20; + const defaultIconSize = showName ? 14 : 20; - return ; - }, [certification.tagLabel.style?.iconURL, showName]); + return ( + + ); + }, [certification.tagLabel, showName]); const certificationRender = useMemo(() => { const name = getEntityName(certification.tagLabel); diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/regex.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/regex.constants.ts index 8f5a3112d73b..f74936ce17b5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/regex.constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/regex.constants.ts @@ -92,10 +92,11 @@ export const INTEGER_ZERO_TO_HUNDRED_REGEX = /^(100|[1-9]?\d)$/; // Format: two lowercase letters optionally followed by hyphen and two uppercase letters export const LOCALE_CODE_REGEX = /^[a-z]{2}(-[A-Z]{2})?$/; -// Matches URLs (http/https with content, absolute paths with content, data URIs) OR filenames with image extensions -// Filenames restricted to alphanumeric, hyphens, underscores, and dots for security +// Matches URLs (http/https with content, absolute paths with content, data URIs), +// relative paths with image extensions, or bare filenames with image extensions. +// Filenames restricted to alphanumeric, hyphens, underscores, dots, and slashes. export const IMAGE_URL_PATTERN = - /^(https?:\/\/.+|\/[^\s]+|data:image\/.+)|^[\w\-.]+\.(png|jpg|jpeg|gif|svg|webp|bmp|ico)$/i; + /^(https?:\/\/.+|\/(?!.*\.\.)[^\s]+|data:image\/.+)|^(?!.*\.\.)[\w\-./]+\.(png|jpg|jpeg|gif|svg|webp|bmp|ico)$/i; export const SECTION_BLOCK_REGEX = /\$\$section\n([\s\S]*?)\n\$\$/g; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/IconUtils.test.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/IconUtils.test.tsx index 4901e4bea0b1..54559985f4f7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/IconUtils.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/IconUtils.test.tsx @@ -42,6 +42,16 @@ describe('IconUtils', () => { expect(isImageUrl('image.file.jpeg')).toBe(true); }); + it('should return true for relative image paths', () => { + expect(isImageUrl('assets/certifications/gold.svg')).toBe(true); + expect(isImageUrl('images/icons/bronze.png')).toBe(true); + }); + + it('should return false for relative paths containing parent directory segments', () => { + expect(isImageUrl('../assets/icon.png')).toBe(false); + expect(isImageUrl('assets/../icon.png')).toBe(false); + }); + it('should return true for all supported image extensions', () => { const extensions = [ 'png', @@ -169,6 +179,46 @@ describe('IconUtils', () => { expect(img).toHaveStyle({ width: '48px', height: '48px' }); }); + it('should apply custom className to icon component', () => { + const { container } = render( + <>{renderIcon('Cube01', { className: 'custom-class' })} + ); + const svg = container.querySelector('svg'); + + expect(svg).toBeInTheDocument(); + expect(svg).toHaveClass('custom-class'); + }); + + it('should apply custom alt text to img element', () => { + const { container } = render( + <>{renderIcon('icon.png', { alt: 'certification: Gold' })} + ); + const img = container.querySelector('img'); + + expect(img).toBeInTheDocument(); + expect(img).toHaveAttribute('alt', 'certification: Gold'); + }); + + it('should default alt text to icon for img element', () => { + const { container } = render(<>{renderIcon('icon.png')}); + const img = container.querySelector('img'); + + expect(img).toBeInTheDocument(); + expect(img).toHaveAttribute('alt', 'icon'); + }); + + it('should render img element for relative image paths', () => { + const { container } = render( + <>{renderIcon('assets/certifications/gold.svg')} + ); + const img = container.querySelector('img'); + + expect(img).toBeInTheDocument(); + expect(img?.getAttribute('src')).toContain( + 'assets/certifications/gold.svg' + ); + }); + it('should apply custom className to img element', () => { const { container } = render( <>{renderIcon('icon.png', { className: 'custom-class' })} diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/IconUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/IconUtils.tsx index ca92b53a84ce..840c1351ed8f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/IconUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/IconUtils.tsx @@ -86,7 +86,11 @@ export const getTagImageSrc = (iconURL: string): string => { // Map of icon names to their components export const ICON_MAP: Record< string, - ComponentType<{ size?: number; style?: React.CSSProperties }> + ComponentType<{ + size?: number; + className?: string; + style?: React.CSSProperties; + }> > = { Cube01: Cube01, Home02: Home02, @@ -156,6 +160,7 @@ interface RenderIconOptions { className?: string; style?: React.CSSProperties; strokeWidth?: number; + alt?: string; } /** @@ -168,7 +173,13 @@ export const renderIcon = ( iconValue: string | undefined, options: RenderIconOptions = {} ) => { - const { size = 24, className = '', style = {}, strokeWidth = 1.5 } = options; + const { + size = 24, + className = '', + style = {}, + strokeWidth = 1.5, + alt = 'icon', + } = options; if (!iconValue) { return null; @@ -177,19 +188,24 @@ export const renderIcon = ( // Check if it's a known icon name const IconComponent = ICON_MAP[iconValue]; if (IconComponent) { - // Return the icon component directly without wrapper - return ; + return ( + + ); } // Only render as image if it looks like a valid URL/path or has an image extension - if (!IMAGE_URL_PATTERN.test(iconValue)) { + if (!isImageUrl(iconValue)) { return null; } // Render as image with error handling return ( icon Date: Thu, 9 Jul 2026 09:36:37 +0200 Subject: [PATCH 006/165] fix(event-subscription): record failed webhook events on non-2xx delivery (#29808) --- .../changeEvent/generic/GenericPublisher.java | 2 - .../generic/GenericPublisherTest.java | 86 +++++++++++++++++++ 2 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisherTest.java diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisher.java b/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisher.java index 94efddc9e29c..610ac03571b4 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisher.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisher.java @@ -107,8 +107,6 @@ public void sendMessage(ChangeEvent event, Set recipients) } } } - } catch (EventPublisherException ex) { - throw ex; } catch (Exception ex) { if (ex.getCause() instanceof UnknownHostException) { String message = diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisherTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisherTest.java new file mode 100644 index 000000000000..480d7c50e62b --- /dev/null +++ b/openmetadata-service/src/test/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisherTest.java @@ -0,0 +1,86 @@ +/* + * Copyright 2021 Collate + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openmetadata.service.apps.bundles.changeEvent.generic; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.openmetadata.schema.entity.events.SubscriptionDestination.SubscriptionType.WEBHOOK; + +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.MultivaluedHashMap; +import jakarta.ws.rs.core.Response; +import java.net.URI; +import java.util.Set; +import java.util.UUID; +import org.apache.commons.lang3.tuple.Pair; +import org.junit.jupiter.api.Test; +import org.openmetadata.schema.entity.events.EventSubscription; +import org.openmetadata.schema.entity.events.SubscriptionDestination; +import org.openmetadata.schema.type.ChangeEvent; +import org.openmetadata.schema.type.Webhook; +import org.openmetadata.service.events.errors.EventPublisherException; +import org.openmetadata.service.notifications.recipients.context.WebhookRecipient; + +class GenericPublisherTest { + + @Test + void sendMessageAttachesChangeEventWhenWebhookDeliveryFails() throws Exception { + UUID destinationId = UUID.randomUUID(); + Webhook webhook = new Webhook().withEndpoint(URI.create("https://hooks.example.com/dead")); + SubscriptionDestination destination = + new SubscriptionDestination() + .withId(destinationId) + .withType(WEBHOOK) + .withTimeout(10) + .withReadTimeout(12) + .withEnabled(true) + .withConfig(webhook); + EventSubscription eventSubscription = + new EventSubscription().withId(UUID.randomUUID()).withName("test-alert"); + ChangeEvent event = new ChangeEvent().withId(UUID.randomUUID()).withEntityType("table"); + + Response.StatusType statusInfo = mock(Response.StatusType.class); + when(statusInfo.getReasonPhrase()).thenReturn("Not Found"); + Response response = mock(Response.class); + when(response.getStatus()).thenReturn(404); + when(response.getStatusInfo()).thenReturn(statusInfo); + when(response.getStringHeaders()).thenReturn(new MultivaluedHashMap<>()); + when(response.hasEntity()).thenReturn(false); + when(response.getMediaType()).thenReturn(null); + + Invocation.Builder builder = mock(Invocation.Builder.class); + when(builder.post(any())).thenReturn(response); + WebhookRecipient recipient = mock(WebhookRecipient.class); + when(recipient.getConfiguredRequest(any(), any())).thenReturn(builder); + + GenericPublisher publisher = new GenericPublisher(eventSubscription, destination); + + EventPublisherException exception = + assertThrows( + EventPublisherException.class, () -> publisher.sendMessage(event, Set.of(recipient))); + + // Without the pair, AbstractEventConsumer.handleFailedEvent bails out and never records the + // failed event (logging "Change Event with Subscription is null ..."). + Pair changeEventWithSubscription = + exception.getChangeEventWithSubscription(); + assertNotNull(changeEventWithSubscription); + assertEquals(destinationId, changeEventWithSubscription.getLeft()); + assertSame(event, changeEventWithSubscription.getRight()); + } +} From 34997ea62a8a529d27fa1bf3d0c404fd815f81d6 Mon Sep 17 00:00:00 2001 From: Vishnu Jain <121681876+Vishnuujain@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:15:36 +0530 Subject: [PATCH 007/165] Fix stale description source badge when clearing a nested field's description (#29843) --- .../service/jdbi3/ChangeSummarizer.java | 72 ++++++++++--------- .../service/jdbi3/ChangeSummarizerTest.java | 24 +++++++ 2 files changed, 61 insertions(+), 35 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ChangeSummarizer.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ChangeSummarizer.java index 40f32f731d2c..5d0dabaef73e 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ChangeSummarizer.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ChangeSummarizer.java @@ -72,53 +72,55 @@ private boolean hasField(Class clazz, String fieldName) { } /** - * Given a list of fields that were deleted, process the fields and return the set of keys to delete + * Given a list of fields that were deleted, return the change-summary keys to remove. A key is + * removed when either the tracked field itself was deleted (for example clearing a single + * column's description) or when a parent list holding tracked fields was deleted (for example + * removing a whole column). The keys mirror the ones produced by {@link #summarizeChanges}, which + * uses the raw {@link FieldChange#getName()} as the map key. */ public Set processDeleted(List fieldsDeleted) { + Set keysToDelete = new HashSet<>(directlyDeletedKeys(fieldsDeleted)); + keysToDelete.addAll(nestedListDeletedKeys(fieldsDeleted)); + return keysToDelete; + } + + private Set directlyDeletedKeys(List fieldsDeleted) { + return fieldsDeleted.stream() + .map(FieldChange::getName) + .filter(this::isFieldTracked) + .collect(Collectors.toSet()); + } + + private Set nestedListDeletedKeys(List fieldsDeleted) { Set keysToDelete = new HashSet<>(); for (String field : fields) { - // process top level fields - List topLevel = - fieldsDeleted.stream() - .filter(fieldChange -> fieldChange.getName().equals(field)) - .map( - fieldChange -> - FullyQualifiedName.build( - fieldChange.getName(), (String) fieldChange.getOldValue())) - .toList(); - if (!topLevel.isEmpty()) { - keysToDelete.addAll(topLevel); - continue; - } - - // process nested fields - Set nestedFields = + Set deletedParentLists = fieldsDeleted.stream() .filter(fieldChange -> field.startsWith(fieldChange.getName() + ".")) + .filter(fieldChange -> isListField(clazz, fieldChange.getName())) .collect(Collectors.toSet()); - - for (FieldChange fieldChange : nestedFields) { - if (!isListField(clazz, fieldChange.getName())) { - continue; - } - - try { - String nestedField = field.substring(fieldChange.getName().length() + 1); - JsonUtils.readObjects((String) fieldChange.getOldValue(), Map.class).stream() - .map(map -> (Map) map) - .map(map -> (String) map.get("name")) - .forEach( - name -> - keysToDelete.add( - FullyQualifiedName.build(fieldChange.getName(), name, nestedField))); - } catch (JsonParsingException e) { - LOG.warn("Error processing deleted fields", e); - } + for (FieldChange fieldChange : deletedParentLists) { + keysToDelete.addAll(expandListItemKeys(field, fieldChange)); } } return keysToDelete; } + private Set expandListItemKeys(String trackedField, FieldChange deletedList) { + Set keys = new HashSet<>(); + try { + String nestedField = trackedField.substring(deletedList.getName().length() + 1); + JsonUtils.readObjects((String) deletedList.getOldValue(), Map.class).stream() + .map(map -> (Map) map) + .map(map -> (String) map.get("name")) + .forEach( + name -> keys.add(FullyQualifiedName.build(deletedList.getName(), name, nestedField))); + } catch (JsonParsingException e) { + LOG.warn("Error processing deleted fields", e); + } + return keys; + } + private boolean matchesTrackedField(String trackedField, String fieldName) { if (trackedField.equals(fieldName)) { return true; diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/ChangeSummarizerTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/ChangeSummarizerTest.java index 8217c807f768..331631ee6008 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/ChangeSummarizerTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/ChangeSummarizerTest.java @@ -145,4 +145,28 @@ public void test_deleteColumn() { assertEquals(1, result.size()); assertEquals("columns.c'_+# 1.description", result.iterator().next()); } + + @Test + public void test_deleteColumnDescription() { + FieldChange fieldChange = + new FieldChange().withName("columns.column1.description").withOldValue("some description"); + + Set result = changeSummarizer.processDeleted(List.of(fieldChange)); + assertEquals(1, result.size()); + assertEquals("columns.column1.description", result.iterator().next()); + } + + @Test + public void test_deleteMultiLevelNestedColumnDescription() { + ChangeSummarizer containerChangeSummarizer = + new ChangeSummarizer<>(Container.class, Set.of("dataModel.columns.description")); + FieldChange fieldChange = + new FieldChange() + .withName("dataModel.columns.column1.description") + .withOldValue("some description"); + + Set result = containerChangeSummarizer.processDeleted(List.of(fieldChange)); + assertEquals(1, result.size()); + assertEquals("dataModel.columns.column1.description", result.iterator().next()); + } } From 41b4469f33f6d7c8b232deb39e14ce1e0f5c0e09 Mon Sep 17 00:00:00 2001 From: IceS2 Date: Thu, 9 Jul 2026 10:54:44 +0200 Subject: [PATCH 008/165] Fixes #29765: refactor(databricks): migrate test-connection to declarative @check framework (#29773) * Fixes #29765: refactor(databricks): migrate test-connection to declarative @check framework Replace the DatabricksConnection.test_connection override with a checks() provider driven by BaseConnection.test_connection. Implements all 13 seeded steps via DatabricksChecks, adds a Databricks ErrorPack folding in the shared network pack, gates on a TCP preflight, and marks CheckAccess as ConnectionGate. Adds the 7 greenfield lineage/tag/view-definition members to the shared DatabaseStep enum. * fix(databricks): defer inspector build so checks() never connects eagerly sqlalchemy.inspect(engine) opens a connection at construction (the dialect's _init_engine runs engine.connect().close()). Building it in DatabricksEngineWrapper.__init__ connected before the runner's CheckAccess gate, so an auth failure escaped the runner as a 500 and an unreachable host hung on the driver's own timeout instead of the 20s TCP preflight. Make the inspector lazy. Also classify NO_SUCH_CATALOG_EXCEPTION / NO_SUCH_SCHEMA_EXCEPTION (Databricks says 'was not found', not 'does not exist'). * fix(databricks): cap test-connection listing at the source, not after fetch The wrapper's catalog/table/view listing used fetchall() and get_schemas reflected the full name list, so GetSchemas on a 102-schema catalog reported '102+' and materialized the whole result. Cap at the fetch (fetchmany(DEFAULT_SAMPLE_ROWS)) and slice the schema reflection, so the count reads '100+' and memory stays bounded. Scoped to DatabricksEngineWrapper, which is test-connection only; real ingestion enumerates everything via CommonDbSourceService. * fix(databricks): diagnose MALFORMED_REQUEST as an invalid HTTP path A bad httpPath fails CheckAccess with MALFORMED_REQUEST and the gate short-circuits the rest, but the step carried no diagnosis - just the raw driver error. Add a rule pointing at the SQL warehouse HTTP path format. * fix(databricks): honor connectionTimeout as the per-step budget The removed test_connection override passed service_connection.connectionTimeout (default 120s) as the per-step timeout; the migrated path fell back to the 60s framework default, so a cold serverless warehouse could spuriously time out and user overrides were ignored. Resolve connectionTimeout into BaseConnection.step_timeout_seconds (the connector-level hook) in __init__ - no test_connection override, consistent with the bigquery migration. Addresses the greptile review finding. * docs(databricks): tighten test-connection comments and docstrings Trim rationale-heavy docstrings to contract-only and cut restated-obvious comments, keeping short notes only for the non-obvious footguns (eager inspect connect, error-pack ordering). * fix(databricks): normalize hostPort and guard unresolved catalog Strip a pasted URL scheme/path from hostPort (shared helper used by the TCP preflight and the URL builder) so a workspace URL doesn't fail the gate with a misleading DNS error. Guard the catalog-scoped USE CATALOG / SHOW statements so an unresolved first_catalog never emits literal `None` SQL. Addresses review findings. * fix(databricks): normalize auth host + honest GetDatabases command Share the hostPort scheme/path normalization with the OAuth/Azure-AD host derivation in auth.py (a pasted workspace URL no longer leaks 'https' as the auth host). Report no command for GetDatabases when a catalog is configured (it is trusted without running SHOW CATALOGS), so the evidence matches what ran. Tighten the URL test to a urlparse check (drops the CodeQL substring-sanitization flag). --- .../test_connection/checks/database.py | 7 + .../source/database/databricks/auth.py | 13 +- .../source/database/databricks/connection.py | 388 ++++++++++++------ .../source/database/databricks/__init__.py | 0 .../database/databricks/test_connection.py | 348 ++++++++++++++++ .../unit/topology/database/test_databricks.py | 110 +---- .../testConnections/database/databricks.json | 1 + 7 files changed, 635 insertions(+), 232 deletions(-) create mode 100644 ingestion/tests/unit/source/database/databricks/__init__.py create mode 100644 ingestion/tests/unit/source/database/databricks/test_connection.py diff --git a/ingestion/src/metadata/core/connections/test_connection/checks/database.py b/ingestion/src/metadata/core/connections/test_connection/checks/database.py index 6792d9efbeb2..342d5a2d3a69 100644 --- a/ingestion/src/metadata/core/connections/test_connection/checks/database.py +++ b/ingestion/src/metadata/core/connections/test_connection/checks/database.py @@ -59,6 +59,13 @@ class DatabaseStep(StepName): GetColumnMetadata = "GetColumnMetadata" GetTableComments = "GetTableComments" GetInformationSchemaColumns = "GetInformationSchemaColumns" + GetViewDefinitions = "GetViewDefinitions" + GetCatalogTags = "GetCatalogTags" + GetSchemaTags = "GetSchemaTags" + GetTableTags = "GetTableTags" + GetColumnTags = "GetColumnTags" + GetTableLineage = "GetTableLineage" + GetColumnLineage = "GetColumnLineage" @contextmanager diff --git a/ingestion/src/metadata/ingestion/source/database/databricks/auth.py b/ingestion/src/metadata/ingestion/source/database/databricks/auth.py index fcef05baa107..d3d0c10bf1c5 100644 --- a/ingestion/src/metadata/ingestion/source/database/databricks/auth.py +++ b/ingestion/src/metadata/ingestion/source/database/databricks/auth.py @@ -34,6 +34,15 @@ ) +def normalize_host_port(host_port: str) -> str: + """Strip a pasted URL scheme and path, leaving ``host:port``.""" + return host_port.split("://", 1)[-1].split("/", 1)[0] + + +def _host(connection: Union[DatabricksConnection, UnityCatalogConnection]) -> str: # noqa: UP007 + return normalize_host_port(connection.hostPort).split(":")[0] + + def get_personal_access_token_auth( connection: Union[DatabricksConnection, UnityCatalogConnection], # noqa: UP007 ) -> dict: @@ -51,7 +60,7 @@ def get_databricks_oauth_auth( """ def credential_provider(): - hostname = connection.hostPort.split(":")[0] + hostname = _host(connection) config = Config( host=f"https://{hostname}", client_id=connection.authType.clientId, @@ -68,7 +77,7 @@ def get_azure_ad_auth(connection: Union[DatabricksConnection, UnityCatalogConnec """ def credential_provider(): - hostname = connection.hostPort.split(":")[0] + hostname = _host(connection) config = Config( host=f"https://{hostname}", azure_client_secret=connection.authType.azureClientSecret.get_secret_value(), diff --git a/ingestion/src/metadata/ingestion/source/database/databricks/connection.py b/ingestion/src/metadata/ingestion/source/database/databricks/connection.py index 3264f98f85ea..2ba2b8f34c2c 100644 --- a/ingestion/src/metadata/ingestion/source/database/databricks/connection.py +++ b/ingestion/src/metadata/ingestion/source/database/databricks/connection.py @@ -13,37 +13,48 @@ Source connection handler """ +from __future__ import annotations + from copy import deepcopy -from functools import partial -from typing import Optional +from typing import TYPE_CHECKING, Optional from urllib.parse import quote_plus from sqlalchemy import text from sqlalchemy.engine import Engine -from sqlalchemy.exc import DatabaseError from sqlalchemy.inspection import inspect -from metadata.generated.schema.entity.automations.workflow import ( - Workflow as AutomationWorkflow, +from metadata.core.connections.test_connection import ( + ErrorPack, + Evidence, + Matchers, + check, + when, +) +from metadata.core.connections.test_connection.check import CheckError +from metadata.core.connections.test_connection.checks.database import ( + DEFAULT_SAMPLE_ROWS, + DatabaseStep, + run_sql, +) +from metadata.core.connections.test_connection.constants import STEP_TIMEOUT_SECONDS +from metadata.core.connections.test_connection.network import ( + NETWORK_ERRORS, + NetworkUnreachableError, + tcp_probe, ) from metadata.generated.schema.entity.services.connections.database.databricksConnection import ( DatabricksConnection as DatabricksConnectionConfig, ) -from metadata.generated.schema.entity.services.connections.testConnectionResult import ( - TestConnectionResult, -) from metadata.ingestion.connections.builders import ( create_generic_db_connection, get_connection_args_common, init_empty_connection_arguments, ) from metadata.ingestion.connections.connection import BaseConnection -from metadata.ingestion.connections.test_connections import ( - test_connection_engine_step, - test_connection_steps, +from metadata.ingestion.source.database.databricks.auth import ( + get_auth_config, + normalize_host_port, ) -from metadata.ingestion.ometa.ometa_api import OpenMetadata -from metadata.ingestion.source.database.databricks.auth import get_auth_config from metadata.ingestion.source.database.databricks.log_filters import ( suppress_user_agent_entry_deprecation_log, ) @@ -58,44 +69,132 @@ TEST_TABLE_TAGS, TEST_VIEW_DEFINITIONS, ) -from metadata.utils.constants import THREE_MIN from metadata.utils.logger import ingestion_logger +if TYPE_CHECKING: + from collections.abc import Callable, Sequence + + from metadata.core.connections.test_connection import ChecksProvider + logger = ingestion_logger() suppress_user_agent_entry_deprecation_log() +# Databricks dials the workspace over HTTPS; the gate TCP-probes this port. +DEFAULT_DATABRICKS_PORT = 443 + +DEFAULT_CATALOG = "main" + +SYSTEM_SCHEMAS = frozenset({"information_schema", "performance_schema", "sys"}) + + +# databricks-sql/thrift reports failures as message tokens, not numeric codes, so +# rules key on tokens; specific ones precede broad ones (first match wins). +DATABRICKS_ERRORS = ErrorPack( + when(Matchers.contains("invalid access token")).diagnose( + "Authentication failed", + fix="Check the access token - the workspace rejected it. Verify the token is valid, " + "not expired, and belongs to a user with access to this workspace.", + ), + when(Matchers.contains("token is expired")).diagnose( + "Access token expired", + fix="The access token has expired. Generate a new token and update the connection.", + ), + when(Matchers.contains("forbidden")).diagnose( + "Access denied", + fix="The workspace returned 403 Forbidden. Verify the token's user is entitled to the " + "workspace and the configured HTTP path / SQL warehouse.", + ), + when(Matchers.contains("malformed_request")).diagnose( + "Invalid HTTP path", + fix="The HTTP Path is malformed. Copy it from the SQL warehouse (or cluster) Connection " + "Details in Databricks - it must look like /sql/1.0/warehouses/ or " + "/sql/1.0/endpoints/.", + ), + when(Matchers.contains("no_such_catalog")).diagnose( + "Catalog not found", + fix="The configured catalog does not exist or is not visible to the token's user. Verify " + "the catalog name and that the user has USE CATALOG on it.", + ), + when(Matchers.contains("no_such_schema")).diagnose( + "Schema not found", + fix="The configured schema does not exist or is not visible. Verify the schema name and " + "that the user has USE SCHEMA on it.", + ), + when(Matchers.contains("table_or_view_not_found")).diagnose( + "Table or view not found", + fix="The referenced table or view does not exist or is not visible to the token's user. " + "Verify the object exists and the user has SELECT on it.", + ), + when(Matchers.contains("schema_not_found")).diagnose( + "Schema not found", + fix="The referenced schema does not exist or is not visible. Verify the schema name and " + "that the user has USAGE on it.", + ), + when(Matchers.contains("permission_denied")).diagnose( + "Insufficient privileges", + fix="Grant the token's user the privileges the failing step needs (USAGE on the catalog / " + "schema and SELECT on the system or information_schema tables it reads).", + ), + when(Matchers.contains("insufficient_permissions")).diagnose( + "Insufficient privileges", + fix="Grant the token's user the privileges the failing step needs (USAGE on the catalog / " + "schema and SELECT on the system or information_schema tables it reads).", + ), + when(Matchers.contains("does not exist")).diagnose( + "Object not found", + fix="Verify the configured catalog, schema, and HTTP path exist and the token's user is " + "authorized to use them.", + ), +).including(NETWORK_ERRORS) + + +def _summarize(rows: Sequence[object], noun: str) -> str: + """``N s enumerated`` (``N+`` at the cap) or ``no s enumerated``.""" + count = len(rows) + if not count: + return f"no {noun}s enumerated" + suffix = "+" if count >= DEFAULT_SAMPLE_ROWS else "" + plural = noun if count == 1 else f"{noun}s" + return f"{count}{suffix} {plural} enumerated" + class DatabricksEngineWrapper: - """Wrapper to store engine and schemas to avoid multiple calls""" + """Engine wrapper caching the resolved catalog and schema. Lookups are lazy, so + constructing it touches no network and stays behind the CheckAccess gate.""" def __init__(self, engine: Engine): self.engine = engine - self.inspector = inspect(engine) + self._inspector = None self.schemas = None self.first_schema = None self.first_catalog = None + @property + def inspector(self): + # Lazy, never at construction: inspect(engine) connects eagerly (the + # dialect's _init_engine runs engine.connect().close()), which would + # bypass the CheckAccess gate. + if self._inspector is None: + self._inspector = inspect(self.engine) + return self._inspector + def get_schemas(self, schema_name: Optional[str] = None): # noqa: UP045 """Get schemas and cache them""" if schema_name is not None: - with self.engine.connect() as connection: - connection.execute(text(f"USE CATALOG `{self.first_catalog}`")) + if self.first_catalog: + with self.engine.connect() as connection: + connection.execute(text(f"USE CATALOG `{self.first_catalog}`")) self.first_schema = schema_name return [schema_name] if self.schemas is None: - self.schemas = self.inspector.get_schema_names(database=self.first_catalog) + # Bound the reflected list (no driver-side cap) to the sample size. + self.schemas = self.inspector.get_schema_names(database=self.first_catalog)[:DEFAULT_SAMPLE_ROWS] if self.schemas: - # Find the first schema that's not a system schema for schema in self.schemas: - if schema.lower() not in ( - "information_schema", - "performance_schema", - "sys", - ): + if schema.lower() not in SYSTEM_SCHEMAS: self.first_schema = schema break - # If no non-system schema found, use the first one if self.first_schema is None and self.schemas: self.first_schema = self.schemas[0] return self.schemas @@ -103,41 +202,40 @@ def get_schemas(self, schema_name: Optional[str] = None): # noqa: UP045 def get_tables(self): """Get tables using the cached first schema""" if self.first_schema is None: - self.get_schemas() # This will set first_schema - if self.first_schema: + self.get_schemas() + if self.first_catalog and self.first_schema: with self.engine.connect() as connection: tables = connection.execute(text(f"SHOW TABLES IN `{self.first_catalog}`.`{self.first_schema}`")) - return tables # noqa: RET504 + return tables.fetchmany(DEFAULT_SAMPLE_ROWS) return [] def get_views(self): """Get views using the cached first schema""" if self.first_schema is None: - self.get_schemas() # This will set first_schema - if self.first_schema: + self.get_schemas() + if self.first_catalog and self.first_schema: with self.engine.connect() as connection: views = connection.execute(text(f"SHOW VIEWS IN `{self.first_catalog}`.`{self.first_schema}`")) - return views # noqa: RET504 + return views.fetchmany(DEFAULT_SAMPLE_ROWS) return [] def get_catalogs(self, catalog_name: Optional[str] = None): # noqa: UP045 """Get catalogs""" - catalogs = [] if catalog_name is not None: self.first_catalog = catalog_name return [catalog_name] with self.engine.connect() as connection: - catalogs = connection.execute(text(DATABRICKS_GET_CATALOGS)).fetchall() - for catalog in catalogs: - if catalog[0] != "__databricks_internal": - self.first_catalog = catalog[0] - break + catalogs = connection.execute(text(DATABRICKS_GET_CATALOGS)).fetchmany(DEFAULT_SAMPLE_ROWS) + for catalog in catalogs: + if catalog[0] != "__databricks_internal": + self.first_catalog = catalog[0] + break return catalogs def get_connection_url(connection: DatabricksConnectionConfig) -> str: scheme = connection.scheme.value if connection.scheme else "databricks" - url = f"{scheme}://{connection.hostPort}" + url = f"{scheme}://{normalize_host_port(connection.hostPort)}" if connection.catalog: url = f"{url}?catalog={quote_plus(connection.catalog)}" return url @@ -170,95 +268,129 @@ def get_connection(connection: DatabricksConnectionConfig) -> Engine: return engine +class DatabricksChecks: + """Test-connection checks for Databricks. Catalog/schema listing goes through + ``DatabricksEngineWrapper``; every statement is built inside its ``@check`` so + nothing connects before the gate.""" + + errors = DATABRICKS_ERRORS + + def __init__(self, client: Engine, service_connection: DatabricksConnectionConfig) -> None: + self.client = client + self.service_connection = service_connection + self._engine_wrapper = DatabricksEngineWrapper(client) + + def _first_catalog(self) -> str: + """Resolve and cache the catalog to scope tag probes to.""" + if self._engine_wrapper.first_catalog is None: + self._engine_wrapper.get_catalogs(catalog_name=self.service_connection.catalog) + return self._engine_wrapper.first_catalog or self.service_connection.catalog or DEFAULT_CATALOG + + def _probe_target(self) -> tuple[str, int]: + host_port = normalize_host_port(self.service_connection.hostPort) + host, _, port = host_port.rpartition(":") + if host and port.isdigit(): + return host, int(port) + return host_port, DEFAULT_DATABRICKS_PORT + + def _list(self, operation: Callable[[], Sequence[object] | None], command: str | None, noun: str) -> Evidence: + """Run a wrapper listing op, reporting the command and a row-count summary; + on failure re-raise as ``CheckError`` carrying the attempted command.""" + try: + rows = operation() + except Exception as cause: + raise CheckError(cause, Evidence(command=command)) from cause + rows = list(rows) if rows is not None else [] + return Evidence(summary=_summarize(rows, noun), command=command) + + @check(DatabaseStep.CheckAccess) + def check_access(self) -> Evidence: + host, port = self._probe_target() + try: + tcp_probe(host, port) + except NetworkUnreachableError as error: + raise CheckError(error, Evidence(command=f"TCP connect {host}:{port}")) from error + return run_sql(self.client, "SELECT 1", lambda _: "connection established") + + @check(DatabaseStep.GetDatabases) + def get_databases(self) -> Evidence: + # A configured catalog is trusted without querying, so no SHOW CATALOGS runs. + configured = self.service_connection.catalog + command = None if configured else DATABRICKS_GET_CATALOGS + return self._list( + lambda: self._engine_wrapper.get_catalogs(catalog_name=configured), + command, + "catalog", + ) + + @check(DatabaseStep.GetSchemas) + def get_schemas(self) -> Evidence: + return self._list( + lambda: self._engine_wrapper.get_schemas(schema_name=self.service_connection.databaseSchema), + "SHOW SCHEMAS", + "schema", + ) + + @check(DatabaseStep.GetTables) + def get_tables(self) -> Evidence: + return self._list(self._engine_wrapper.get_tables, "SHOW TABLES", "table") + + @check(DatabaseStep.GetViews) + def get_views(self) -> Evidence: + return self._list(self._engine_wrapper.get_views, "SHOW VIEWS", "view") + + @check(DatabaseStep.GetQueries) + def get_queries(self) -> Evidence: + statement = DATABRICKS_SQL_STATEMENT_TEST.format(query_history=self.service_connection.queryHistoryTable) + return run_sql(self.client, statement, lambda _: "query history accessible") + + @check(DatabaseStep.GetViewDefinitions) + def get_view_definitions(self) -> Evidence: + return run_sql(self.client, TEST_VIEW_DEFINITIONS, lambda _: "view definitions accessible") + + @check(DatabaseStep.GetCatalogTags) + def get_catalog_tags(self) -> Evidence: + statement = TEST_CATALOG_TAGS.format(database_name=self._first_catalog()) + return run_sql(self.client, statement, lambda _: "catalog tags accessible") + + @check(DatabaseStep.GetSchemaTags) + def get_schema_tags(self) -> Evidence: + statement = TEST_SCHEMA_TAGS.format(database_name=self._first_catalog()) + return run_sql(self.client, statement, lambda _: "schema tags accessible") + + @check(DatabaseStep.GetTableTags) + def get_table_tags(self) -> Evidence: + statement = TEST_TABLE_TAGS.format(database_name=self._first_catalog()) + return run_sql(self.client, statement, lambda _: "table tags accessible") + + @check(DatabaseStep.GetColumnTags) + def get_column_tags(self) -> Evidence: + statement = TEST_COLUMN_TAGS.format(database_name=self._first_catalog()) + return run_sql(self.client, statement, lambda _: "column tags accessible") + + @check(DatabaseStep.GetTableLineage) + def get_table_lineage(self) -> Evidence: + return run_sql(self.client, TEST_TABLE_LINEAGE, lambda _: "table lineage accessible") + + @check(DatabaseStep.GetColumnLineage) + def get_column_lineage(self) -> Evidence: + return run_sql(self.client, TEST_COLUMN_LINEAGE, lambda _: "column lineage accessible") + + class DatabricksConnection(BaseConnection[DatabricksConnectionConfig, Engine]): + def __init__(self, service_connection: DatabricksConnectionConfig) -> None: + super().__init__(service_connection) + # Honor the user-facing connectionTimeout (default 120s) as the per-step + # budget; a cold serverless warehouse can exceed the 60s framework default. + self.step_timeout_seconds = service_connection.connectionTimeout or STEP_TIMEOUT_SECONDS + def _get_client(self) -> Engine: - return get_connection(self.service_connection) - - def test_connection( - self, - metadata: OpenMetadata, - automation_workflow: Optional[AutomationWorkflow] = None, # noqa: UP045 - timeout_seconds: Optional[int] = THREE_MIN, # noqa: UP045 - ) -> TestConnectionResult: - """ - Test connection. This can be executed either as part - of a metadata workflow or during an Automation Workflow - """ - connection = self.client - service_connection = self.service_connection - - def test_database_query(engine: Engine, statement: str): - """ - Method used to execute the given query and fetch a result - to test if user has access to the tables specified - in the sql statement - """ - try: - connection = engine.connect() - connection.execute(text(statement)).fetchone() - except DatabaseError as soe: - logger.debug(f"Failed to fetch catalogs due to: {soe}") - - # Create wrapper to avoid multiple schema calls - engine_wrapper = DatabricksEngineWrapper(connection) - - # Helper function to get first catalog for tag queries - def get_first_catalog(): - catalogs = engine_wrapper.get_catalogs(catalog_name=service_connection.catalog) - return catalogs[0] if catalogs else service_connection.catalog or "main" - - test_fn = { - "CheckAccess": partial(test_connection_engine_step, connection), - "GetSchemas": partial(engine_wrapper.get_schemas, schema_name=service_connection.databaseSchema), - "GetTables": engine_wrapper.get_tables, - "GetViews": engine_wrapper.get_views, - "GetDatabases": partial(engine_wrapper.get_catalogs, catalog_name=service_connection.catalog), - "GetQueries": partial( - test_database_query, - engine=connection, - statement=DATABRICKS_SQL_STATEMENT_TEST.format(query_history=service_connection.queryHistoryTable), - ), - "GetViewDefinitions": partial( - test_database_query, - engine=connection, - statement=TEST_VIEW_DEFINITIONS, - ), - "GetCatalogTags": partial( - test_database_query, - engine=connection, - statement=TEST_CATALOG_TAGS.format(database_name=get_first_catalog()), - ), - "GetSchemaTags": partial( - test_database_query, - engine=connection, - statement=TEST_SCHEMA_TAGS.format(database_name=get_first_catalog()), - ), - "GetTableTags": partial( - test_database_query, - engine=connection, - statement=TEST_TABLE_TAGS.format(database_name=get_first_catalog()), - ), - "GetColumnTags": partial( - test_database_query, - engine=connection, - statement=TEST_COLUMN_TAGS.format(database_name=get_first_catalog()), - ), - "GetTableLineage": partial( - test_database_query, - engine=connection, - statement=TEST_TABLE_LINEAGE, - ), - "GetColumnLineage": partial( - test_database_query, - engine=connection, - statement=TEST_COLUMN_LINEAGE, - ), - } - - return test_connection_steps( - metadata=metadata, - test_fn=test_fn, - service_type=service_connection.type.value, # pyright: ignore[reportOptionalMemberAccess] - automation_workflow=automation_workflow, - timeout_seconds=service_connection.connectionTimeout or timeout_seconds, + engine = get_connection(self.service_connection) + self._on_close(engine.dispose) + return engine + + def checks(self) -> ChecksProvider: + return DatabricksChecks( + client=self.client, + service_connection=self.service_connection, ) diff --git a/ingestion/tests/unit/source/database/databricks/__init__.py b/ingestion/tests/unit/source/database/databricks/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/ingestion/tests/unit/source/database/databricks/test_connection.py b/ingestion/tests/unit/source/database/databricks/test_connection.py new file mode 100644 index 000000000000..f8966e82da0e --- /dev/null +++ b/ingestion/tests/unit/source/database/databricks/test_connection.py @@ -0,0 +1,348 @@ +# Copyright 2025 Collate +# Licensed under the Collate Community License, Version 1.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# https://github.com/open-metadata/OpenMetadata/blob/main/ingestion/LICENSE +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Unit tests for the Databricks BaseConnection wiring and test-connection checks.""" + +from unittest.mock import MagicMock, patch + +import pytest + +from metadata.core.connections.test_connection.check import CheckError, collect_checks +from metadata.core.connections.test_connection.checks.database import DatabaseStep +from metadata.core.connections.test_connection.network import NetworkUnreachableError +from metadata.generated.schema.entity.services.connections.database.databricks.personalAccessToken import ( + PersonalAccessToken, +) +from metadata.generated.schema.entity.services.connections.database.databricksConnection import ( + DatabricksConnection as DatabricksConnectionConfig, +) +from metadata.ingestion.connections.connection import BaseConnection +from metadata.ingestion.source.database.databricks.connection import ( + DATABRICKS_ERRORS, + DatabricksChecks, + DatabricksConnection, +) + +CONNECTION_MODULE = "metadata.ingestion.source.database.databricks.connection" + + +def _config() -> DatabricksConnectionConfig: + return DatabricksConnectionConfig( + hostPort="my-workspace.cloud.databricks.com:443", + authType=PersonalAccessToken(token="dapi-secret"), + httpPath="/sql/1.0/warehouses/abc123", + catalog="my_catalog", + ) + + +class _SqlAlchemyError(Exception): + """Mirror ``sqlalchemy.exc.DBAPIError``: wraps the driver error on ``.orig``.""" + + def __init__(self, orig: Exception) -> None: + super().__init__(str(orig)) + self.orig = orig + + +def test_databricks_connection_is_base_connection(): + assert issubclass(DatabricksConnection, BaseConnection) + + +def test_get_client_uses_the_databricks_url_builder(): + with patch(f"{CONNECTION_MODULE}.create_generic_db_connection") as mock_connection: + _ = DatabricksConnection(_config()).client + assert mock_connection.call_args.kwargs["get_connection_url_fn"].__name__ == "get_connection_url" + + +def test_close_disposes_the_engine_pool(): + engine = MagicMock() + with patch(f"{CONNECTION_MODULE}.create_generic_db_connection", return_value=engine): + connection = DatabricksConnection(_config()) + assert connection.client is engine + connection.close() + engine.dispose.assert_called_once_with() + + +def test_connection_timeout_drives_the_per_step_budget(): + from metadata.core.connections.test_connection.constants import STEP_TIMEOUT_SECONDS + + # connectionTimeout (default 120) must win over the 60s framework default, + # fed through BaseConnection.step_timeout_seconds. + default_config = _config() + assert DatabricksConnection(default_config).step_timeout_seconds == default_config.connectionTimeout + + slow_config = _config() + slow_config.connectionTimeout = 300 + assert DatabricksConnection(slow_config).step_timeout_seconds == 300 + + unset_config = _config() + unset_config.connectionTimeout = None + assert DatabricksConnection(unset_config).step_timeout_seconds == STEP_TIMEOUT_SECONDS + + +def test_invalid_token_message_is_classified(): + error = _SqlAlchemyError(Exception("Error during request to server: Invalid access token")) + assert DATABRICKS_ERRORS.classify(error).title == "Authentication failed" + + +def test_expired_token_message_is_classified(): + error = _SqlAlchemyError(Exception("the access token is expired, please refresh it")) + assert DATABRICKS_ERRORS.classify(error).title == "Access token expired" + + +def test_forbidden_message_is_classified(): + error = _SqlAlchemyError(Exception("HTTP Response code: 403, Forbidden")) + assert DATABRICKS_ERRORS.classify(error).title == "Access denied" + + +def test_malformed_http_path_is_classified(): + # A bad httpPath fails CheckAccess with MALFORMED_REQUEST; needs a diagnosis. + error = _SqlAlchemyError( + Exception( + "MALFORMED_REQUEST: Path /sql/1.0/warehouses/39c390db3a5e19e must match pattern " + "/sql/1.0/endpoints/ or /sql/1.0/warehouses/" + ) + ) + assert DATABRICKS_ERRORS.classify(error).title == "Invalid HTTP path" + + +def test_permission_denied_is_classified(): + error = _SqlAlchemyError(Exception("[PERMISSION_DENIED] User does not have SELECT on system.access.table_lineage")) + assert DATABRICKS_ERRORS.classify(error).title == "Insufficient privileges" + + +def test_insufficient_permissions_is_classified(): + error = _SqlAlchemyError(Exception("INSUFFICIENT_PERMISSIONS: requires USAGE on catalog")) + assert DATABRICKS_ERRORS.classify(error).title == "Insufficient privileges" + + +def test_table_or_view_not_found_is_classified(): + error = _SqlAlchemyError(Exception("[TABLE_OR_VIEW_NOT_FOUND] The table or view cannot be found")) + assert DATABRICKS_ERRORS.classify(error).title == "Table or view not found" + + +def test_schema_not_found_is_classified(): + error = _SqlAlchemyError(Exception("[SCHEMA_NOT_FOUND] The schema cannot be found")) + assert DATABRICKS_ERRORS.classify(error).title == "Schema not found" + + +def test_catalog_does_not_exist_is_classified(): + error = _SqlAlchemyError(Exception("Catalog 'nope' does not exist")) + assert DATABRICKS_ERRORS.classify(error).title == "Object not found" + + +def test_no_such_catalog_exception_is_classified(): + # NO_SUCH_CATALOG_EXCEPTION says "was not found", not "does not exist". + error = _SqlAlchemyError(Exception("[NO_SUCH_CATALOG_EXCEPTION] Catalog 'batata' was not found. SQLSTATE: 42704")) + assert DATABRICKS_ERRORS.classify(error).title == "Catalog not found" + + +def test_no_such_schema_exception_is_classified(): + error = _SqlAlchemyError(Exception("[NO_SUCH_SCHEMA_EXCEPTION] Schema 'nope' was not found")) + assert DATABRICKS_ERRORS.classify(error).title == "Schema not found" + + +def test_network_errors_classify_through_including(): + error = NetworkUnreachableError("workspace:443 is not reachable") + error.__cause__ = ConnectionRefusedError(61, "Connection refused") + assert DATABRICKS_ERRORS.classify(error).title == "Connection refused" + + +def test_unknown_error_returns_no_diagnosis(): + error = _SqlAlchemyError(Exception("something entirely unexpected")) + assert DATABRICKS_ERRORS.classify(error) is None + + +def test_checks_cover_exactly_the_seeded_steps(): + checks = DatabricksChecks(client=MagicMock(), service_connection=_config()) + collected = collect_checks(checks) + assert set(collected.keys()) == { + DatabaseStep.CheckAccess, + DatabaseStep.GetDatabases, + DatabaseStep.GetSchemas, + DatabaseStep.GetTables, + DatabaseStep.GetViews, + DatabaseStep.GetQueries, + DatabaseStep.GetViewDefinitions, + DatabaseStep.GetCatalogTags, + DatabaseStep.GetSchemaTags, + DatabaseStep.GetTableTags, + DatabaseStep.GetColumnTags, + DatabaseStep.GetTableLineage, + DatabaseStep.GetColumnLineage, + } + + +def test_construction_does_not_touch_the_network(): + # Building the provider must not connect - that belongs in a gated check. + engine = MagicMock() + DatabricksChecks(client=engine, service_connection=_config()) + engine.connect.assert_not_called() + + +def test_construction_does_not_build_the_inspector(): + # Regression: inspect(engine) connects eagerly, so building it in __init__ would + # connect before the gate (auth error escapes as a 500). Keep it lazy. + with patch(f"{CONNECTION_MODULE}.inspect") as mock_inspect: + checks = DatabricksChecks(client=MagicMock(), service_connection=_config()) + mock_inspect.assert_not_called() + _ = checks._engine_wrapper.inspector + mock_inspect.assert_called_once() + + +def test_check_access_probes_the_host_port_then_pings(): + checks = DatabricksChecks(client=MagicMock(), service_connection=_config()) + with ( + patch(f"{CONNECTION_MODULE}.tcp_probe") as mock_probe, + patch(f"{CONNECTION_MODULE}.run_sql", return_value=MagicMock()) as mock_run, + ): + checks.check_access() + mock_probe.assert_called_once_with("my-workspace.cloud.databricks.com", 443) + assert mock_run.call_count == 1 + + +def test_check_access_reports_unreachable_host_as_network_failure(): + checks = DatabricksChecks(client=MagicMock(), service_connection=_config()) + probe_error = NetworkUnreachableError("my-workspace.cloud.databricks.com:443 is not reachable") + probe_error.__cause__ = ConnectionRefusedError(61, "Connection refused") + with ( + patch(f"{CONNECTION_MODULE}.tcp_probe", side_effect=probe_error) as mock_probe, + pytest.raises(CheckError) as exc, + ): + checks.check_access() + mock_probe.assert_called_once_with("my-workspace.cloud.databricks.com", 443) + assert exc.value.cause is probe_error + assert DATABRICKS_ERRORS.classify(exc.value.cause).title == "Connection refused" + + +def test_probe_target_defaults_to_443_when_no_port(): + config = _config() + config.hostPort = "my-workspace.cloud.databricks.com" + checks = DatabricksChecks(client=MagicMock(), service_connection=config) + assert checks._probe_target() == ("my-workspace.cloud.databricks.com", 443) + + +def test_first_catalog_uses_configured_catalog_without_querying(): + engine = MagicMock() + checks = DatabricksChecks(client=engine, service_connection=_config()) + assert checks._first_catalog() == "my_catalog" + engine.connect.assert_not_called() + + +def test_listing_caps_rows_at_the_sample_size_at_the_source(): + # Bound the fetch (fetchmany), not fetchall-then-slice. Test-connection only; + # real ingestion goes through the common framework. + from metadata.core.connections.test_connection.checks.database import ( + DEFAULT_SAMPLE_ROWS, + ) + from metadata.ingestion.source.database.databricks.connection import ( + DatabricksEngineWrapper, + ) + + result = MagicMock() + result.fetchmany.return_value = [("t",)] + conn = MagicMock() + conn.execute.return_value = result + engine = MagicMock() + engine.connect.return_value.__enter__.return_value = conn + + wrapper = DatabricksEngineWrapper(engine) + wrapper.first_catalog = "my_catalog" + wrapper.first_schema = "my_schema" + wrapper.get_tables() + result.fetchmany.assert_called_once_with(DEFAULT_SAMPLE_ROWS) + result.fetchall.assert_not_called() + + +def test_get_databases_reports_catalog_count(): + checks = DatabricksChecks(client=MagicMock(), service_connection=_config()) + with patch.object( + checks._engine_wrapper, "get_catalogs", return_value=[("my_catalog",), ("other",)] + ) as mock_catalogs: + evidence = checks.get_databases() + mock_catalogs.assert_called_once_with(catalog_name="my_catalog") + assert evidence.summary == "2 catalogs enumerated" + + +def test_get_databases_failure_reports_the_attempted_command_as_evidence(): + config = _config() + config.catalog = None + checks = DatabricksChecks(client=MagicMock(), service_connection=config) + with ( + patch.object(checks._engine_wrapper, "get_catalogs", side_effect=Exception("boom")), + pytest.raises(CheckError) as exc, + ): + checks.get_databases() + assert exc.value.evidence.command == "SHOW CATALOGS" + + +def test_get_databases_omits_the_command_when_catalog_is_configured(): + # A configured catalog is trusted without running SHOW CATALOGS. + checks = DatabricksChecks(client=MagicMock(), service_connection=_config()) + with patch.object(checks._engine_wrapper, "get_catalogs", return_value=[("my_catalog",)]): + evidence = checks.get_databases() + assert evidence.command is None + + +def test_probe_target_strips_a_pasted_url_scheme_and_path(): + # A pasted workspace URL must not reach the socket probe as the host, or the + # gate fails with a misleading DNS error before the driver. + config = _config() + config.hostPort = "https://my-workspace.cloud.databricks.com:443/sql/1.0/warehouses/x" + checks = DatabricksChecks(client=MagicMock(), service_connection=config) + assert checks._probe_target() == ("my-workspace.cloud.databricks.com", 443) + + +def test_connection_url_strips_a_pasted_url_scheme(): + from urllib.parse import urlparse + + from metadata.ingestion.source.database.databricks.connection import get_connection_url + + config = _config() + config.hostPort = "https://my-workspace.cloud.databricks.com:443" + parsed = urlparse(get_connection_url(config)) + assert parsed.hostname == "my-workspace.cloud.databricks.com" + assert parsed.port == 443 + + +def test_auth_host_derivation_strips_a_pasted_scheme(): + # OAuth/Azure-AD derive the workspace host from hostPort too; a pasted scheme + # must not leak in as the host or auth fails before the driver. + from metadata.ingestion.source.database.databricks.auth import _host, normalize_host_port + + assert normalize_host_port("https://ws.cloud.databricks.com:443/sql/x") == "ws.cloud.databricks.com:443" + connection = MagicMock() + connection.hostPort = "https://ws.cloud.databricks.com:443" + assert _host(connection) == "ws.cloud.databricks.com" + + +def test_schema_scoped_get_schemas_skips_use_catalog_when_catalog_unresolved(): + # first_catalog None (GetDatabases failed/skipped) must not emit USE CATALOG `None`. + from metadata.ingestion.source.database.databricks.connection import ( + DatabricksEngineWrapper, + ) + + engine = MagicMock() + wrapper = DatabricksEngineWrapper(engine) + wrapper.first_catalog = None + assert wrapper.get_schemas(schema_name="my_schema") == ["my_schema"] + engine.connect.assert_not_called() + + +def test_get_tables_returns_empty_when_catalog_unresolved(): + from metadata.ingestion.source.database.databricks.connection import ( + DatabricksEngineWrapper, + ) + + engine = MagicMock() + wrapper = DatabricksEngineWrapper(engine) + wrapper.first_catalog = None + wrapper.first_schema = "my_schema" + assert wrapper.get_tables() == [] + engine.connect.assert_not_called() diff --git a/ingestion/tests/unit/topology/database/test_databricks.py b/ingestion/tests/unit/topology/database/test_databricks.py index cf0c6efd7d9d..86254b42b959 100644 --- a/ingestion/tests/unit/topology/database/test_databricks.py +++ b/ingestion/tests/unit/topology/database/test_databricks.py @@ -586,7 +586,7 @@ def test_databricks_engine_wrapper_get_tables_with_cached_schema(self): # Mock the connection execute method to return a result mock_result = Mock() - mock_result.fetchall.return_value = [("table1",), ("table2",)] + mock_result.fetchmany.return_value = [("table1",), ("table2",)] mock_connection.execute.return_value = mock_result mock_inspector = Mock() @@ -606,7 +606,7 @@ def test_databricks_engine_wrapper_get_tables_with_cached_schema(self): # Then call get_tables tables = wrapper.get_tables() - self.assertEqual(tables, mock_result) + self.assertEqual(tables, [("table1",), ("table2",)]) mock_connection.execute.assert_called_once() def test_databricks_engine_wrapper_get_tables_without_cached_schema(self): @@ -620,7 +620,7 @@ def test_databricks_engine_wrapper_get_tables_without_cached_schema(self): # Mock the connection execute method to return a result mock_result = Mock() - mock_result.fetchall.return_value = [("table1",), ("table2",)] + mock_result.fetchmany.return_value = [("table1",), ("table2",)] mock_connection.execute.return_value = mock_result mock_inspector = Mock() @@ -638,7 +638,7 @@ def test_databricks_engine_wrapper_get_tables_without_cached_schema(self): # Call get_tables directly without calling get_schemas first tables = wrapper.get_tables() - self.assertEqual(tables, mock_result) + self.assertEqual(tables, [("table1",), ("table2",)]) # Should have called get_schemas internally mock_inspector.get_schema_names.assert_called_once() mock_connection.execute.assert_called_once() @@ -669,7 +669,7 @@ def test_databricks_engine_wrapper_get_views_with_cached_schema(self): # Mock the connection execute method to return a result mock_result = Mock() - mock_result.fetchall.return_value = [("view1",), ("view2",)] + mock_result.fetchmany.return_value = [("view1",), ("view2",)] mock_connection.execute.return_value = mock_result mock_inspector = Mock() @@ -689,7 +689,7 @@ def test_databricks_engine_wrapper_get_views_with_cached_schema(self): # Then call get_views views = wrapper.get_views() - self.assertEqual(views, mock_result) + self.assertEqual(views, [("view1",), ("view2",)]) mock_connection.execute.assert_called_once() def test_databricks_engine_wrapper_get_views_without_cached_schema(self): @@ -703,7 +703,7 @@ def test_databricks_engine_wrapper_get_views_without_cached_schema(self): # Mock the connection execute method to return a result mock_result = Mock() - mock_result.fetchall.return_value = [("view1",), ("view2",)] + mock_result.fetchmany.return_value = [("view1",), ("view2",)] mock_connection.execute.return_value = mock_result mock_inspector = Mock() @@ -721,7 +721,7 @@ def test_databricks_engine_wrapper_get_views_without_cached_schema(self): # Call get_views directly without calling get_schemas first views = wrapper.get_views() - self.assertEqual(views, mock_result) + self.assertEqual(views, [("view1",), ("view2",)]) # Should have called get_schemas internally mock_inspector.get_schema_names.assert_called_once() mock_connection.execute.assert_called_once() @@ -767,100 +767,6 @@ def test_databricks_engine_wrapper_caching_behavior(self): # get_schema_names should only be called once due to caching mock_inspector.get_schema_names.assert_called_once() - # pylint: disable=too-many-locals - @patch("metadata.ingestion.source.database.databricks.connection.DatabricksEngineWrapper") - @patch("metadata.ingestion.source.database.databricks.connection.test_connection_steps") - def test_test_connection_function(self, mock_test_connection_steps, mock_engine_wrapper_class): - """Test the test_connection function""" - from metadata.generated.schema.entity.services.connections.database.databricksConnection import ( - DatabricksConnection, - DatabricksScheme, - ) - from metadata.generated.schema.entity.services.connections.testConnectionResult import ( - StatusType, - TestConnectionResult, - TestConnectionStepResult, - ) - - # Mock the test connection result - mock_result = TestConnectionResult( - status=StatusType.Successful, - steps=[ - TestConnectionStepResult( - name="CheckAccess", - mandatory=True, - passed=True, - ), - TestConnectionStepResult( - name="GetSchemas", - mandatory=True, - passed=True, - ), - TestConnectionStepResult( - name="GetTables", - mandatory=True, - passed=True, - ), - TestConnectionStepResult( - name="GetViews", - mandatory=False, - passed=True, - ), - ], - ) - mock_test_connection_steps.return_value = mock_result - - # Create test connection - service_connection = DatabricksConnection( - scheme=DatabricksScheme.databricks, - hostPort="test-host:443", - authType=PersonalAccessToken(token="test-token"), - httpPath="/sql/1.0/warehouses/test", - queryHistoryTable="test_table", - ) - - # Mock the DatabricksEngineWrapper instance to avoid context manager error - mock_wrapper_instance = Mock() - mock_wrapper_instance.get_catalogs.return_value = ["main"] - mock_engine_wrapper_class.return_value = mock_wrapper_instance - - mock_engine = Mock() - mock_engine.connect.return_value = Mock() - mock_metadata = Mock() - - # Test the function - handler = self.DatabricksConnectionHandler(service_connection) - handler._client = mock_engine - result = handler.test_connection(metadata=mock_metadata) - - # Verify the result - self.assertEqual(result, mock_result) - mock_test_connection_steps.assert_called_once() - - # Verify the test_fn dictionary was created with the correct functions - call_args = mock_test_connection_steps.call_args - test_fn = call_args[1]["test_fn"] - - # Check that the test_fn contains the expected keys - expected_keys = [ - "CheckAccess", - "GetSchemas", - "GetTables", - "GetViews", - "GetDatabases", - "GetQueries", - "GetViewDefinitions", - "GetCatalogTags", - "GetSchemaTags", - "GetTableTags", - "GetColumnTags", - "GetTableLineage", - "GetColumnLineage", - ] - for key in expected_keys: - self.assertIn(key, test_fn) - self.assertIsNotNone(test_fn[key]) - def test_databricks_engine_wrapper_system_schema_filtering(self): """Test that system schemas are properly filtered out""" mock_engine = Mock() diff --git a/openmetadata-service/src/main/resources/json/data/testConnections/database/databricks.json b/openmetadata-service/src/main/resources/json/data/testConnections/database/databricks.json index ff8bf5c6335e..7efafcbe9749 100644 --- a/openmetadata-service/src/main/resources/json/data/testConnections/database/databricks.json +++ b/openmetadata-service/src/main/resources/json/data/testConnections/database/databricks.json @@ -8,6 +8,7 @@ "description": "Validate that we can properly reach the database and authenticate with the given credentials.", "errorMessage": "Failed to connect to databricks, please validate to token, http path & hostport", "shortCircuit": true, + "category": "ConnectionGate", "mandatory": true }, { From 49dfb99c63710c6dfeeb8974bd6bd913a676c6be Mon Sep 17 00:00:00 2001 From: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:21:33 +0530 Subject: [PATCH 009/165] refactor(ui): migrate LineageLayers, CanvasEdgeRenderer & LineageTable off MUI/AntD (#29803) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(ui): migrate LineageLayers, CanvasEdgeRenderer and LineageTable off MUI/AntD Continue the MUI/AntD -> ui-core-components (Untitled) migration for the lineage surfaces: - LineageLayers: MUI Popover + ToggleButtonGroup + styled -> PopoverTrigger + Popover + ButtonGroup/ButtonGroupItem, preserving the vertical icon+label toggles, tokens and every data-testid; delete the dead lineage-layers.less. - CanvasEdgeRenderer: fully remove the MUI Theme from the canvas draw chain (EdgeStyleUtils + useCanvasEdgeRenderer) via a local LineageEdgeColors type, sourced by a new useLineageEdgeColors hook that mirrors createMuiTheme's palette computation so edge colors stay identical (incl. brand customization). - LineageTable: AntD Card -> ui-core Card + header/body divs; keep the lineage-card classes and extend the fullscreen height rule to the new .lineage-card-body. ColumnsType stays (typed by the shared common Table). - Playwright: update layer-selection assertions from the removed Mui-selected class to react-aria's data-selected attribute. 91 Jest tests pass across the affected suites; UI checkstyle clean. Co-Authored-By: Claude Opus 4.8 (1M context) * fix(ui): resolve max-len lint error and iconLeading prop on LineageLayers - Split the LAYER_BUTTON_CLASSES string so no line exceeds the 200-char max-len rule (was failing UI Checkstyle lint-src). - Use the Button's iconLeading prop (correct name, with the FC cast) for the Layers trigger icon. Co-Authored-By: Claude Opus 4.8 (1M context) * fix(ui): invalidate edge-style cache when lineage colors change The edge-style cache key does not encode colors, so after the user updates the brand/custom theme the canvas could repaint stale strokes from cache hits. Clear the cache when the resolved color signature changes. Adds a test. Co-Authored-By: Claude Opus 4.8 (1M context) * style(ui): drop dead .ant-card-body selector from .lineage-card-table The impact table migrated off the AntD Card, so .lineage-card-table only matches the ui-core .lineage-card-body now. Addresses review feedback. Co-Authored-By: Claude Opus 4.8 (1M context) * feat(ui): add DraggableMenuItemV2 for react-aria table column menu TableV2 renders the column-visibility list inside a react-aria Dropdown.Menu, which only accepts MenuItem collection children. DraggableMenuItemV2 wraps a Dropdown.Item and wires react-dnd to real DOM nodes it renders (drag on the grip handle, drop + dragPreview on the row) so reorder works inside the menu. The AntD-based DraggableMenuItem stays for the legacy common Table. Co-Authored-By: Claude Opus 4.8 (1M context) * refactor(ui): migrate lineage flow-chart card + LineageTable to ui-core - Lineage.component: replace the AntD flow-chart Card with the ui-core Card (header + lineage-container body); the ReactFlow canvas height now comes from .lineage-card / .lineage-container rules instead of .ant-card-body, so the dead .ant-card-body selectors are dropped from entity-lineage.style.less (resolves the remaining review comment). - LineageTable: render via TableV2 inside a ui-core Card. - TableV2: column-visibility list uses a react-aria Dropdown.Menu with DraggableMenuItemV2. - useLineageEdgeColors: read brand colors from the UntitledUI theme context. - Tests: mock useLineageEdgeColors in Lineage.test; assert the TableV2 loader and table element in LineageTable.test. Co-Authored-By: Claude Opus 4.8 (1M context) * fix(ui): correct lineage header useMemo deps and apply prettier formatting - Lineage.component: the header useMemo listed [entity, entityType, isPlatformLineage] but its body reads isEditMode, platformHeader, showControls, deleted and hasEditAccess — so the lineage-header-edit-mode class went stale on edit-mode toggle. Fix the dependency array. (review feedback) - Apply prettier single-quote formatting to the lineage card migration files that a prior malformed prettier invocation missed (fixes UI Checkstyle). Co-Authored-By: Claude Opus 4.8 (1M context) * test(ui): fix impact-analysis selectors for react-aria TableV2 The impact table migrated to the react-aria TableV2, whose DOM differs from the old AntD table: the first column is role="rowheader" (holds the entity link), other cells are role="gridcell", and headers are react-aria columnheaders. Update the impact-analysis Playwright selectors accordingly (verified against the running app): - source/impacted column value cells: getByRole('cell') -> getByRole('gridcell') - first-column entity link: getByRole('cell').first() -> locator('td').first() - column-level header check: getByRole('columnheader', {exact}) -> locator('thead th').filter (matches the already-passing table-columns test) Co-Authored-By: Claude Opus 4.8 (1M context) * refactor(ui): address review feedback on DraggableMenuItemV2 / TableV2 - Box: forward ref to the underlying div so it can host react-dnd (and other DOM-ref) consumers. - DraggableMenuItemV2: use Box for the row layout (drop/dragPreview ref now on Box); drop redundant Typography as="span"/text-sm defaults. - TableV2: drop redundant Typography size="text-sm" default on the column dropdown header. Co-Authored-By: Claude Opus 4.8 (1M context) --------- Co-authored-by: Claude Opus 4.8 (1M context) --- .../ui/src/components/base/box/box.tsx | 33 ++- .../e2e/Features/ImpactAnalysis.spec.ts | 17 +- .../e2e/Flow/PlatformLineage.spec.ts | 2 +- .../Pages/Lineage/DataAssetLineage.spec.ts | 4 +- .../e2e/Pages/Lineage/LineageControls.spec.ts | 8 +- .../Pages/Lineage/LineageInteraction.spec.ts | 4 +- .../e2e/Pages/Lineage/PlatformLineage.spec.ts | 12 +- .../resources/ui/playwright/utils/lineage.ts | 6 +- .../CanvasEdgeRenderer.component.test.tsx | 21 +- .../CanvasEdgeRenderer.component.tsx | 6 +- .../LineageLayers/LineageLayers.tsx | 267 ++++++++---------- .../LineageLayers/lineage-layers.less | 41 --- .../EntityLineage/entity-lineage.style.less | 50 ++-- .../components/Lineage/Lineage.component.tsx | 193 +++++++------ .../src/components/Lineage/Lineage.test.tsx | 8 + .../LineageTable/LineageTable.test.tsx | 8 +- .../components/LineageTable/LineageTable.tsx | 62 ++-- .../DraggableMenuItemV2.component.tsx | 110 ++++++++ .../DraggableMenuItemV2.test.tsx | 110 ++++++++ .../src/components/common/Table/TableV2.tsx | 66 +++-- .../src/hooks/useCanvasEdgeRenderer.test.ts | 39 ++- .../ui/src/hooks/useCanvasEdgeRenderer.ts | 13 +- .../ui/src/hooks/useLineageEdgeColors.ts | 35 +++ .../ui/src/utils/EdgeStyleUtils.test.ts | 128 +++++---- .../resources/ui/src/utils/EdgeStyleUtils.ts | 35 ++- 25 files changed, 744 insertions(+), 534 deletions(-) delete mode 100644 openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageLayers/lineage-layers.less create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/common/Table/DraggableMenu/DraggableMenuItemV2.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/common/Table/DraggableMenu/DraggableMenuItemV2.test.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/hooks/useLineageEdgeColors.ts diff --git a/openmetadata-ui-core-components/src/main/resources/ui/src/components/base/box/box.tsx b/openmetadata-ui-core-components/src/main/resources/ui/src/components/base/box/box.tsx index 7c1869a099ca..9f124c0a5a41 100644 --- a/openmetadata-ui-core-components/src/main/resources/ui/src/components/base/box/box.tsx +++ b/openmetadata-ui-core-components/src/main/resources/ui/src/components/base/box/box.tsx @@ -16,6 +16,7 @@ import { rowGapClassMapping, } from '@/constants/tailwindClasses.constants'; import { cx } from '@/utils/cx'; +import { forwardRef } from 'react'; import type { HTMLAttributes, ReactNode } from 'react'; export type Direction = 'row' | 'col' | 'row-reverse' | 'col-reverse'; @@ -97,19 +98,22 @@ export interface BoxProps extends HTMLAttributes { children?: ReactNode; } -export const Box = ({ - direction, - align, - justify, - wrap, - gap, - rowGap, - colGap, - inline, - className, - children, - ...props -}: BoxProps) => { +export const Box = forwardRef(function Box( + { + direction, + align, + justify, + wrap, + gap, + rowGap, + colGap, + inline, + className, + children, + ...props + }, + ref +) { const gapClassName = gap === undefined ? undefined : gapClassMapping[gap]; const rowGapClassName = rowGap === undefined ? undefined : rowGapClassMapping[rowGap]; @@ -118,6 +122,7 @@ export const Box = ({ return (
); -}; +}); Box.displayName = 'Box'; diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ImpactAnalysis.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ImpactAnalysis.spec.ts index a173014232d8..6b20cb6dd0b9 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ImpactAnalysis.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ImpactAnalysis.spec.ts @@ -693,14 +693,14 @@ test.describe('Impact Analysis', () => { await expect( page .locator(`[data-row-key="${col.rowKey}"]`) - .getByRole('cell', { name: col.sourceColumn }) + .getByRole('gridcell', { name: col.sourceColumn }) ).toBeVisible(); // assert target column await expect( page .locator(`[data-row-key="${col.rowKey}"]`) - .getByRole('cell', { name: col.targetColumn }) + .getByRole('gridcell', { name: col.targetColumn }) ).toBeVisible(); } }); @@ -783,14 +783,14 @@ test.describe('Impact Analysis', () => { await expect( page .locator(`[data-row-key="${col.rowKey}"]`) - .getByRole('cell', { name: col.sourceColumn }) + .getByRole('gridcell', { name: col.sourceColumn }) ).toBeVisible(); // assert target column await expect( page .locator(`[data-row-key="${col.rowKey}"]`) - .getByRole('cell', { name: col.targetColumn }) + .getByRole('gridcell', { name: col.targetColumn }) ).toBeVisible(); } }); @@ -806,7 +806,7 @@ test.describe('Impact Analysis', () => { const firstAssetLink = lineageCardTable .locator('tbody tr') .first() - .getByRole('cell') + .locator('td') .first() .getByRole('link'); @@ -1111,10 +1111,9 @@ test.describe('Impact Analysis', () => { ]; for (const columnName of expectedColumns) { - const columnHeader = page.getByRole('columnheader', { - name: columnName, - exact: true, - }); + const columnHeader = page + .locator('thead th') + .filter({ hasText: new RegExp(`^${columnName}$`) }); await expect(columnHeader).toBeVisible(); } }); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PlatformLineage.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PlatformLineage.spec.ts index 414e26727068..db41253a5ff9 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PlatformLineage.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PlatformLineage.spec.ts @@ -61,7 +61,7 @@ test('Verify Platform Lineage View', async ({ page }) => { await page.getByTestId('lineage-layer-btn').click(); await page - .locator('[data-testid="lineage-layer-domain-btn"]:not(.MUI-selected)') + .locator('[data-testid="lineage-layer-domain-btn"]:not([data-selected])') .waitFor(); const domainRes = page.waitForResponse( diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/DataAssetLineage.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/DataAssetLineage.spec.ts index c06a99d0496b..14919bae3fc3 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/DataAssetLineage.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/DataAssetLineage.spec.ts @@ -377,7 +377,7 @@ test.describe('Column Level Lineage', () => { await test.step('Verify column layer is inactive initially', async () => { await page.click('[data-testid="lineage-layer-btn"]'); - await expect(columnLayerBtn).not.toHaveClass(/Mui-selected/); + await expect(columnLayerBtn).not.toHaveAttribute('data-selected'); await clickOutside(page); }); @@ -387,7 +387,7 @@ test.describe('Column Level Lineage', () => { await page.click('[data-testid="lineage-layer-btn"]'); - await expect(columnLayerBtn).toHaveClass(/Mui-selected/); + await expect(columnLayerBtn).toHaveAttribute('data-selected'); await clickOutside(page); }); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageControls.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageControls.spec.ts index 7b115606e0f9..1aabace2b6c4 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageControls.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageControls.spec.ts @@ -187,13 +187,13 @@ test.describe('Lineage Layers', PLAYWRIGHT_BASIC_TEST_TAG_OBJ, () => { ); await expect(observabilityBtn).toBeVisible(); - await expect(observabilityBtn).not.toHaveClass(/Mui-selected/); + await expect(observabilityBtn).not.toHaveAttribute('data-selected'); await observabilityBtn.click(); await page.keyboard.press('Escape'); await page.getByTestId('lineage-layer-btn').click(); - await expect(observabilityBtn).toHaveClass(/Mui-selected/); + await expect(observabilityBtn).toHaveAttribute('data-selected'); }); test('Verify DQ layer toggle off removes highlights', async ({ page }) => { @@ -207,13 +207,13 @@ test.describe('Lineage Layers', PLAYWRIGHT_BASIC_TEST_TAG_OBJ, () => { await page.keyboard.press('Escape'); await page.getByTestId('lineage-layer-btn').click(); - await expect(observabilityBtn).toHaveClass(/Mui-selected/); + await expect(observabilityBtn).toHaveAttribute('data-selected'); await observabilityBtn.click(); await page.keyboard.press('Escape'); await page.getByTestId('lineage-layer-btn').click(); - await expect(observabilityBtn).not.toHaveClass(/Mui-selected/); + await expect(observabilityBtn).not.toHaveAttribute('data-selected'); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageInteraction.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageInteraction.spec.ts index f2c655058ea4..7e50a9b2ce46 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageInteraction.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageInteraction.spec.ts @@ -132,8 +132,8 @@ test.describe('Lineage Interactions', PLAYWRIGHT_BASIC_TEST_TAG_OBJ, () => { await page.keyboard.press('Escape'); await page.getByTestId('lineage-layer-btn').click(); - await expect(columnBtn).toHaveClass(/Mui-selected/); - await expect(observabilityBtn).toHaveClass(/Mui-selected/); + await expect(columnBtn).toHaveAttribute('data-selected'); + await expect(observabilityBtn).toHaveAttribute('data-selected'); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/PlatformLineage.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/PlatformLineage.spec.ts index a9a7ea826170..a32c7515ccc0 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/PlatformLineage.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/PlatformLineage.spec.ts @@ -140,7 +140,7 @@ test( await page.keyboard.press('Escape'); await page.getByTestId('lineage-layer-btn').click(); - await expect(serviceBtn).toHaveClass(/Mui-selected/); + await expect(serviceBtn).toHaveAttribute('data-selected'); } ); @@ -157,7 +157,7 @@ test( await page.keyboard.press('Escape'); await page.getByTestId('lineage-layer-btn').click(); - await expect(domainBtn).toHaveClass(/Mui-selected/); + await expect(domainBtn).toHaveAttribute('data-selected'); await page.keyboard.press('Escape'); @@ -178,14 +178,14 @@ test( await page.keyboard.press('Escape'); await page.getByTestId('lineage-layer-btn').click(); - await expect(serviceBtn).toHaveClass(/Mui-selected/); - await expect(domainBtn).not.toHaveClass(/Mui-selected/); + await expect(serviceBtn).toHaveAttribute('data-selected'); + await expect(domainBtn).not.toHaveAttribute('data-selected'); await domainBtn.click(); await page.keyboard.press('Escape'); await page.getByTestId('lineage-layer-btn').click(); - await expect(domainBtn).toHaveClass(/Mui-selected/); - await expect(serviceBtn).not.toHaveClass(/Mui-selected/); + await expect(domainBtn).toHaveAttribute('data-selected'); + await expect(serviceBtn).not.toHaveAttribute('data-selected'); } ); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts index 54ec36465577..470657160be6 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts @@ -91,7 +91,7 @@ export type LineageEdge = { export const verifyColumnLayerInactive = async (page: Page) => { await page.getByTestId('lineage-layer-btn').click(); // Open Layer popover await page - .locator('[data-testid="lineage-layer-column-btn"]:not(.Mui-selected)') + .locator('[data-testid="lineage-layer-column-btn"]:not([data-selected])') .waitFor(); await clickOutside(page); // close Layer popover }; @@ -101,7 +101,7 @@ export const activateColumnLayer = async (page: Page) => { const isColumnLayerSelected = await page .locator('[data-testid="lineage-layer-column-btn"]') - .evaluate((el) => el.classList.contains('Mui-selected')); + .evaluate((el) => el.hasAttribute('data-selected')); if (isColumnLayerSelected) { await clickOutside(page); @@ -738,7 +738,7 @@ export const fillLineageConfigForm = async ( export const verifyColumnLayerActive = async (page: Page) => { await page.click('[data-testid="lineage-layer-btn"]'); // Open Layer popover await page - .locator('[data-testid="lineage-layer-column-btn"].Mui-selected') + .locator('[data-testid="lineage-layer-column-btn"][data-selected]') .waitFor(); await clickOutside(page); // Close Layer popover }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.test.tsx index f872efb74d51..b9a1d2daa358 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.test.tsx @@ -10,7 +10,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useTheme } from '@mui/material'; import { fireEvent, render, waitFor } from '@testing-library/react'; import { Edge } from 'reactflow'; import { CanvasEdgeRenderer } from './CanvasEdgeRenderer.component'; @@ -48,11 +47,6 @@ const mockUseReactFlow = { const mockViewport = { x: 0, y: 0, zoom: 1 }; -jest.mock('@mui/material', () => ({ - ...jest.requireActual('@mui/material'), - useTheme: jest.fn(), -})); - jest.mock('reactflow', () => ({ ...jest.requireActual('reactflow'), useReactFlow: () => mockUseReactFlow, @@ -71,6 +65,14 @@ jest.mock('../../../hooks/useLineageStore', () => ({ useLineageStore: () => mockUseLineageStore, })); +jest.mock('../../../hooks/useLineageEdgeColors', () => ({ + useLineageEdgeColors: () => ({ + primary: '#1890ff', + columnHighlight: '#3F51B5', + dqHighlight: '#F44336', + }), +})); + jest.mock('../../../utils/EdgeStyleUtils', () => ({ clearEdgeStyleCache: jest.fn(), })); @@ -83,19 +85,12 @@ jest.mock('../../../utils/EdgeMidpointUtils', () => ({ calculateEdgeMidpoints: jest.fn(() => []), })); -const mockTheme = { - palette: { - primary: { main: '#1890ff' }, - }, -}; - describe('CanvasEdgeRenderer', () => { let reactFlowContainer: HTMLElement; let pane: HTMLElement; beforeEach(() => { jest.clearAllMocks(); - (useTheme as jest.Mock).mockReturnValue(mockTheme); mockUseLineageStore.isEditMode = false; mockGetEdgeAtPoint.mockReturnValue(null); mockRedraw.mockClear(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.tsx index 8768cc69daa2..396ab9ad5c2f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.tsx @@ -10,12 +10,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useTheme } from '@mui/material'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import { Edge, useReactFlow, useViewport } from 'reactflow'; import { useLineageProvider } from '../../../context/LineageProvider/LineageProvider'; import { useCanvasEdgeRenderer } from '../../../hooks/useCanvasEdgeRenderer'; import { useCanvasMouseEvents } from '../../../hooks/useCanvasMouseEvents'; +import { useLineageEdgeColors } from '../../../hooks/useLineageEdgeColors'; import { useLineageStore } from '../../../hooks/useLineageStore'; import { ECanvasButtonType } from '../../../utils/CanvasButtonUtils'; import { calculateEdgeMidpoints } from '../../../utils/EdgeMidpointUtils'; @@ -37,7 +37,7 @@ export const CanvasEdgeRenderer: React.FC = ({ onEdgeHover, hoverEdge, }) => { - const theme = useTheme(); + const edgeColors = useLineageEdgeColors(); const canvasRef = useRef(null); const containerRef = useRef(null); const [containerSize, setContainerSize] = useState({ width: 0, height: 0 }); @@ -103,7 +103,7 @@ export const CanvasEdgeRenderer: React.FC = ({ canvasRef, edges, dqHighlightedEdges, - theme, + colors: edgeColors, hoverEdge, containerWidth: containerSize.width, containerHeight: containerSize.height, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageLayers/LineageLayers.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageLayers/LineageLayers.tsx index 4fbbdb0c4dbc..c0287dc6256b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageLayers/LineageLayers.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageLayers/LineageLayers.tsx @@ -11,15 +11,16 @@ * limitations under the License. */ import { + Button, + ButtonGroup, + ButtonGroupItem, Popover, - styled, - ToggleButton, - ToggleButtonGroup, - ToggleButtonProps, -} from '@mui/material'; + PopoverTrigger, +} from '@openmetadata/ui-core-components'; import classNames from 'classnames'; import { isEmpty, xor } from 'lodash'; -import React from 'react'; +import React, { FC, useMemo, useState } from 'react'; +import type { Selection } from 'react-aria-components'; import { useTranslation } from 'react-i18next'; import { ReactComponent as DataQualityIcon } from '../../../../assets/svg/ic-data-contract.svg'; import { ReactComponent as DataProductIcon } from '../../../../assets/svg/ic-data-product.svg'; @@ -34,61 +35,13 @@ import { Table } from '../../../../generated/entity/data/table'; import { LineageLayer } from '../../../../generated/settings/settings'; import { useLineageStore } from '../../../../hooks/useLineageStore'; import { AssetsUnion } from '../../../DataAssets/AssetsSelectionModal/AssetSelectionModal.interface'; -import './lineage-layers.less'; import { LineageLayersProps } from './LineageLayers.interface'; -const StyledButton = styled((props: ToggleButtonProps) => ( - -))(({ theme }) => ({ - display: 'inline-flex', - flexDirection: 'column', - alignItems: 'center', - gap: '4px', - backgroundColor: theme.palette.allShades.white, - fontSize: theme.typography.pxToRem(10), - color: theme.palette.text.primary, - wordBreak: 'break-word', - padding: '8px 16px', - - svg: { - height: 20, - }, - - '&:hover': { - border: '1px solid', - borderColor: theme.palette.primary.main + ' !important', - // To show all the border on hover - zIndex: 1, - margin: '0', - backgroundColor: theme.palette.allShades.white, - - svg: { - color: theme.palette.primary.main, - }, - }, - - '&.Mui-selected': { - backgroundColor: theme.palette.allShades.brand[100], - - '&:hover': { - border: '1px solid' + ' ' + theme.palette.primary.main, - backgroundColor: theme.palette.allShades.brand[100], - }, - }, - - '&.highlight': { - border: '1px solid', - borderColor: theme.palette.primary.main + ' !important', - // To show all the border on hover - zIndex: 1, - margin: '0', - backgroundColor: theme.palette.allShades.white, - - svg: { - color: theme.palette.primary.main, - }, - }, -})); +const LAYER_BUTTON_CLASSES = [ + 'tw:flex-col tw:gap-1 tw:px-4 tw:py-2 tw:text-[10px] tw:font-medium tw:text-primary', + 'tw:whitespace-normal tw:break-words tw:hover:ring-brand tw:hover:z-10', + 'tw:selected:bg-brand-primary tw:selected:text-primary', +].join(' '); const LineageLayers = ({ entityType, entity }: LineageLayersProps) => { const { @@ -99,31 +52,21 @@ const LineageLayers = ({ entityType, entity }: LineageLayersProps) => { setActiveLayer, } = useLineageStore(); const { t } = useTranslation(); - const [layersAnchorEl, setLayersAnchorEl] = - React.useState(null); - const selectedValues = [...activeLayer, platformView]; + const [isLayersOpen, setIsLayersOpen] = useState(false); const handleLayerClick = React.useCallback( - ( - _event: React.MouseEvent, - layer: LineageLayer - ) => { - const value = layer; - const index = activeLayer.indexOf(value); - if (index === -1) { - setActiveLayer([...activeLayer, value]); + (layer: LineageLayer) => { + if (activeLayer.indexOf(layer) === -1) { + setActiveLayer([...activeLayer, layer]); } else { - setActiveLayer(activeLayer.filter((layer) => layer !== value)); + setActiveLayer(activeLayer.filter((value) => value !== layer)); } }, [activeLayer, setActiveLayer] ); const handlePlatformViewChange = React.useCallback( - ( - _event: React.MouseEvent, - view: string | null - ) => { + (view: string) => { setPlatformView( platformView === view ? LineagePlatformView.None @@ -133,23 +76,6 @@ const LineageLayers = ({ entityType, entity }: LineageLayersProps) => { [platformView, setPlatformView] ); - const handleSelection = ( - _event: React.MouseEvent, - newSelection: (LineageLayer | LineagePlatformView)[] - ) => { - const newlyAddedValue = xor(selectedValues, newSelection); - - if ( - Object.values(LineagePlatformView).includes( - newlyAddedValue[0] as LineagePlatformView - ) - ) { - handlePlatformViewChange(_event, newlyAddedValue[0]); - } else { - handleLayerClick(_event, newlyAddedValue[0] as LineageLayer); - } - }; - const isServiceType = SERVICE_TYPES.includes(entityType as AssetsUnion); const showColumnAndObservability = entityType && !isServiceType; const showService = isPlatformLineage || !isServiceType; @@ -164,107 +90,134 @@ const LineageLayers = ({ entityType, entity }: LineageLayersProps) => { entityType !== EntityType.DOMAIN && ((entity as Table)?.dataProducts ?? []).length > 0); - const buttonContent = React.useMemo(() => { + const { layerButtons, renderedValues } = useMemo(() => { const buttons = []; + const values: string[] = []; if (showColumnAndObservability) { - buttons.push([ - - + id={LineageLayer.ColumnLevelLineage} + key={LineageLayer.ColumnLevelLineage}> + {t('label.column')} - , - , + - + id={LineageLayer.DataObservability} + key={LineageLayer.DataObservability}> + {t('label.observability')} - , - ]); + + ); } if (showService) { + values.push(LineagePlatformView.Service); buttons.push( - - + id={LineagePlatformView.Service} + key={LineagePlatformView.Service}> + {t('label.service')} - + ); } if (showDomain) { + values.push(LineagePlatformView.Domain); buttons.push( - - + id={LineagePlatformView.Domain} + key={LineagePlatformView.Domain}> + {t('label.domain')} - + ); } if (showDataProduct) { + values.push(LineagePlatformView.DataProduct); buttons.push( - - + id={LineagePlatformView.DataProduct} + key={LineagePlatformView.DataProduct}> + {t('label.data-product')} - + ); } - return ( - - {buttons} - - ); - }, [ - selectedValues, - activeLayer, - platformView, - handleSelection, - showColumnAndObservability, - showService, - showDomain, - showDataProduct, - ]); + return { layerButtons: buttons, renderedValues: values }; + }, [t, showColumnAndObservability, showService, showDomain, showDataProduct]); + + const selectedKeys = useMemo( + () => + new Set( + [...activeLayer, platformView].filter((value) => + renderedValues.includes(value as string) + ) + ), + [activeLayer, platformView, renderedValues] + ); + + const handleSelectionChange = React.useCallback( + (keys: Selection) => { + const nextSelection = [...(keys as Set)]; + const [changed] = xor([...selectedKeys], nextSelection); + + if (changed) { + if ( + Object.values(LineagePlatformView).includes( + changed as LineagePlatformView + ) + ) { + handlePlatformViewChange(changed); + } else { + handleLayerClick(changed as LineageLayer); + } + } + }, + [selectedKeys, handlePlatformViewChange, handleLayerClick] + ); return ( - <> - + + + + {layerButtons} + - + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageLayers/lineage-layers.less b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageLayers/lineage-layers.less deleted file mode 100644 index 65abbd381f42..000000000000 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageLayers/lineage-layers.less +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2024 Collate. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@import (reference) '../../../../styles/variables.less'; - -.lineage-layers-popover { - &.ant-popover-placement-right { - padding-left: 8px; - } - - .ant-popover-arrow { - display: none; - } - .ant-popover-inner-content { - padding: 0; - } - .lineage-layer-button { - padding: 4px 12px; - width: 90px; - &.active { - color: @primary-color; - border-color: @primary-color; - z-index: 2; - background-color: @radio-button-checked-bg; - } - } - .layer-icon { - width: 20px; - height: 20px; - } -} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/entity-lineage.style.less b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/entity-lineage.style.less index 0627caeae7f1..43112805d97a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/entity-lineage.style.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/entity-lineage.style.less @@ -15,7 +15,6 @@ @lineage-breadcrumb-panel: 50px; @lineage-toolbar-height: 12px; -@lineage-card-header-height: 74px; // Card header in Flow Chart .custom-react-flow { .react-flow__node-input.selectable.selected { @@ -151,6 +150,21 @@ box-shadow: none; } } + + // 20px bottom spacing + height: calc(@asset-details-tab-pane-height - 20px); + + .lineage-container { + height: calc(100% - 69px); + overflow-y: auto; + } + + // lineage and it's children's always should be ltr + direction: ltr; + + * { + direction: ltr; + } } .lineage-header-edit-mode { @@ -271,27 +285,6 @@ } } -// lineage -.lineage-card { - .ant-card-body { - height: calc( - @asset-details-tab-pane-height - @lineage-card-header-height - ); // 280 for DataAsset header - } - - // lineage and it's children's always should be ltr - direction: ltr; - - * { - direction: ltr; - } -} -.lineage-card-table { - .ant-card-body { - height: auto; - } -} - .full-screen-lineage { position: fixed; top: @om-navbar-height; @@ -309,22 +302,15 @@ } .lineage-card { - .ant-card-body { - // Navbar - breadcrumb - height: calc(100vh - @om-navbar-height - 140px); - // 120px for card header and breadcrumb + bottom padding 20px - overflow-y: auto; - } + // Navbar - breadcrumb - bottom spacing + height: calc(100vh - @om-navbar-height - 36px - 20px); + overflow-y: auto; } .entity-panel-container { top: calc(@lineage-breadcrumb-panel + @lineage-toolbar-height); margin-top: 0; } - - .lineage-container { - height: 100%; - } } .lineage-node-remove-btn { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.component.tsx index d1dcd17b1f57..e18394f9d481 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.component.tsx @@ -10,7 +10,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Card } from 'antd'; + +import { Card } from '@openmetadata/ui-core-components'; import classNames from 'classnames'; import { DragEvent, @@ -140,100 +141,110 @@ const Lineage = ({ [dqHighlightedEdges, isDQEnabled] ); + const header = useMemo(() => { + if (isPlatformLineage) { + return platformHeader; + } + + return showControls ? ( +
+ +
+ ) : undefined; + }, [ + isPlatformLineage, + platformHeader, + showControls, + isEditMode, + deleted, + hasEditAccess, + ]); + // Loading the react flow component after the nodes and edges are initialised improves performance // considerably. So added an init state for showing loader. return ( - - -
- ) : undefined - }> - { -
- {init ? ( - - - - {showMiniMap && ( - - )} - - {/* Canvas based edge rendering to prevent DOM from becoming heavy */} - +
+ {header} +
+ +
+ {init ? ( + + + + {showMiniMap && ( + + )} + + {/* Canvas based edge rendering to prevent DOM from becoming heavy */} + + + {/* Render lineage layer to */} + + + + {/* Lineage control buttons */} + + - - {/* Render lineage layer to */} - - - - {/* Lineage control buttons */} - - - - - - ) : ( - - )} -
- } + +
+
+ ) : ( + + )} +
); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.test.tsx index e3211095a863..6c5c56c65bd6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.test.tsx @@ -197,6 +197,14 @@ jest.mock('./LineageSkeleton.component', () => ({ )), })); +jest.mock('../../hooks/useLineageEdgeColors', () => ({ + useLineageEdgeColors: () => ({ + primary: '#1570ef', + columnHighlight: '#444ce7', + dqHighlight: '#d92d20', + }), +})); + jest.mock('reactflow', () => ({ __esModule: true, default: jest.fn( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/LineageTable/LineageTable.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/LineageTable/LineageTable.test.tsx index dc0f40f08953..77ae699770d2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/LineageTable/LineageTable.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/LineageTable/LineageTable.test.tsx @@ -486,9 +486,7 @@ describe('LineageTable', () => { render(, { wrapper: MemoryRouter }); - const table = document.querySelector('.ant-spin-container'); - - expect(table).toBeInTheDocument(); + expect(screen.getByTestId('loader')).toBeInTheDocument(); }); it('should handle error state when API calls fail', async () => { @@ -540,9 +538,7 @@ describe('LineageTable', () => { it('should render table with pagination props', () => { render(, { wrapper: MemoryRouter }); - const table = document.querySelector('.ant-table'); - - expect(table).toBeInTheDocument(); + expect(document.querySelector('table')).toBeInTheDocument(); }); describe('LineageTable Hooks Integration', () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/LineageTable/LineageTable.tsx b/openmetadata-ui/src/main/resources/ui/src/components/LineageTable/LineageTable.tsx index 896782bab2e1..168460b87780 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/LineageTable/LineageTable.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/LineageTable/LineageTable.tsx @@ -15,10 +15,10 @@ import { Button, ButtonGroup, ButtonGroupItem, + Card, Dropdown, } from '@openmetadata/ui-core-components'; import { ColumnsType } from 'antd/es/table'; -import Card from 'antd/lib/card/Card'; import { AxiosError } from 'axios'; import classNames from 'classnames'; import { isEmpty, map, sortBy } from 'lodash'; @@ -79,7 +79,7 @@ import NoDataPlaceholder from '../common/ErrorWithPlaceholder/NoDataPlaceholder' import { PagingHandlerParams } from '../common/NextPrevious/NextPrevious.interface'; import { OwnerLabel } from '../common/OwnerLabel/OwnerLabel.component'; import EntityPopOverCard from '../common/PopOverCard/EntityPopOverCard'; -import Table from '../common/Table/Table'; +import TableV2 from '../common/Table/TableV2'; import TierTag from '../common/TierTag'; import TableTags from '../Database/TableTags/TableTags.component'; import CustomControlsComponent from '../Entity/EntityLineage/CustomControls.component'; @@ -94,6 +94,7 @@ import { } from '../SearchedData/SearchedData.interface'; import { EImpactLevel } from './LineageTable.interface'; import { useLineageTableState } from './useLineageTableState'; + const LineageTable: FC<{ entity: SourceType }> = ({ entity }) => { const { selectedQuickFilters, setSelectedQuickFilters, updateEntityData } = useLineageProvider(); @@ -944,34 +945,37 @@ const LineageTable: FC<{ entity: SourceType }> = ({ entity }) => { return ( - , - }} - pagination={false} - rowKey={ - impactLevel === EImpactLevel.TableLevel - ? 'fullyQualifiedName' - : 'docId' - } - staticVisibleColumns={IMPACT_ANALYSIS_STATIC_COLUMNS} - /> + variant="default"> +
+ {cardHeader} +
+ + + , + }} + pagination={false} + rowKey={ + impactLevel === EImpactLevel.TableLevel + ? 'fullyQualifiedName' + : 'docId' + } + staticVisibleColumns={IMPACT_ANALYSIS_STATIC_COLUMNS} + /> + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/Table/DraggableMenu/DraggableMenuItemV2.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/Table/DraggableMenu/DraggableMenuItemV2.component.tsx new file mode 100644 index 000000000000..3bd8dcbbb9a2 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/Table/DraggableMenu/DraggableMenuItemV2.component.tsx @@ -0,0 +1,110 @@ +/* + * Copyright 2024 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Box, Dropdown, Typography } from '@openmetadata/ui-core-components'; +import { Eye, EyeOff } from '@untitledui/icons'; +import classNames from 'classnames'; +import { FC, useCallback, useMemo } from 'react'; +import { useDrag, useDrop } from 'react-dnd'; +import { ReactComponent as ColumnDragIcon } from '../../../../assets/svg/menu-duo.svg'; +import { DraggableMenuItemProps } from './DraggableMenuItem.interface'; + +/** + * react-aria (`Dropdown.Item`) flavour of the draggable column menu item, used + * inside `TableV2`'s react-aria `Dropdown.Menu`. react-dnd connectors are wired + * to real DOM nodes we render inside the menu item: `drag` on the grip handle + * (so the item's press handling doesn't swallow the native drag) and `drop` + + * `dragPreview` on the whole row. For the AntD `Table` use the sibling + * `DraggableMenuItem` component instead. + */ +const DraggableMenuItemV2: FC = ({ + currentItem, + index, + itemList, + selectedOptions, + onSelect, + onMoveItem, +}) => { + const { value, label } = currentItem; + const moveDropdownMenuItem = useCallback( + (fromIndex: number, toIndex: number) => { + const updatedList = [...itemList]; + const [movedItem] = updatedList.splice(fromIndex, 1); + updatedList.splice(toIndex, 0, movedItem); + onMoveItem(updatedList); + }, + [itemList, onMoveItem] + ); + + const [{ isDragging }, drag, dragPreview] = useDrag({ + type: 'CHECKBOX', + item: { index }, + collect: (monitor) => ({ + isDragging: monitor.isDragging(), + }), + }); + + const [, drop] = useDrop({ + accept: 'CHECKBOX', + hover: (draggedItem: { index: number }) => { + if (draggedItem.index !== index) { + moveDropdownMenuItem(draggedItem.index, index); + draggedItem.index = index; + } + }, + }); + + const isItemSelected = useMemo( + () => selectedOptions.includes(value), + [selectedOptions, value] + ); + + return ( + onSelect(value, !isItemSelected)}> + { + drop(dragPreview(node)); + }}> + + + + + {label} + + {isItemSelected ? ( + + ) : ( + + )} + + + ); +}; + +export default DraggableMenuItemV2; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/Table/DraggableMenu/DraggableMenuItemV2.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/Table/DraggableMenu/DraggableMenuItemV2.test.tsx new file mode 100644 index 000000000000..220b813b9237 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/Table/DraggableMenu/DraggableMenuItemV2.test.tsx @@ -0,0 +1,110 @@ +/* + * Copyright 2024 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Dropdown } from '@openmetadata/ui-core-components'; +import { fireEvent, render, screen } from '@testing-library/react'; +import { DndProvider } from 'react-dnd'; +import { HTML5Backend } from 'react-dnd-html5-backend'; +import DraggableMenuItemV2 from './DraggableMenuItemV2.component'; + +const mockOnSelect = jest.fn(); +const mockOnMoveItem = jest.fn(); + +const mockProps = { + currentItem: { label: 'Test Column', value: 'test' }, + index: 0, + itemList: [ + { label: 'Test Column', value: 'test' }, + { label: 'Another Column', value: 'another' }, + ], + selectedOptions: ['test'], + onSelect: mockOnSelect, + onMoveItem: mockOnMoveItem, +}; + +const renderComponent = (props = mockProps) => { + return render( + + + + + + ); +}; + +describe('DraggableMenuItemV2', () => { + it('should render the component', () => { + renderComponent(); + + expect(screen.getByText('Test Column')).toBeInTheDocument(); + }); + + it('should show eye icon when item is selected', () => { + renderComponent(); + + expect(screen.getByLabelText('eye')).toBeInTheDocument(); + }); + + it('should show eye-invisible icon when item is not selected', () => { + renderComponent({ + ...mockProps, + selectedOptions: [], + }); + + expect(screen.getByLabelText('eye-invisible')).toBeInTheDocument(); + }); + + it('should call onSelect with correct arguments when clicked', () => { + renderComponent(); + + fireEvent.click(screen.getByText('Test Column')); + + expect(mockOnSelect).toHaveBeenCalledWith('test', false); + }); + + it('should call onSelect with true when unselected item is clicked', () => { + renderComponent({ + ...mockProps, + selectedOptions: [], + }); + + fireEvent.click(screen.getByText('Test Column')); + + expect(mockOnSelect).toHaveBeenCalledWith('test', true); + }); + + it('should render inside a draggable-menu-item-v2 container', () => { + renderComponent(); + + const menuItem = screen + .getByText('Test Column') + .closest('.draggable-menu-item-v2'); + + expect(menuItem).toBeInTheDocument(); + }); + + it('should render the drag icon', () => { + renderComponent(); + + expect( + screen.getByTestId('draggable-menu-item-drag-icon') + ).toBeInTheDocument(); + }); + + it('should render a draggable grip handle', () => { + renderComponent(); + + expect( + screen.getByTestId('draggable-menu-item-drag-handle') + ).toBeInTheDocument(); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/Table/TableV2.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/Table/TableV2.tsx index 4f5c4d225e00..d15c3efd186b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/Table/TableV2.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/Table/TableV2.tsx @@ -38,6 +38,7 @@ import { Button, Dropdown, Table as UntitledTable, + Typography, } from '@openmetadata/ui-core-components'; import { ChevronDown, ChevronRight } from '@untitledui/icons'; import type { ColumnsType } from 'antd/es/table/interface'; @@ -79,7 +80,7 @@ import { useGenericContext } from '../../Customization/GenericProvider/GenericCo import Loader from '../Loader/Loader'; import NextPrevious from '../NextPrevious/NextPrevious'; import Searchbar from '../SearchBarComponent/SearchBar.component'; -import DraggableMenuItem from './DraggableMenu/DraggableMenuItem.component'; +import DraggableMenuItemV2 from './DraggableMenu/DraggableMenuItemV2.component'; import { TableColumnDropdownList, TableComponentProps, @@ -576,36 +577,39 @@ const TableV2 = ( {t('label.customize')} -
- - {t('label.column')} - - -
- {dropdownColumnList.map( - (item: TableColumnDropdownList, index: number) => ( - - ) - )} + + + + {t('label.column')} + + + + + + + {dropdownColumnList.map((item, index) => ( + + ))} + +
)} diff --git a/openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.test.ts b/openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.test.ts index c4de6346d042..80df1359176a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.test.ts @@ -10,10 +10,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Theme } from '@mui/material'; import { renderHook } from '@testing-library/react'; import { RefObject } from 'react'; import { Edge, Node } from 'reactflow'; +import { LineageEdgeColors } from '../utils/EdgeStyleUtils'; import { useCanvasEdgeRenderer } from './useCanvasEdgeRenderer'; const mockGetNode = jest.fn(); @@ -104,16 +104,11 @@ const createMockCanvas = () => { return { canvas, ctx }; }; -const createMockTheme = (): Theme => - ({ - palette: { - primary: { main: '#1890ff' }, - allShades: { - indigo: { 600: '#3F51B5' }, - error: { 600: '#F44336' }, - }, - }, - } as unknown as Theme); +const createMockColors = (): LineageEdgeColors => ({ + primary: '#1890ff', + columnHighlight: '#3F51B5', + dqHighlight: '#F44336', +}); const createMockEdge = (overrides: Partial = {}): Edge => ({ id: 'edge-1', @@ -168,7 +163,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -184,7 +179,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -216,7 +211,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [edge], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -236,7 +231,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [edge], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -264,7 +259,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [edge], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -306,7 +301,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [edge], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -344,7 +339,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [edge], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -393,7 +388,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [edge], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -448,7 +443,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [edge], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -466,7 +461,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) @@ -503,7 +498,7 @@ describe('useCanvasEdgeRenderer', () => { canvasRef, edges: [edge], dqHighlightedEdges: new Set(), - theme: createMockTheme(), + colors: createMockColors(), containerWidth: 800, containerHeight: 600, }) diff --git a/openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.ts b/openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.ts index eae94c12f479..190389a8498b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.ts +++ b/openmetadata-ui/src/main/resources/ui/src/hooks/useCanvasEdgeRenderer.ts @@ -10,7 +10,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Theme } from '@mui/material'; import { RefObject, useCallback, useEffect, useRef, useState } from 'react'; import type { Edge } from 'reactflow'; import { Position, useNodes, useReactFlow, useViewport } from 'reactflow'; @@ -28,7 +27,7 @@ import { isEdgeInViewport, setupCanvas, } from '../utils/CanvasUtils'; -import { computeEdgeStyle } from '../utils/EdgeStyleUtils'; +import { computeEdgeStyle, LineageEdgeColors } from '../utils/EdgeStyleUtils'; import { getEdgePathData } from '../utils/EntityLineageEdgeUtils'; import { getEntityName } from '../utils/EntityNameUtils'; import { useLineageStore } from './useLineageStore'; @@ -38,7 +37,7 @@ interface UseCanvasEdgeRendererProps { edges: Edge[]; hoverEdge?: Edge | null; dqHighlightedEdges: Set; - theme: Theme; + colors: LineageEdgeColors; containerWidth: number; containerHeight: number; } @@ -58,7 +57,7 @@ export function useCanvasEdgeRenderer({ dqHighlightedEdges, edges, hoverEdge, - theme, + colors, containerWidth, containerHeight, }: UseCanvasEdgeRendererProps) { @@ -156,7 +155,7 @@ export function useCanvasEdgeRenderer({ tracedColumns, dqHighlightedEdges, selectedColumn, - theme, + colors, edge.data?.isColumnLineage ?? false, edge.sourceHandle, edge.targetHandle, @@ -199,7 +198,7 @@ export function useCanvasEdgeRenderer({ tracedColumns, dqHighlightedEdges, selectedColumn, - theme, + colors, columnsInCurrentPages, hoverEdge, selectedEdge, @@ -453,7 +452,7 @@ export function useCanvasEdgeRenderer({ selectedEdge, selectedColumn, dqHighlightedEdges, - theme, + colors, ]); useEffect(() => { diff --git a/openmetadata-ui/src/main/resources/ui/src/hooks/useLineageEdgeColors.ts b/openmetadata-ui/src/main/resources/ui/src/hooks/useLineageEdgeColors.ts new file mode 100644 index 000000000000..25ead7d84b73 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/hooks/useLineageEdgeColors.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { useMemo } from 'react'; +import { useTheme } from '../context/UntitledUIThemeProvider/theme-provider'; +import { LineageEdgeColors } from '../utils/EdgeStyleUtils'; + +/** + * Resolves the literal colors used to paint lineage edges on the canvas. + * + * Mirrors the palette computation in `createMuiTheme` so the canvas keeps the + * exact same colors it had while reading them from the MUI theme, but without + * depending on MUI. The MUI theme is not dark-mode aware (dark mode is handled + * via CSS variables), so these values are intentionally the same in both modes. + */ +export const useLineageEdgeColors = (): LineageEdgeColors => { + const { brandColors } = useTheme(); + + return useMemo(() => { + return { + primary: brandColors?.primaryColor ?? '#1570ef', + columnHighlight: '#444ce7', // It's a replacement to indigo-600 not a theme color + dqHighlight: brandColors?.errorColor ?? '#d92d20', + }; + }, [brandColors]); +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EdgeStyleUtils.test.ts b/openmetadata-ui/src/main/resources/ui/src/utils/EdgeStyleUtils.test.ts index 1ee10b06058c..34be3931856c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EdgeStyleUtils.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EdgeStyleUtils.test.ts @@ -10,24 +10,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Theme } from '@mui/material'; import { Edge } from 'reactflow'; import { clearEdgeStyleCache, computeEdgeStyle, invalidateEdgeStyles, + LineageEdgeColors, } from './EdgeStyleUtils'; -const createMockTheme = (): Theme => - ({ - palette: { - primary: { main: '#1890ff' }, - allShades: { - indigo: { 600: '#3F51B5' }, - error: { 600: '#F44336' }, - }, - }, - } as unknown as Theme); +const createMockColors = (): LineageEdgeColors => ({ + primary: '#1890ff', + columnHighlight: '#3F51B5', + dqHighlight: '#F44336', +}); const createMockEdge = ( id: string, @@ -46,10 +41,10 @@ const createMockEdge = ( }); describe('EdgeStyleUtils', () => { - let theme: Theme; + let colors: LineageEdgeColors; beforeEach(() => { - theme = createMockTheme(); + colors = createMockColors(); clearEdgeStyleCache(); }); @@ -66,7 +61,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -89,11 +84,11 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); - expect(style.stroke).toBe(theme.palette.primary.main); + expect(style.stroke).toBe(colors.primary); expect(style.opacity).toBe(1); }); @@ -109,7 +104,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -128,13 +123,13 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, true, 'col1', 'col2' ); - expect(style.stroke).toBe(theme.palette.primary.main); + expect(style.stroke).toBe(colors.primary); expect(style.opacity).toBe(1); }); @@ -150,13 +145,13 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, 'col1', - theme, + colors, true, 'col1', 'col2' ); - expect(style.stroke).toBe(theme.palette.allShades.indigo[600]); + expect(style.stroke).toBe(colors.columnHighlight); }); it('highlights DQ edges with error color', () => { @@ -171,11 +166,11 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); - expect(style.stroke).toBe(theme.palette.allShades.error[600]); + expect(style.stroke).toBe(colors.dqHighlight); expect(style.opacity).toBe(1); }); @@ -191,14 +186,14 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false, undefined, undefined, true ); - expect(style.stroke).toBe(theme.palette.primary.main); + expect(style.stroke).toBe(colors.primary); }); it('caches edge styles', () => { @@ -213,7 +208,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -223,13 +218,48 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); expect(style1).toBe(style2); }); + it('recomputes cached styles when colors change', () => { + const edge = createMockEdge('edge1', 'entity1', 'entity2'); + const tracedNodes = new Set(['entity1', 'entity2']); + const tracedColumns = new Set(); + const dqHighlightedEdges = new Set(); + + const style1 = computeEdgeStyle( + edge, + tracedNodes, + tracedColumns, + dqHighlightedEdges, + undefined, + colors, + false + ); + + expect(style1.stroke).toBe(colors.primary); + + const updatedColors: LineageEdgeColors = { + ...colors, + primary: '#abcdef', + }; + const style2 = computeEdgeStyle( + edge, + tracedNodes, + tracedColumns, + dqHighlightedEdges, + undefined, + updatedColors, + false + ); + + expect(style2.stroke).toBe('#abcdef'); + }); + it('returns different styles for different cache keys', () => { const edge = createMockEdge('edge1', 'entity1', 'entity2'); const tracedNodes1 = new Set(); @@ -243,7 +273,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -253,7 +283,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -278,7 +308,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -298,7 +328,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, true, 'col1', 'col3' @@ -319,7 +349,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -338,11 +368,11 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); - expect(style.stroke).toBe(theme.palette.allShades.error[600]); + expect(style.stroke).toBe(colors.dqHighlight); }); it('maintains consistent strokeWidth', () => { @@ -357,7 +387,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -378,7 +408,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -390,7 +420,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -413,7 +443,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -423,7 +453,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -435,7 +465,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -445,7 +475,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -467,7 +497,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -477,7 +507,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -487,7 +517,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -499,7 +529,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -518,7 +548,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -530,7 +560,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -549,7 +579,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); @@ -561,7 +591,7 @@ describe('EdgeStyleUtils', () => { tracedColumns, dqHighlightedEdges, undefined, - theme, + colors, false ); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EdgeStyleUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/EdgeStyleUtils.ts index 7faff9666c72..dcf1d9f28ce9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EdgeStyleUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EdgeStyleUtils.ts @@ -10,7 +10,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Theme } from '@mui/material'; import type { Edge } from 'reactflow'; export interface EdgeStyle { @@ -19,7 +18,14 @@ export interface EdgeStyle { strokeWidth: number; } +export interface LineageEdgeColors { + primary: string; + columnHighlight: string; + dqHighlight: string; +} + const edgeStyleCache = new Map(); +let cachedColorSignature = ''; function calculateEdgeStyle( edge: Edge, @@ -27,32 +33,28 @@ function calculateEdgeStyle( hasTracedContext: boolean, dqHighlightedEdges: Set, selectedColumn: string | undefined, - theme: Theme, + colors: LineageEdgeColors, isColumnLineage: boolean, isColumnHighlighted: boolean, isEdgeHovered?: boolean ): EdgeStyle { - let stroke = isEdgeHovered - ? theme.palette.primary.main - : 'rgba(177, 177, 183)'; + let stroke = isEdgeHovered ? colors.primary : 'rgba(177, 177, 183)'; let opacity = 1; const strokeWidth = 2; if (isNodeTraced) { - stroke = theme.palette.primary.main; + stroke = colors.primary; } else if (hasTracedContext) { opacity = 0.3; } if (isColumnLineage && isColumnHighlighted) { - stroke = selectedColumn - ? theme.palette.allShades.indigo[600] - : theme.palette.primary.main; + stroke = selectedColumn ? colors.columnHighlight : colors.primary; opacity = 1; } if (dqHighlightedEdges.has(edge.id)) { - stroke = theme.palette.allShades.error[600]; + stroke = colors.dqHighlight; opacity = 1; } @@ -81,12 +83,21 @@ export function computeEdgeStyle( tracedColumns: Set, dqHighlightedEdges: Set, selectedColumn: string | undefined, - theme: Theme, + colors: LineageEdgeColors, isColumnLineage: boolean, sourceHandle?: string | null, targetHandle?: string | null, isEdgeHovered?: boolean ): EdgeStyle { + // Cache keys don't encode colors, so drop cached styles when the resolved + // colors change (e.g. the user updates the brand/custom theme) to avoid + // repainting stale strokes. + const colorSignature = `${colors.primary}|${colors.columnHighlight}|${colors.dqHighlight}`; + if (colorSignature !== cachedColorSignature) { + edgeStyleCache.clear(); + cachedColorSignature = colorSignature; + } + const fromEntityId = edge.data?.edge?.fromEntity?.id; const toEntityId = edge.data?.edge?.toEntity?.id; @@ -128,7 +139,7 @@ export function computeEdgeStyle( hasTracedContext, dqHighlightedEdges, selectedColumn, - theme, + colors, isColumnLineage, isColumnHighlighted, isEdgeHovered From 9741eb7ded477a57a505a9ebbf871d7472b97c56 Mon Sep 17 00:00:00 2001 From: Rohit Jain <60229265+Rohit0301@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:45:25 +0530 Subject: [PATCH 010/165] Addressed context center dashboard feedbacks (#29577) * Addressed context center dashboard feedbacks * addressed gitar comment * lint fix * wip * wip * "wip" * minor UI changes * lint fix * addressed PR comment * lint fix --- .../ContextKnowledgePillarCard.component.tsx | 50 +++-- .../ContextKnowledgePillarCard.interface.ts | 2 +- .../ContextSimplePillarCard.component.tsx | 72 +++++++ .../ContextSimplePillarCard.interface.ts | 23 ++ .../ContextSimplePillarCard.test.tsx | 61 ++++++ .../DashboardFoldersCard.component.tsx | 163 +++++++++++++++ .../DashboardFoldersCard.interface.ts | 18 ++ .../DashboardFoldersCard.test.tsx | 62 ++++++ .../src/constants/ContextCenter.constants.ts | 3 + .../ui/src/locale/languages/ar-sa.json | 1 + .../ui/src/locale/languages/de-de.json | 1 + .../ui/src/locale/languages/en-us.json | 1 + .../ui/src/locale/languages/es-es.json | 1 + .../ui/src/locale/languages/fr-fr.json | 1 + .../ui/src/locale/languages/gl-es.json | 1 + .../ui/src/locale/languages/he-he.json | 1 + .../ui/src/locale/languages/ja-jp.json | 1 + .../ui/src/locale/languages/ko-kr.json | 1 + .../ui/src/locale/languages/mr-in.json | 1 + .../ui/src/locale/languages/nl-nl.json | 1 + .../ui/src/locale/languages/pr-pr.json | 1 + .../ui/src/locale/languages/pt-br.json | 1 + .../ui/src/locale/languages/pt-pt.json | 1 + .../ui/src/locale/languages/ru-ru.json | 1 + .../ui/src/locale/languages/sv-se.json | 1 + .../ui/src/locale/languages/th-th.json | 1 + .../ui/src/locale/languages/tr-tr.json | 1 + .../ui/src/locale/languages/zh-cn.json | 1 + .../ui/src/locale/languages/zh-tw.json | 1 + .../ContextCenterDashboardPage.tsx | 197 ++++++++++++++++-- .../ui/src/utils/KnowledgePageUtils.tsx | 2 +- 31 files changed, 635 insertions(+), 38 deletions(-) create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.interface.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.test.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.component.tsx create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.interface.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.test.tsx diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextKnowledgePillarCard/ContextKnowledgePillarCard.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextKnowledgePillarCard/ContextKnowledgePillarCard.component.tsx index c0f564b5f851..ffc1a11d5807 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextKnowledgePillarCard/ContextKnowledgePillarCard.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextKnowledgePillarCard/ContextKnowledgePillarCard.component.tsx @@ -15,12 +15,14 @@ import { Box, Button, Card, + Dot, FeaturedIcon, Skeleton, Typography, } from '@openmetadata/ui-core-components'; import { ArrowNarrowRight } from '@untitledui/icons'; -import { FC } from 'react'; +import classNames from 'classnames'; +import { FC, Fragment } from 'react'; import { ContextKnowledgePillarCardProps, PillarRecentItem, @@ -45,20 +47,33 @@ function RecentItem({ className="tw:min-w-0 tw:flex-1" gap={4} justify="between"> - - {item.title} - - - {item.meta} - +
+ + {item.title} + +
+ + {item.meta.map((metaItem, index) => ( + +
+ + {metaItem} + +
+ + {index < item.meta.length - 1 && ( + + )} +
+ ))} +
); @@ -134,7 +149,10 @@ const ContextKnowledgePillarCard: FC = ({ return (
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextKnowledgePillarCard/ContextKnowledgePillarCard.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextKnowledgePillarCard/ContextKnowledgePillarCard.interface.ts index 33b9d339b4d2..1f3ab6273644 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextKnowledgePillarCard/ContextKnowledgePillarCard.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextKnowledgePillarCard/ContextKnowledgePillarCard.interface.ts @@ -17,7 +17,7 @@ export type PillarTone = 'info' | 'warning' | 'success'; export interface PillarRecentItem { title: string; - meta: string; + meta: string[]; icon?: ReactElement; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.component.tsx new file mode 100644 index 000000000000..4822bc5453ac --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.component.tsx @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + Box, + Card, + FeaturedIcon, + Skeleton, + Typography, +} from '@openmetadata/ui-core-components'; +import { FC } from 'react'; +import { ContextSimplePillarCardProps } from './ContextSimplePillarCard.interface'; + +const ContextSimplePillarCard: FC = ({ + title, + isLoading = false, + isEmpty = false, + emptyMessage, + dataTestId, + children, + icon: Icon, +}) => { + return ( + + + +
+ + {title} + +
+
+ +
+ {isLoading ? ( + + + + + + ) : isEmpty ? ( + + {emptyMessage} + + ) : ( + children + )} +
+
+ ); +}; + +export default ContextSimplePillarCard; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.interface.ts new file mode 100644 index 000000000000..ae4735a735dc --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.interface.ts @@ -0,0 +1,23 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { FC, ReactNode } from 'react'; + +export interface ContextSimplePillarCardProps { + title: string; + isLoading?: boolean; + isEmpty?: boolean; + emptyMessage?: string; + dataTestId?: string; + children: ReactNode; + icon: FC; +} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.test.tsx new file mode 100644 index 000000000000..5b40092b9efc --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.test.tsx @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { render, screen } from '@testing-library/react'; +import { FC } from 'react'; +import ContextSimplePillarCard from './ContextSimplePillarCard.component'; + +const MockIcon: FC = () => { + return
Mock Icon
; +}; + +describe('ContextSimplePillarCard', () => { + it('renders the title and children', () => { + render( + +
List content
+
+ ); + + expect(screen.getByText('Recently Viewed')).toBeInTheDocument(); + expect(screen.getByText('List content')).toBeInTheDocument(); + }); + + it('renders skeleton loaders when isLoading is true', () => { + render( + +
List content
+
+ ); + + expect(screen.queryByText('List content')).not.toBeInTheDocument(); + }); + + it('renders the empty message when isEmpty is true', () => { + render( + +
List content
+
+ ); + + expect(screen.getByText('No data available')).toBeInTheDocument(); + expect(screen.queryByText('List content')).not.toBeInTheDocument(); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.component.tsx new file mode 100644 index 000000000000..d2ecd7d5e85f --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.component.tsx @@ -0,0 +1,163 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + Badge, + Box, + FileIcon, + Tree, + Typography, +} from '@openmetadata/ui-core-components'; +import { AxiosError } from 'axios'; +import classNames from 'classnames'; +import { FC, useCallback, useEffect, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { ReactComponent as FolderIcon } from '../../../assets/svg/ic-folder-new.svg'; +import { FOLDER_CARD_CHILDREN_LIMIT } from '../../../constants/ContextCenter.constants'; +import { ContextFile } from '../../../generated/entity/data/contextFile'; +import { listContextFiles } from '../../../rest/assetAPI'; +import { getEntityName } from '../../../utils/EntityNameUtils'; +import { showErrorToast } from '../../../utils/ToastUtils'; +import ContextSimplePillarCard from '../ContextSimplePillarCard/ContextSimplePillarCard.component'; +import { DashboardFoldersCardProps } from './DashboardFoldersCard.interface'; + +const DashboardFoldersCard: FC = ({ + folders, + isLoading = false, +}) => { + const { t } = useTranslation(); + const [expandedKeys, setExpandedKeys] = useState>(new Set()); + const [folderChildren, setFolderChildren] = useState< + Map + >(new Map()); + + const fetchFolderChildrenIfNeeded = useCallback( + async (folderId: string) => { + if (folderChildren.has(folderId)) { + return; + } + try { + const response = await listContextFiles({ + folderId, + limit: FOLDER_CARD_CHILDREN_LIMIT, + }); + setFolderChildren((prev) => new Map(prev).set(folderId, response.data)); + } catch (err) { + showErrorToast(err as AxiosError); + } + }, + [folderChildren] + ); + + useEffect(() => { + setFolderChildren(new Map()); + setExpandedKeys(new Set()); + }, [folders]); + + const handleExpandedChange = (keys: Set) => { + const next = new Set(Array.from(keys).map(String)); + const added = Array.from(next).find((k) => !expandedKeys.has(k)); + setExpandedKeys(next); + if (added) { + fetchFolderChildrenIfNeeded(added); + } + }; + + return ( + + + {folders.map((folder) => { + const hasChildItems = (folder.childrenCount ?? 0) > 0; + const children = folderChildren.get(folder.id) ?? []; + + return ( + + + + + +
+ + {getEntityName(folder)} + +
+
+ + + {folder.childrenCount ?? 0} + + + +
+
+ + {children.map((file) => ( + + + + + {getEntityName(file)} + + + + ))} +
+ ); + })} +
+
+ ); +}; + +export default DashboardFoldersCard; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.interface.ts new file mode 100644 index 000000000000..04ddc0babe78 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.interface.ts @@ -0,0 +1,18 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Folder } from '../../../generated/entity/data/folder'; + +export interface DashboardFoldersCardProps { + folders: Folder[]; + isLoading?: boolean; +} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.test.tsx new file mode 100644 index 000000000000..040f403b040f --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.test.tsx @@ -0,0 +1,62 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { render, screen } from '@testing-library/react'; +import { Folder } from '../../../generated/entity/data/folder'; +import { listContextFiles } from '../../../rest/assetAPI'; +import DashboardFoldersCard from './DashboardFoldersCard.component'; + +jest.mock('../../../rest/assetAPI', () => ({ + listContextFiles: jest.fn().mockResolvedValue({ data: [], paging: {} }), +})); + +jest.mock('react-i18next', () => ({ + useTranslation: () => ({ t: (key: string) => key }), +})); + +const MOCK_FOLDERS: Folder[] = [ + { + id: 'folder-1', + name: 'Reports', + displayName: 'Reports', + childrenCount: 3, + }, + { + id: 'folder-2', + name: 'Archive', + displayName: 'Archive', + childrenCount: 0, + }, +]; + +describe('DashboardFoldersCard', () => { + it('renders the folder list with children count badges', () => { + render(); + + expect(screen.getByText('Reports')).toBeInTheDocument(); + expect(screen.getByText('Archive')).toBeInTheDocument(); + expect(screen.getByText('3')).toBeInTheDocument(); + }); + + it('renders the empty state when there are no folders', () => { + render(); + + expect(screen.getByText('label.no-entity')).toBeInTheDocument(); + }); + + it('does not fetch children until a folder is expanded', () => { + render(); + + expect(listContextFiles).not.toHaveBeenCalled(); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/ContextCenter.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/ContextCenter.constants.ts index 09040e0afe0f..d79d8c471c17 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/ContextCenter.constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/ContextCenter.constants.ts @@ -21,7 +21,10 @@ export const DOCUMENT_MAX_FILE_SIZE = 5 * 1024 * 1024; export const RECENT_DASHBOARD_ARTICLES_LIMIT = 3; export const RECENT_DASHBOARD_DOCUMENTS_LIMIT = 3; +export const RECENT_DASHBOARD_MEMORIES_LIMIT = 3; export const FOLDER_FILES_PAGE_SIZE = 10; +export const MOST_CITED_MEMORIES_LIMIT = 10; +export const FOLDER_CARD_CHILDREN_LIMIT = 5; export const PILLAR_TONE_TEXT_CLASS: Record = { info: 'tw:text-utility-brand-700', diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json index a2d0e4cb8580..2b148f52899c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json @@ -1546,6 +1546,7 @@ "more-help": "مزيد من المساعدة", "more-lowercase": "المزيد", "most-active-user": "المستخدم الأكثر نشاطًا", + "most-cited": "الأكثر استشهادًا", "most-expensive-query-plural": "الاستعلامات الأكثر تكلفة", "most-recent-session": "الجلسة الأحدث", "most-used": "الأكثر استخدامًا", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json index b881b21aa0dc..4220c5a75464 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json @@ -1546,6 +1546,7 @@ "more-help": "Mehr Hilfe", "more-lowercase": "mehr", "most-active-user": "Aktivste Benutzer", + "most-cited": "Am häufigsten zitiert", "most-expensive-query-plural": "Teuerste Abfragen", "most-recent-session": "Aktuellste Sitzung", "most-used": "Am häufigsten verwendet", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json index dfba4b6d1e5b..9423f5f1235e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json @@ -1546,6 +1546,7 @@ "more-help": "More Help", "more-lowercase": "more", "most-active-user": "Most Active User", + "most-cited": "Most Cited", "most-expensive-query-plural": "Most Expensive Queries", "most-recent-session": "Most Recent Session", "most-used": "Most used", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json index 5c700550f18d..3d086d81519f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json @@ -1546,6 +1546,7 @@ "more-help": "Más Ayuda", "more-lowercase": "más", "most-active-user": "Usuario Más Activo", + "most-cited": "Más citado", "most-expensive-query-plural": "Consultas más costosas", "most-recent-session": "Sesión Más Reciente", "most-used": "Más utilizado", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json index ee0d853bfead..73ba6d76bc51 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json @@ -1546,6 +1546,7 @@ "more-help": "Plus d'Aide", "more-lowercase": "plus", "most-active-user": "Utilisateurs les plus Actifs", + "most-cited": "Le plus cité", "most-expensive-query-plural": "Consultations les plus chères", "most-recent-session": "Session la Plus Récente", "most-used": "Le plus utilisé", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json index 09b9936801f6..c3f891bfc2ae 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json @@ -1546,6 +1546,7 @@ "more-help": "Máis axuda", "more-lowercase": "máis", "most-active-user": "Usuario máis activo", + "most-cited": "Máis citado", "most-expensive-query-plural": "Consultas más costosas", "most-recent-session": "Sesión máis recente", "most-used": "Máis utilizado", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json index a165b0af6b4c..0cd7aa68e986 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json @@ -1546,6 +1546,7 @@ "more-help": "עזרה נוספת", "more-lowercase": "יותר", "most-active-user": "המשתמש הפעיל ביותר", + "most-cited": "המצוטט ביותר", "most-expensive-query-plural": "שאילתות מחירון", "most-recent-session": "הסשן האחרון ביותר", "most-used": "הכי בשימוש", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json index 958c16763956..e736b21b4386 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json @@ -1546,6 +1546,7 @@ "more-help": "さらに詳しいヘルプ", "more-lowercase": "もっと", "most-active-user": "最もアクティブなユーザー", + "most-cited": "引用数が最も多い", "most-expensive-query-plural": "最も高コストなクエリ", "most-recent-session": "最新のセッション", "most-used": "最も使用された", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json index 6b8bb26a263e..7697e51927d7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json @@ -1546,6 +1546,7 @@ "more-help": "추가 도움말", "more-lowercase": "더", "most-active-user": "가장 활발한 사용자", + "most-cited": "최다 인용", "most-expensive-query-plural": "가장 비용이 많이 든 쿼리들", "most-recent-session": "가장 최근 세션", "most-used": "가장 많이 사용됨", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json index 85420ef2c3c6..ca4327de18cd 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json @@ -1546,6 +1546,7 @@ "more-help": "अधिक मदत", "more-lowercase": "अधिक", "most-active-user": "सर्वात सक्रिय वापरकर्ता", + "most-cited": "सर्वाधिक उद्धृत", "most-expensive-query-plural": "सर्वात महाग क्वेरी", "most-recent-session": "सर्वात अलीकडील सत्र", "most-used": "सर्वाधिक वापरलेले", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json index 819e65cd39fe..6ccd3001e4a1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json @@ -1546,6 +1546,7 @@ "more-help": "Meer hulp", "more-lowercase": "meer", "most-active-user": "Meest actieve gebruiker", + "most-cited": "Meest geciteerd", "most-expensive-query-plural": "Duurste queries", "most-recent-session": "Meest recente sessie", "most-used": "Meest gebruikt", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json index d80ec52af199..d82b02b239e5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json @@ -1546,6 +1546,7 @@ "more-help": "کمک بیشتر", "more-lowercase": "بیشتر", "most-active-user": "فعال‌ترین کاربر", + "most-cited": "بیشترین استناد", "most-expensive-query-plural": "بیشترین هزینه های سوال", "most-recent-session": "آخرین جلسه", "most-used": "بیشترین استفاده", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json index c4044381af9f..76690bf54aa1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json @@ -1546,6 +1546,7 @@ "more-help": "Mais Ajuda", "more-lowercase": "mais", "most-active-user": "Usuário Mais Ativo", + "most-cited": "Mais citado", "most-expensive-query-plural": "Consultas mais caras", "most-recent-session": "Sessão Mais Recente", "most-used": "Mais usados", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json index 019d64b6ec6f..381933a1aa98 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json @@ -1546,6 +1546,7 @@ "more-help": "Mais Ajuda", "more-lowercase": "mais", "most-active-user": "Utilizador Mais Ativo", + "most-cited": "Mais citado", "most-expensive-query-plural": "Consultas mais caras", "most-recent-session": "Sessão Mais Recente", "most-used": "Mais usados", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json index 7a0b107999a6..75c311f0ebf5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json @@ -1546,6 +1546,7 @@ "more-help": "Дополнительная помощь", "more-lowercase": "больше", "most-active-user": "Самый активный пользователь", + "most-cited": "Наиболее цитируемый", "most-expensive-query-plural": "Самые дорогие запросы", "most-recent-session": "Последний сеанс", "most-used": "Часто используемые", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json index 2f82ce367940..485f5c02a71f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json @@ -1546,6 +1546,7 @@ "more-help": "Mer hjälp", "more-lowercase": "mer", "most-active-user": "Mest aktiva användare", + "most-cited": "Mest citerad", "most-expensive-query-plural": "Dyraste frågor", "most-recent-session": "Senaste sessionen", "most-used": "Mest använda", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json index 1aad270d3103..64196ca1adfc 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json @@ -1546,6 +1546,7 @@ "more-help": "ช่วยเหลือเพิ่มเติม", "more-lowercase": "เพิ่มเติม", "most-active-user": "ผู้ใช้งานที่ใช้งานมากที่สุด", + "most-cited": "อ้างอิงมากที่สุด", "most-expensive-query-plural": "คำสั่งที่มีค่าสูงสุด", "most-recent-session": "เซสชันล่าสุด", "most-used": "ใช้งานมากที่สุด", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json index 78cdabf22fbd..a9640a763aa8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json @@ -1546,6 +1546,7 @@ "more-help": "Daha Fazla Yardım", "more-lowercase": "daha fazla", "most-active-user": "En Aktif Kullanıcı", + "most-cited": "En çok alıntılanan", "most-expensive-query-plural": "En Maliyetli Sorgular", "most-recent-session": "En Son Oturum", "most-used": "En çok kullanılan", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json index 47c51dbe54f4..c33085f43bc9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json @@ -1546,6 +1546,7 @@ "more-help": "更多帮助", "more-lowercase": "更多", "most-active-user": "最活跃用户", + "most-cited": "被引用最多", "most-expensive-query-plural": "最昂贵的查询", "most-recent-session": "最近的会话", "most-used": "最常用", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json index a7f0d1e92fe8..ad15d1948fc5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json @@ -1546,6 +1546,7 @@ "more-help": "更多說明", "more-lowercase": "更多", "most-active-user": "最活躍使用者", + "most-cited": "被引用最多", "most-expensive-query-plural": "成本最高的查詢", "most-recent-session": "最近的工作階段", "most-used": "最常用", diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx index f7d522175e7f..8310caf81c27 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterDashboardPage/ContextCenterDashboardPage.tsx @@ -11,14 +11,13 @@ * limitations under the License. */ -import { Box, Button, Dropdown } from '@openmetadata/ui-core-components'; import { - ChevronDown, - File05, - File06, - Sun, - UploadCloud02, -} from '@untitledui/icons'; + Box, + Button, + Dropdown, + Typography, +} from '@openmetadata/ui-core-components'; +import { ChevronDown, File06, Sun, UploadCloud02 } from '@untitledui/icons'; import { AxiosError } from 'axios'; import cryptoRandomString from 'crypto-random-string-with-promisify-polyfill'; import { FC, useCallback, useEffect, useMemo, useState } from 'react'; @@ -28,27 +27,35 @@ import { ReactComponent as FolderIcon } from '../../../assets/svg/ic-folder-new. import { ReactComponent as QuickLinkIcon } from '../../../assets/svg/quick-link.svg'; import ContextCenterHeader from '../../../components/ContextCenter/ContextCenterHeader/ContextCenterHeader.component'; import ContextKnowledgePillarCard from '../../../components/ContextCenter/ContextKnowledgePillarCard/ContextKnowledgePillarCard.component'; +import ContextSimplePillarCard from '../../../components/ContextCenter/ContextSimplePillarCard/ContextSimplePillarCard.component'; +import DashboardFoldersCard from '../../../components/ContextCenter/DashboardFoldersCard/DashboardFoldersCard.component'; import UploadDocumentModal from '../../../components/ContextCenter/UploadDocumentModal/UploadDocumentModal.component'; import { QuickLinkFormModal, QuickLinkFormModalFormData, } from '../../../components/KnowledgeCenter/QuickLinkFormModal/QuickLinkFormModal'; import { + MOST_CITED_MEMORIES_LIMIT, RECENT_DASHBOARD_ARTICLES_LIMIT, RECENT_DASHBOARD_DOCUMENTS_LIMIT, + RECENT_DASHBOARD_MEMORIES_LIMIT, } from '../../../constants/ContextCenter.constants'; import { usePermissionProvider } from '../../../context/PermissionProvider/PermissionProvider'; import { OperationPermission, ResourceEntity, } from '../../../context/PermissionProvider/PermissionProvider.interface'; +import { ContextMemory } from '../../../generated/entity/context/contextMemory'; import { ContextFile } from '../../../generated/entity/data/contextFile'; +import { Folder } from '../../../generated/entity/data/folder'; import LimitWrapper from '../../../hoc/LimitWrapper'; +import { useCurrentUserPreferences } from '../../../hooks/currentUserStore/useCurrentUserStore'; import { useApplicationStore } from '../../../hooks/useApplicationStore'; import { CreateKnowledgePage, KnowledgePage, PageType, + RecentlyViewedQuickLinks, } from '../../../interface/knowledge-center.interface'; import { listContextFiles, listFolders } from '../../../rest/assetAPI'; import { getListContextMemories } from '../../../rest/contextMemoryAPI'; @@ -68,6 +75,9 @@ const ContextCenterDashboardPage: FC = () => { const navigate = useNavigate(); const { currentUser } = useApplicationStore(); const { getResourcePermission } = usePermissionProvider(); + const { + preferences: { recentlyViewedQuickLinks }, + } = useCurrentUserPreferences(); const [isUploadModalOpen, setIsUploadModalOpen] = useState(false); const [showAddLinkModal, setShowAddLinkModal] = useState(false); @@ -75,18 +85,25 @@ const ContextCenterDashboardPage: FC = () => { const [articlesCount, setArticlesCount] = useState(0); const [documents, setDocuments] = useState([]); const [documentsCount, setDocumentsCount] = useState(0); - const [folderCount, setFolderCount] = useState(0); + const [folders, setFolders] = useState([]); const [memories, setMemories] = useState< - Array<{ title: string; meta: string }> + Array<{ title: string; meta: string[] }> >([]); const [memoriesCount, setMemoriesCount] = useState(0); + const [mostCitedMemories, setMostCitedMemories] = useState( + [] + ); const [isArticlesLoading, setIsArticlesLoading] = useState(true); const [isDocumentsLoading, setIsDocumentsLoading] = useState(true); + const [isFoldersLoading, setIsFoldersLoading] = useState(true); const [isMemoriesLoading, setIsMemoriesLoading] = useState(true); + const [isMostCitedLoading, setIsMostCitedLoading] = useState(true); const [permissions, setPermissions] = useState( DEFAULT_ENTITY_PERMISSION ); + const folderCount = folders.length; + const hasCreatePermission = useMemo( () => permissions.Create, [permissions.Create] @@ -164,11 +181,14 @@ const ContextCenterDashboardPage: FC = () => { }, []); const fetchFolders = useCallback(async () => { + setIsFoldersLoading(true); try { - const folders = await listFolders(); - setFolderCount(folders.length); + const response = await listFolders(); + setFolders(response); } catch (err) { showErrorToast(err as AxiosError); + } finally { + setIsFoldersLoading(false); } }, []); @@ -176,14 +196,15 @@ const ContextCenterDashboardPage: FC = () => { setIsMemoriesLoading(true); try { const response = await getListContextMemories({ - limit: 3, - sort: 'updatedAt', + limit: RECENT_DASHBOARD_MEMORIES_LIMIT, + sortBy: 'updatedAt', + sortOrder: 'desc', }); setMemoriesCount(response.paging.total ?? response.data.length); setMemories( response.data.map((m) => ({ title: m.title ?? m.name, - meta: `cited ${m.usageCount}×`, + meta: [`cited ${m.usageCount}×`], })) ); } catch (err) { @@ -193,6 +214,22 @@ const ContextCenterDashboardPage: FC = () => { } }, []); + const fetchMostCitedMemories = useCallback(async () => { + setIsMostCitedLoading(true); + try { + const response = await getListContextMemories({ + limit: MOST_CITED_MEMORIES_LIMIT, + sortBy: 'usageCount', + sortOrder: 'desc', + }); + setMostCitedMemories(response.data); + } catch (err) { + showErrorToast(err as AxiosError); + } finally { + setIsMostCitedLoading(false); + } + }, []); + const fetchPermission = useCallback(async () => { try { const response = await getResourcePermission( @@ -209,12 +246,14 @@ const ContextCenterDashboardPage: FC = () => { fetchDocuments(); fetchFolders(); fetchMemories(); + fetchMostCitedMemories(); fetchPermission(); }, [ fetchRecentArticles, fetchDocuments, fetchFolders, fetchMemories, + fetchMostCitedMemories, fetchPermission, ]); @@ -241,7 +280,7 @@ const ContextCenterDashboardPage: FC = () => { return { icon, - meta: metaParts.join(' · '), + meta: metaParts, title: getEntityName(article), }; }), @@ -256,11 +295,33 @@ const ContextCenterDashboardPage: FC = () => { getShortRelativeTime(doc.updatedAt), ].filter(Boolean); - return { title: getEntityName(doc), meta: metaParts.join(' · ') }; + return { title: getEntityName(doc), meta: metaParts }; }), [documents] ); + const recentlyViewedItems = useMemo(() => { + const recentlyViewed = (recentlyViewedQuickLinks ?? + []) as unknown as RecentlyViewedQuickLinks['data']; + + return recentlyViewed.map((page) => ({ + id: page.id, + title: getEntityName(page), + pageType: page.pageType, + time: page.timestamp ? getShortRelativeTime(page.timestamp) : '', + })); + }, [recentlyViewedQuickLinks]); + + const mostCitedItems = useMemo( + () => + mostCitedMemories.map((memory) => ({ + id: memory.id, + title: memory.title ?? getEntityName(memory), + citedCount: memory.usageCount ?? 0, + })), + [mostCitedMemories] + ); + return (
{ /> -
+ gap={5}> +
{ } />
+ +
+ + + {recentlyViewedItems.map((item) => ( + + {item.pageType === PageType.QUICK_LINK ? ( + + ) : ( + + )} + + +
+ + {item.title} + +
+ +
+ + {item.time} + +
+
+
+ ))} +
+
+ + + + + + {mostCitedItems.map((item) => ( + + + +
+ + {item.title} + +
+
+ + {t('label.cited-n-times', { count: item.citedCount })} + +
+
+
+ ))} +
+
+
('timestamp', true)); arrData.unshift(entityData); - if (arrData.length > 5) { + if (arrData.length > 10) { arrData.pop(); } recentlyViewed = arrData; From 4addee0645b6eaa433b2101a6fd1ab2ffc4fdd48 Mon Sep 17 00:00:00 2001 From: Pere Miquel Brull Date: Thu, 9 Jul 2026 13:20:44 +0200 Subject: [PATCH 011/165] Fixes #29336: support Cohere and Titan v1 embeddings on Bedrock (#29337) * fix(search): support Cohere and Titan v1 Bedrock embeddings Bedrock embedding requests were always built in Titan v2 wire format (inputText + dimensions) and parsed only an "embedding" field, so Cohere and Titan v1 models failed. Introduce a per-family strategy that builds the correct request body and extracts the matching response shape, select the family from the model id, and send the search_query input type for Cohere queries vs search_document for documents. Validate the configured dimension against Cohere's fixed 1024 to avoid a silent knn vector mapping mismatch at index time. Fixes #29336 Co-Authored-By: Claude Opus 4.8 (1M context) * fix(search): validate Titan v1 fixed embedding dimension too Titan v1 also returns a fixed-size vector (1536) and ignores the dimensions parameter, so a mismatched configured dimension caused the same silent knn_vector mapping mismatch the Cohere guard prevents. Make the construction-time check data-driven: each family declares its fixed output size (Cohere 1024, Titan v1 1536, Titan v2 configurable) and a generalized validateDimension rejects any incompatible configuration. Co-Authored-By: Claude Opus 4.8 (1M context) * Cap Cohere embedding input to 2048 chars and use embedQuery in chunk search * Update openmetadata-service/src/main/java/org/openmetadata/service/search/vector/client/BedrockEmbeddingClient.java Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(search): scope Titan v1 Bedrock matcher to its exact model id The Titan v1 matcher used the broad token "titan", so every non-v2 Titan id (e.g. titan-embed-image-v1, a future titan-embed-text-v3) was classified as Titan v1 and, with the fixed-dimension check, pinned to 1536. Match the exact "titan-embed-text-v1" id instead, so other Titan models fall back to the Titan v2 default as intended. Co-Authored-By: Claude Opus 4.8 (1M context) --------- Co-authored-by: Claude Opus 4.8 (1M context) Co-authored-by: Vishnu Jain <121681876+Vishnuujain@users.noreply.github.com> Co-authored-by: Vishnu Jain Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- .../vector/OpenSearchVectorService.java | 12 +- .../vector/client/BedrockEmbeddingClient.java | 178 +++++++++++++++++- .../search/vector/client/EmbeddingClient.java | 20 +- .../vector/OpenSearchVectorServiceTest.java | 3 +- .../client/BedrockEmbeddingClientTest.java | 158 ++++++++++++++++ 5 files changed, 356 insertions(+), 15 deletions(-) create mode 100644 openmetadata-service/src/test/java/org/openmetadata/service/search/vector/client/BedrockEmbeddingClientTest.java diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/OpenSearchVectorService.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/OpenSearchVectorService.java index b2b32338a0a1..acc71d109405 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/OpenSearchVectorService.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/OpenSearchVectorService.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -9,6 +10,7 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Optional; import java.util.function.Supplier; @@ -198,7 +200,7 @@ public String getChunkIndexName() { } return clusterAlias == null || clusterAlias.isEmpty() ? CHUNK_INDEX_BASE - : clusterAlias.toLowerCase(java.util.Locale.ROOT) + "_" + CHUNK_INDEX_BASE; + : clusterAlias.toLowerCase(Locale.ROOT) + "_" + CHUNK_INDEX_BASE; } @Override @@ -292,7 +294,7 @@ public List searchChunksByParent(String parentId, String query, int k) { List passages = new ArrayList<>(); try { ensureChunkIndex(); - float[] vector = embeddingClient.embed(query); + float[] vector = embeddingClient.embedQuery(query); Map> filters = Map.of("parentId", List.of(parentId)); String queryJson = VectorSearchQueryBuilder.build(vector, k, 0, k, filters, 0.0); String response = @@ -391,8 +393,8 @@ private String buildChunkIndexMapping() { return root.toString(); } - private com.fasterxml.jackson.databind.node.ObjectNode nestedKeyword(String field) { - return (com.fasterxml.jackson.databind.node.ObjectNode) + private ObjectNode nestedKeyword(String field) { + return (ObjectNode) MAPPER .createObjectNode() .set( @@ -578,7 +580,7 @@ public VectorSearchResponse search( String preference) { long start = System.currentTimeMillis(); try { - float[] queryVector = embeddingClient.embed(query); + float[] queryVector = embeddingClient.embedQuery(query); LinkedHashMap>> byParent = new LinkedHashMap<>(); int rawOffset = 0; long totalHits = -1L; diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/client/BedrockEmbeddingClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/client/BedrockEmbeddingClient.java index 881f09916a45..b38d3279c8dc 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/client/BedrockEmbeddingClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/client/BedrockEmbeddingClient.java @@ -4,6 +4,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import java.io.IOException; +import java.util.List; +import java.util.Locale; +import java.util.OptionalInt; import lombok.extern.slf4j.Slf4j; import org.openmetadata.schema.configuration.LLMBedrockEmbeddingConfig; import org.openmetadata.schema.configuration.LLMConfiguration; @@ -21,9 +24,115 @@ public final class BedrockEmbeddingClient extends EmbeddingClient implements AutoCloseable { private static final ObjectMapper MAPPER = new ObjectMapper(); + private static final String FIELD_INPUT_TEXT = "inputText"; + private static final String FIELD_DIMENSIONS = "dimensions"; + private static final String FIELD_NORMALIZE = "normalize"; + private static final String FIELD_TEXTS = "texts"; + private static final String FIELD_INPUT_TYPE = "input_type"; + private static final String FIELD_TRUNCATE = "truncate"; + private static final String FIELD_EMBEDDING = "embedding"; + private static final String FIELD_EMBEDDINGS = "embeddings"; + private static final String FIELD_FLOAT = "float"; + private static final String COHERE_INPUT_TYPE_SEARCH_DOCUMENT = "search_document"; + private static final String COHERE_INPUT_TYPE_SEARCH_QUERY = "search_query"; + private static final String COHERE_TRUNCATE_END = "END"; + + private static final int COHERE_FIXED_DIMENSION = 1024; + private static final int TITAN_V1_FIXED_DIMENSION = 1536; + + // Bedrock validates each Cohere input against a 2048-character maxLength in the request schema + // before the Cohere-side `truncate` directive runs, so oversized text must be capped client-side. + private static final int COHERE_MAX_INPUT_CHARS = 2048; + + private static final BedrockEmbeddingFamily DEFAULT_FAMILY = BedrockEmbeddingFamily.TITAN_V2; + + private static final List FAMILY_MATCHERS = + List.of( + new FamilyMatcher("cohere", BedrockEmbeddingFamily.COHERE), + new FamilyMatcher("titan-embed-text-v2", BedrockEmbeddingFamily.TITAN_V2), + new FamilyMatcher("titan-embed-text-v1", BedrockEmbeddingFamily.TITAN_V1)); + + private record FamilyMatcher(String token, BedrockEmbeddingFamily family) {} + + /** + * Wire-format strategy per Bedrock embedding model family. Each family knows how to build its + * request body and extract the embedding array from its response, so adding a new family means + * adding one constant plus a {@link FamilyMatcher} entry. + */ + enum BedrockEmbeddingFamily { + TITAN_V1(OptionalInt.of(TITAN_V1_FIXED_DIMENSION)) { + @Override + ObjectNode buildRequest(String text, int dimension, boolean isQuery) { + ObjectNode payload = MAPPER.createObjectNode(); + payload.put(FIELD_INPUT_TEXT, text); + return payload; + } + + @Override + JsonNode extractEmbedding(JsonNode root) { + return root.get(FIELD_EMBEDDING); + } + }, + TITAN_V2(OptionalInt.empty()) { + @Override + ObjectNode buildRequest(String text, int dimension, boolean isQuery) { + ObjectNode payload = MAPPER.createObjectNode(); + payload.put(FIELD_INPUT_TEXT, text); + payload.put(FIELD_DIMENSIONS, dimension); + payload.put(FIELD_NORMALIZE, true); + return payload; + } + + @Override + JsonNode extractEmbedding(JsonNode root) { + return root.get(FIELD_EMBEDDING); + } + }, + COHERE(OptionalInt.of(COHERE_FIXED_DIMENSION)) { + @Override + ObjectNode buildRequest(String text, int dimension, boolean isQuery) { + ObjectNode payload = MAPPER.createObjectNode(); + payload.putArray(FIELD_TEXTS).add(capToCohereLimit(text)); + payload.put( + FIELD_INPUT_TYPE, + isQuery ? COHERE_INPUT_TYPE_SEARCH_QUERY : COHERE_INPUT_TYPE_SEARCH_DOCUMENT); + payload.put(FIELD_TRUNCATE, COHERE_TRUNCATE_END); + return payload; + } + + @Override + JsonNode extractEmbedding(JsonNode root) { + return extractCohereEmbedding(root); + } + }; + + private final OptionalInt fixedDimension; + + BedrockEmbeddingFamily(OptionalInt fixedDimension) { + this.fixedDimension = fixedDimension; + } + + abstract ObjectNode buildRequest(String text, int dimension, boolean isQuery); + + abstract JsonNode extractEmbedding(JsonNode root); + + OptionalInt fixedDimension() { + return fixedDimension; + } + + private static String capToCohereLimit(String text) { + String capped = text; + if (text != null && text.length() > COHERE_MAX_INPUT_CHARS) { + capped = text.substring(0, COHERE_MAX_INPUT_CHARS); + } + return capped; + } + } + private final BedrockRuntimeClient bedrockClient; private final String modelId; private final int dimension; + private final BedrockEmbeddingFamily family; public BedrockEmbeddingClient(LLMConfiguration config) { super(resolveMaxConcurrent(config)); @@ -49,6 +158,8 @@ public BedrockEmbeddingClient(LLMConfiguration config) { this.modelId = bedrockEmbedding.getEmbeddingModelId(); this.dimension = bedrockEmbedding.getEmbeddingDimension(); + this.family = familyFor(modelId); + validateDimension(family, dimension); this.bedrockClient = BedrockRuntimeClient.builder() @@ -57,19 +168,26 @@ public BedrockEmbeddingClient(LLMConfiguration config) { .build(); LOG.info( - "Initialized BedrockEmbeddingClient with model={}, dimension={}, region={}", + "Initialized BedrockEmbeddingClient with model={}, family={}, dimension={}, region={}", modelId, + family, dimension, awsConfig.getRegion()); } @Override protected float[] doEmbed(String text) { + return invokeEmbedding(text, false); + } + + @Override + protected float[] doEmbedQuery(String text) { + return invokeEmbedding(text, true); + } + + private float[] invokeEmbedding(String text, boolean isQuery) { try { - ObjectNode payload = MAPPER.createObjectNode(); - payload.put("inputText", text); - payload.put("dimensions", dimension); - String body = MAPPER.writeValueAsString(payload); + String body = buildRequestBody(family, text, dimension, isQuery); InvokeModelRequest request = InvokeModelRequest.builder() @@ -80,7 +198,7 @@ protected float[] doEmbed(String text) { .build(); InvokeModelResponse response = bedrockClient.invokeModel(request); - return parseEmbeddingResponse(response.body().asUtf8String()); + return parseEmbeddingResponse(family, response.body().asUtf8String()); } catch (AwsServiceException e) { LOG.error("AWS service error calling Bedrock: {}", e.getMessage(), e); throw new RuntimeException("Bedrock embedding generation failed (AWS service error)", e); @@ -110,10 +228,40 @@ public void close() { } } - private float[] parseEmbeddingResponse(String responseBody) { + static BedrockEmbeddingFamily familyFor(String modelId) { + String normalized = modelId == null ? "" : modelId.toLowerCase(Locale.ROOT); + BedrockEmbeddingFamily result = DEFAULT_FAMILY; + for (FamilyMatcher matcher : FAMILY_MATCHERS) { + if (normalized.contains(matcher.token())) { + result = matcher.family(); + break; + } + } + return result; + } + + static String buildRequestBody( + BedrockEmbeddingFamily family, String text, int dimension, boolean isQuery) + throws IOException { + return MAPPER.writeValueAsString(family.buildRequest(text, dimension, isQuery)); + } + + static void validateDimension(BedrockEmbeddingFamily family, int dimension) { + OptionalInt fixedDimension = family.fixedDimension(); + if (fixedDimension.isPresent() && fixedDimension.getAsInt() != dimension) { + throw new IllegalArgumentException( + String.format( + "%s Bedrock embedding models produce %d-dimensional vectors; " + + "configured embedding dimension %d is incompatible. " + + "Set the embedding dimension to %d.", + family, fixedDimension.getAsInt(), dimension, fixedDimension.getAsInt())); + } + } + + static float[] parseEmbeddingResponse(BedrockEmbeddingFamily family, String responseBody) { try { JsonNode root = MAPPER.readTree(responseBody); - JsonNode embeddingNode = root.get("embedding"); + JsonNode embeddingNode = family.extractEmbedding(root); if (embeddingNode == null || !embeddingNode.isArray()) { throw new RuntimeException("Invalid Bedrock response: no embedding array found"); } @@ -126,4 +274,18 @@ private float[] parseEmbeddingResponse(String responseBody) { throw new RuntimeException("Failed to parse Bedrock embedding response", e); } } + + private static JsonNode extractCohereEmbedding(JsonNode root) { + JsonNode embeddings = root.get(FIELD_EMBEDDINGS); + JsonNode result = null; + if (embeddings != null && embeddings.isArray() && !embeddings.isEmpty()) { + result = embeddings.get(0); + } else if (embeddings != null && embeddings.isObject()) { + JsonNode floatEmbeddings = embeddings.get(FIELD_FLOAT); + if (floatEmbeddings != null && floatEmbeddings.isArray() && !floatEmbeddings.isEmpty()) { + result = floatEmbeddings.get(0); + } + } + return result; + } } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/client/EmbeddingClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/client/EmbeddingClient.java index 56260878bf28..bfc56efffe11 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/client/EmbeddingClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/vector/client/EmbeddingClient.java @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.Semaphore; +import java.util.function.Supplier; import org.openmetadata.schema.configuration.LLMConfiguration; import org.openmetadata.schema.configuration.LLMEmbeddingsConfig; @@ -25,7 +26,24 @@ protected EmbeddingClient() { protected abstract float[] doEmbed(String text); + /** + * Embed text that will be used as a search query. Defaults to treating a query like a document; + * clients whose backend distinguishes query and document embeddings (e.g. Cohere on Bedrock) + * override this. + */ + protected float[] doEmbedQuery(String text) { + return doEmbed(text); + } + public final float[] embed(String text) { + return embedWithLimit(() -> doEmbed(text)); + } + + public final float[] embedQuery(String text) { + return embedWithLimit(() -> doEmbedQuery(text)); + } + + private float[] embedWithLimit(Supplier embedder) { try { concurrencyLimiter.acquire(); } catch (InterruptedException e) { @@ -34,7 +52,7 @@ public final float[] embed(String text) { "Embedding generation was interrupted while waiting for permit", e); } try { - return doEmbed(text); + return embedder.get(); } finally { concurrencyLimiter.release(); } diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/search/vector/OpenSearchVectorServiceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/search/vector/OpenSearchVectorServiceTest.java index c850df6b3944..3f203ba1719b 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/search/vector/OpenSearchVectorServiceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/search/vector/OpenSearchVectorServiceTest.java @@ -37,7 +37,8 @@ void setup() { when(mockClient.generic()).thenReturn(mockGenericClient); - when(mockEmbeddingClient.embed(any(String.class))).thenReturn(new float[] {0.1f, 0.2f, 0.3f}); + when(mockEmbeddingClient.embedQuery(any(String.class))) + .thenReturn(new float[] {0.1f, 0.2f, 0.3f}); vectorService = new OpenSearchVectorService(mockClient, mockEmbeddingClient); } diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/search/vector/client/BedrockEmbeddingClientTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/search/vector/client/BedrockEmbeddingClientTest.java new file mode 100644 index 000000000000..5a5112f15696 --- /dev/null +++ b/openmetadata-service/src/test/java/org/openmetadata/service/search/vector/client/BedrockEmbeddingClientTest.java @@ -0,0 +1,158 @@ +package org.openmetadata.service.search.vector.client; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import org.openmetadata.service.search.vector.client.BedrockEmbeddingClient.BedrockEmbeddingFamily; + +class BedrockEmbeddingClientTest { + private static final ObjectMapper MAPPER = new ObjectMapper(); + private static final float DELTA = 1e-6f; + + @Test + void cohereModelsResolveToCohereFamily() { + assertEquals( + BedrockEmbeddingFamily.COHERE, BedrockEmbeddingClient.familyFor("cohere.embed-english-v3")); + assertEquals( + BedrockEmbeddingFamily.COHERE, + BedrockEmbeddingClient.familyFor("cohere.embed-multilingual-v3")); + assertEquals( + BedrockEmbeddingFamily.COHERE, + BedrockEmbeddingClient.familyFor("us.cohere.embed-english-v3")); + } + + @Test + void titanModelsResolveToTheirVersionedFamily() { + assertEquals( + BedrockEmbeddingFamily.TITAN_V1, + BedrockEmbeddingClient.familyFor("amazon.titan-embed-text-v1")); + assertEquals( + BedrockEmbeddingFamily.TITAN_V2, + BedrockEmbeddingClient.familyFor("amazon.titan-embed-text-v2:0")); + } + + @Test + void unknownAndNullModelsFallBackToDefaultTitanV2() { + assertEquals( + BedrockEmbeddingFamily.TITAN_V2, BedrockEmbeddingClient.familyFor("some.unknown-model")); + assertEquals(BedrockEmbeddingFamily.TITAN_V2, BedrockEmbeddingClient.familyFor(null)); + } + + @Test + void otherTitanModelsFallBackToDefaultTitanV2() { + assertEquals( + BedrockEmbeddingFamily.TITAN_V2, + BedrockEmbeddingClient.familyFor("amazon.titan-embed-image-v1")); + assertEquals( + BedrockEmbeddingFamily.TITAN_V2, + BedrockEmbeddingClient.familyFor("amazon.titan-embed-text-v3")); + } + + @Test + void titanV1RequestSendsOnlyInputText() throws Exception { + JsonNode payload = buildPayload(BedrockEmbeddingFamily.TITAN_V1, "hello world", 1024, false); + + assertEquals("hello world", payload.get("inputText").asText()); + assertFalse(payload.has("dimensions")); + assertFalse(payload.has("normalize")); + } + + @Test + void titanV2RequestSendsInputTextDimensionsAndNormalize() throws Exception { + JsonNode payload = buildPayload(BedrockEmbeddingFamily.TITAN_V2, "hello world", 512, false); + + assertEquals("hello world", payload.get("inputText").asText()); + assertEquals(512, payload.get("dimensions").asInt()); + assertTrue(payload.get("normalize").asBoolean()); + } + + @Test + void cohereDocumentRequestUsesTextsAndSearchDocumentInputType() throws Exception { + JsonNode payload = buildPayload(BedrockEmbeddingFamily.COHERE, "hello world", 1024, false); + + assertTrue(payload.get("texts").isArray()); + assertEquals("hello world", payload.get("texts").get(0).asText()); + assertEquals("search_document", payload.get("input_type").asText()); + assertEquals("END", payload.get("truncate").asText()); + + assertFalse(payload.has("inputText")); + assertFalse(payload.has("dimensions")); + } + + @Test + void cohereQueryRequestUsesSearchQueryInputType() throws Exception { + JsonNode payload = buildPayload(BedrockEmbeddingFamily.COHERE, "hello world", 1024, true); + + assertEquals("search_query", payload.get("input_type").asText()); + } + + @Test + void titanQueryRequestIsIdenticalToDocumentRequest() throws Exception { + JsonNode document = buildPayload(BedrockEmbeddingFamily.TITAN_V2, "hello world", 512, false); + JsonNode query = buildPayload(BedrockEmbeddingFamily.TITAN_V2, "hello world", 512, true); + + assertEquals(document, query); + } + + @Test + void parseTitanResponse() { + float[] embedding = + BedrockEmbeddingClient.parseEmbeddingResponse( + BedrockEmbeddingFamily.TITAN_V2, "{\"embedding\":[0.6,0.7],\"inputTextTokenCount\":2}"); + assertArrayEquals(new float[] {0.6f, 0.7f}, embedding, DELTA); + } + + @Test + void parseCohereFloatsResponse() { + float[] embedding = + BedrockEmbeddingClient.parseEmbeddingResponse( + BedrockEmbeddingFamily.COHERE, "{\"embeddings\":[[0.1,0.2,0.3]]}"); + assertArrayEquals(new float[] {0.1f, 0.2f, 0.3f}, embedding, DELTA); + } + + @Test + void parseCohereEmbeddingsByTypeResponse() { + float[] embedding = + BedrockEmbeddingClient.parseEmbeddingResponse( + BedrockEmbeddingFamily.COHERE, "{\"embeddings\":{\"float\":[[0.4,0.5]]}}"); + assertArrayEquals(new float[] {0.4f, 0.5f}, embedding, DELTA); + } + + @Test + void cohereRejectsDimensionsOtherThanItsFixedSize() { + assertThrows( + IllegalArgumentException.class, + () -> BedrockEmbeddingClient.validateDimension(BedrockEmbeddingFamily.COHERE, 512)); + } + + @Test + void titanV1RejectsDimensionsOtherThanItsFixedSize() { + assertThrows( + IllegalArgumentException.class, + () -> BedrockEmbeddingClient.validateDimension(BedrockEmbeddingFamily.TITAN_V1, 1024)); + } + + @Test + void fixedDimensionFamiliesAcceptTheirFixedDimension() { + BedrockEmbeddingClient.validateDimension(BedrockEmbeddingFamily.COHERE, 1024); + BedrockEmbeddingClient.validateDimension(BedrockEmbeddingFamily.TITAN_V1, 1536); + } + + @Test + void titanV2AcceptsAnyDimension() { + BedrockEmbeddingClient.validateDimension(BedrockEmbeddingFamily.TITAN_V2, 512); + BedrockEmbeddingClient.validateDimension(BedrockEmbeddingFamily.TITAN_V2, 256); + } + + private static JsonNode buildPayload( + BedrockEmbeddingFamily family, String text, int dimension, boolean isQuery) throws Exception { + return MAPPER.readTree( + BedrockEmbeddingClient.buildRequestBody(family, text, dimension, isQuery)); + } +} From 0f0d267f700eb567c43ec88540e3a9ec38777cf2 Mon Sep 17 00:00:00 2001 From: shrabantipaul-collate Date: Thu, 9 Jul 2026 17:29:06 +0530 Subject: [PATCH 012/165] add missing intake-form-plural-description key (#29819) Co-authored-by: Shrabanti Paul --- .../src/main/resources/ui/src/locale/languages/ar-sa.json | 1 + .../src/main/resources/ui/src/locale/languages/de-de.json | 1 + .../src/main/resources/ui/src/locale/languages/en-us.json | 1 + .../src/main/resources/ui/src/locale/languages/es-es.json | 1 + .../src/main/resources/ui/src/locale/languages/fr-fr.json | 1 + .../src/main/resources/ui/src/locale/languages/gl-es.json | 1 + .../src/main/resources/ui/src/locale/languages/he-he.json | 1 + .../src/main/resources/ui/src/locale/languages/ja-jp.json | 1 + .../src/main/resources/ui/src/locale/languages/ko-kr.json | 1 + .../src/main/resources/ui/src/locale/languages/mr-in.json | 1 + .../src/main/resources/ui/src/locale/languages/nl-nl.json | 1 + .../src/main/resources/ui/src/locale/languages/pr-pr.json | 1 + .../src/main/resources/ui/src/locale/languages/pt-br.json | 1 + .../src/main/resources/ui/src/locale/languages/pt-pt.json | 1 + .../src/main/resources/ui/src/locale/languages/ru-ru.json | 1 + .../src/main/resources/ui/src/locale/languages/sv-se.json | 1 + .../src/main/resources/ui/src/locale/languages/th-th.json | 1 + .../src/main/resources/ui/src/locale/languages/tr-tr.json | 1 + .../src/main/resources/ui/src/locale/languages/zh-cn.json | 1 + .../src/main/resources/ui/src/locale/languages/zh-tw.json | 1 + 20 files changed, 20 insertions(+) diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json index 2b148f52899c..5f90bc8495e5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ar-sa.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "عند التعطيل، يتم حفظ نموذج الاستقبال ولكن لا يتم فرضه على مستوى الـ API.", "intake-form-native-fields-help": "الحقول المطلوبة وفق المخطط (الاسم والوصف وما إلى ذلك) تُفرض دائمًا ولا تظهر هنا. يمكن لنموذج الاستقبال هذا ترقية الحقول الاختيارية على مستوى المخطط فقط.", "intake-form-one-per-type-help": "يمكن وجود نموذج استقبال واحد فقط لكل نوع كيان. هذا هو نموذج الاستقبال الخاص بـ {{entityType}}.", + "intake-form-plural-description": "حدّد الحقول المطلوبة لسياسة الحوكمة لمنتجات البيانات والمجالات ومصطلحات المسرد. يُفرض على مستوى الـ API والواجهة معًا.", "intake-form-required-fields-help": "يحتاج كل حقل مطلوب إلى تسمية سهلة القراءة ومسار حقل. المسارات الأصلية تستخدم اسم السمة (مثل 'dataProductType')؛ ومسارات الخصائص المخصصة تستخدم 'extension.'.", "intake-form-updated-successfully": "تم تحديث نموذج الاستقبال بنجاح", "integration-description": "قم بتكوين التطبيقات والروبوتات لزيادة الإنتاجية.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json index 4220c5a75464..cf4c45a84636 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "Wenn deaktiviert, wird das Aufnahmeformular gespeichert, aber nicht auf API-Ebene durchgesetzt.", "intake-form-native-fields-help": "Schemapflichtige Felder (Name, Beschreibung usw.) werden immer durchgesetzt und hier nicht angezeigt. Nur Felder, die auf Schemaebene optional sind, können durch dieses Aufnahmeformular zu Pflichtfeldern gemacht werden.", "intake-form-one-per-type-help": "Pro Entitätstyp kann nur ein Aufnahmeformular existieren. Dies ist das Aufnahmeformular für {{entityType}}.", + "intake-form-plural-description": "Definieren Sie Governance-Pflichtfelder für Datenprodukte, Domänen und Glossarbegriffe. Wird sowohl auf API- als auch auf UI-Ebene durchgesetzt.", "intake-form-required-fields-help": "Jedes Pflichtfeld benötigt eine benutzerfreundliche Bezeichnung und einen Feldpfad. Native Pfade verwenden den Attributnamen (z. B. 'dataProductType'); Pfade benutzerdefinierter Eigenschaften verwenden 'extension.'.", "intake-form-updated-successfully": "Aufnahmeformular erfolgreich aktualisiert", "integration-description": "Konfigurieren Sie Anwendungen und Bots, um die Produktivität zu steigern.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json index 9423f5f1235e..75b34f530021 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "When disabled, the intake form is saved but not enforced at the API layer.", "intake-form-native-fields-help": "Schema-required fields (name, description, etc.) are always enforced and are not shown here. Only fields that are optional at the schema level can be promoted by this intake form.", "intake-form-one-per-type-help": "Only one intake form can exist per entity type. This is the intake form for {{entityType}}.", + "intake-form-plural-description": "Define governance-policy required fields for Data Products, Domains, and Glossary Terms. Enforced at both the API and UI layers.", "intake-form-required-fields-help": "Each required field needs a user-friendly label and a field path. Native paths use the attribute name (e.g., 'dataProductType'); custom property paths use 'extension.'.", "intake-form-updated-successfully": "Intake form updated successfully", "integration-description": "Configure applications and bots to amplify productivity.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json index 3d086d81519f..270e56b9ea48 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "Cuando está desactivado, el formulario de admisión se guarda pero no se aplica en la capa de la API.", "intake-form-native-fields-help": "Los campos obligatorios por esquema (nombre, descripción, etc.) siempre se aplican y no se muestran aquí. Este formulario de admisión solo puede promover campos que son opcionales a nivel de esquema.", "intake-form-one-per-type-help": "Solo puede existir un formulario de admisión por tipo de entidad. Este es el formulario de admisión para {{entityType}}.", + "intake-form-plural-description": "Define los campos obligatorios por política de gobernanza para Productos de datos, Dominios y Términos del glosario. Se aplica tanto en la capa de la API como en la de la interfaz.", "intake-form-required-fields-help": "Cada campo obligatorio necesita una etiqueta legible y una ruta de campo. Las rutas nativas usan el nombre del atributo (p. ej., 'dataProductType'); las rutas de propiedades personalizadas usan 'extension.'.", "intake-form-updated-successfully": "Formulario de admisión actualizado correctamente", "integration-description": "Configure aplicaciones y bots para amplificar la productividad.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json index 73ba6d76bc51..c5326edde670 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "Lorsqu'il est désactivé, le formulaire d'admission est enregistré mais non appliqué au niveau de l'API.", "intake-form-native-fields-help": "Les champs obligatoires du schéma (nom, description, etc.) sont toujours appliqués et ne sont pas affichés ici. Seuls les champs optionnels au niveau du schéma peuvent être promus par ce formulaire d'admission.", "intake-form-one-per-type-help": "Un seul formulaire d'admission peut exister par type d'entité. Ceci est le formulaire d'admission pour {{entityType}}.", + "intake-form-plural-description": "Définissez les champs obligatoires de la politique de gouvernance pour les Produits de données, Domaines et Termes du glossaire. Appliqué à la fois au niveau de l'API et de l'interface.", "intake-form-required-fields-help": "Chaque champ obligatoire nécessite un libellé lisible et un chemin de champ. Les chemins natifs utilisent le nom de l'attribut (p. ex. 'dataProductType') ; les chemins de propriétés personnalisées utilisent 'extension.'.", "intake-form-updated-successfully": "Formulaire d'admission mis à jour avec succès", "integration-description": "Configureez les applications et bots pour augmenter votre productivité.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json index c3f891bfc2ae..e55affc1e8be 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/gl-es.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "Cando está desactivado, o formulario de admisión gárdase pero non se aplica na capa da API.", "intake-form-native-fields-help": "Os campos obrigatorios por esquema (nome, descrición, etc.) sempre se aplican e non se amosan aquí. Este formulario de admisión só pode promover campos que son opcionais a nivel de esquema.", "intake-form-one-per-type-help": "Só pode existir un formulario de admisión por tipo de entidade. Este é o formulario de admisión para {{entityType}}.", + "intake-form-plural-description": "Define os campos obrigatorios por política de gobernanza para Produtos de datos, Dominios e Termos do glosario. Aplícase tanto na capa da API como na da interface.", "intake-form-required-fields-help": "Cada campo obrigatorio necesita unha etiqueta lexible e unha ruta de campo. As rutas nativas usan o nome do atributo (p. ex., 'dataProductType'); as rutas de propiedades personalizadas usan 'extension.'.", "intake-form-updated-successfully": "Formulario de admisión actualizado correctamente", "integration-description": "Configura aplicacións e bots para amplificar a produtividade.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json index 0cd7aa68e986..7acf0555ef68 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "כאשר מושבת, טופס הקליטה נשמר אך אינו נאכף בשכבת ה-API.", "intake-form-native-fields-help": "שדות חובה לפי הסכימה (שם, תיאור וכו') נאכפים תמיד ואינם מוצגים כאן. טופס קליטה זה יכול לקדם רק שדות שהם אופציונליים ברמת הסכימה.", "intake-form-one-per-type-help": "יכול להתקיים רק טופס קליטה אחד לכל סוג ישות. זהו טופס הקליטה עבור {{entityType}}.", + "intake-form-plural-description": "הגדר שדות חובה של מדיניות ממשל עבור מוצרי נתונים, תחומים ומונחי מילון. נאכף הן בשכבת ה-API והן בשכבת הממשק.", "intake-form-required-fields-help": "כל שדה חובה זקוק לתווית קריאה ולנתיב שדה. נתיבים מקוריים משתמשים בשם התכונה (לדוגמה 'dataProductType'); נתיבי מאפיינים מותאמים אישית משתמשים ב-'extension.'.", "intake-form-updated-successfully": "טופס הקליטה עודכן בהצלחה", "integration-description": "הגדר יישומים ובוטים להגברת הפרודוקטיביות.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json index e736b21b4386..c88966de4820 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "無効にすると、受付フォームは保存されますが、API 層では適用されません。", "intake-form-native-fields-help": "スキーマ必須フィールド(名前、説明など)は常に適用され、ここには表示されません。この受付フォームはスキーマレベルで任意のフィールドのみを必須に昇格できます。", "intake-form-one-per-type-help": "エンティティタイプごとに受付フォームは 1 つだけ存在できます。これは {{entityType}} の受付フォームです。", + "intake-form-plural-description": "データプロダクト、ドメイン、用語集の用語に対するガバナンスポリシーの必須フィールドを定義します。API 層と UI 層の両方で適用されます。", "intake-form-required-fields-help": "各必須フィールドには、わかりやすいラベルとフィールドパスが必要です。ネイティブパスは属性名を使用します(例: 'dataProductType')。カスタムプロパティのパスは 'extension.' を使用します。", "intake-form-updated-successfully": "受付フォームが正常に更新されました", "integration-description": "生産性を高めるためにアプリケーションやボットを設定しましょう。", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json index 7697e51927d7..47a089226bac 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ko-kr.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "비활성화하면 접수 양식은 저장되지만 API 계층에서 적용되지 않습니다.", "intake-form-native-fields-help": "스키마 필수 필드(이름, 설명 등)는 항상 적용되며 여기에 표시되지 않습니다. 이 접수 양식은 스키마 수준에서 선택 사항인 필드만 필수로 승격할 수 있습니다.", "intake-form-one-per-type-help": "엔터티 유형당 하나의 접수 양식만 존재할 수 있습니다. 이것은 {{entityType}}의 접수 양식입니다.", + "intake-form-plural-description": "데이터 제품, 도메인 및 용어집 용어에 대한 거버넌스 정책 필수 필드를 정의합니다. API 계층과 UI 계층 모두에서 적용됩니다.", "intake-form-required-fields-help": "각 필수 필드에는 사용자 친화적인 레이블과 필드 경로가 필요합니다. 네이티브 경로는 속성 이름을 사용합니다(예: 'dataProductType'). 사용자 지정 속성 경로는 'extension.'을 사용합니다.", "intake-form-updated-successfully": "접수 양식이 성공적으로 업데이트되었습니다", "integration-description": "생산성을 높이기 위해 애플리케이션과 봇을 구성합니다.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json index ca4327de18cd..731a557be798 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/mr-in.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "अक्षम केल्यावर, प्रवेश फॉर्म जतन केला जातो पण API स्तरावर अंमलात आणला जात नाही.", "intake-form-native-fields-help": "स्कीमा-आवश्यक फील्ड (नाव, वर्णन इ.) नेहमी अंमलात आणली जातात आणि येथे दर्शविली जात नाहीत. हा प्रवेश फॉर्म फक्त स्कीमा स्तरावर ऐच्छिक असलेली फील्डच आवश्यक बनवू शकतो.", "intake-form-one-per-type-help": "प्रत्येक एंटिटी प्रकारासाठी फक्त एकच प्रवेश फॉर्म असू शकतो. हा {{entityType}} साठीचा प्रवेश फॉर्म आहे.", + "intake-form-plural-description": "डेटा उत्पादने, डोमेन आणि शब्दकोश संज्ञांसाठी प्रशासन-धोरण आवश्यक फील्ड परिभाषित करा. API आणि UI दोन्ही स्तरांवर अंमलात आणले जाते.", "intake-form-required-fields-help": "प्रत्येक आवश्यक फील्डला वापरकर्ता-अनुकूल लेबल आणि फील्ड पथ आवश्यक आहे. मूळ पथ विशेषता नाव वापरतात (उदा. 'dataProductType'); सानुकूल गुणधर्म पथ 'extension.' वापरतात.", "intake-form-updated-successfully": "प्रवेश फॉर्म यशस्वीरित्या अद्यतनित झाला", "integration-description": "उत्पादकता वाढवण्यासाठी अनुप्रयोग आणि बॉट्स कॉन्फिगर करा.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json index 6ccd3001e4a1..c7a3c319273a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "Indien uitgeschakeld wordt het aanmeldformulier opgeslagen, maar niet afgedwongen op de API-laag.", "intake-form-native-fields-help": "Schemaverplichte velden (naam, beschrijving, enz.) worden altijd afgedwongen en worden hier niet getoond. Alleen velden die op schemaniveau optioneel zijn, kunnen door dit aanmeldformulier verplicht worden gesteld.", "intake-form-one-per-type-help": "Er kan slechts één aanmeldformulier per entiteitstype bestaan. Dit is het aanmeldformulier voor {{entityType}}.", + "intake-form-plural-description": "Definieer verplichte velden voor governancebeleid voor Dataproducten, Domeinen en Woordenlijsttermen. Afgedwongen op zowel de API- als de UI-laag.", "intake-form-required-fields-help": "Elk verplicht veld heeft een leesbaar label en een veldpad nodig. Native paden gebruiken de attribuutnaam (bijv. 'dataProductType'); paden van aangepaste eigenschappen gebruiken 'extension.'.", "intake-form-updated-successfully": "Aanmeldformulier succesvol bijgewerkt", "integration-description": "Configureer applicaties en bots voor hogere productiviteit.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json index d82b02b239e5..d0bef967672d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "هنگام غیرفعال بودن، فرم پذیرش ذخیره می‌شود اما در لایه API اعمال نمی‌شود.", "intake-form-native-fields-help": "فیلدهای الزامی طرح‌واره (نام، توضیحات و غیره) همیشه اعمال می‌شوند و در اینجا نمایش داده نمی‌شوند. این فرم پذیرش تنها می‌تواند فیلدهایی را که در سطح طرح‌واره اختیاری هستند الزامی کند.", "intake-form-one-per-type-help": "برای هر نوع موجودیت تنها یک فرم پذیرش می‌تواند وجود داشته باشد. این فرم پذیرش برای {{entityType}} است.", + "intake-form-plural-description": "فیلدهای الزامی سیاست حاکمیتی را برای محصولات داده، دامنه‌ها و اصطلاحات واژه‌نامه تعریف کنید. هم در لایه API و هم در لایه رابط کاربری اعمال می‌شود.", "intake-form-required-fields-help": "هر فیلد الزامی به یک برچسب خوانا و یک مسیر فیلد نیاز دارد. مسیرهای بومی از نام صفت استفاده می‌کنند (مثلاً 'dataProductType')؛ مسیرهای ویژگی سفارشی از 'extension.' استفاده می‌کنند.", "intake-form-updated-successfully": "فرم پذیرش با موفقیت به‌روزرسانی شد", "integration-description": "برنامه‌ها و بات‌ها را پیکربندی کنید تا بهره‌وری را افزایش دهید.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json index 76690bf54aa1..c1ae6808bd42 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "Quando desativado, o formulário de entrada é salvo, mas não é aplicado na camada da API.", "intake-form-native-fields-help": "Campos obrigatórios do esquema (nome, descrição etc.) são sempre aplicados e não são exibidos aqui. Apenas campos opcionais no nível do esquema podem ser promovidos por este formulário de entrada.", "intake-form-one-per-type-help": "Só pode existir um formulário de entrada por tipo de entidade. Este é o formulário de entrada para {{entityType}}.", + "intake-form-plural-description": "Defina os campos obrigatórios da política de governança para Produtos de dados, Domínios e Termos do glossário. Aplicado nas camadas de API e de interface.", "intake-form-required-fields-help": "Cada campo obrigatório precisa de um rótulo legível e de um caminho de campo. Caminhos nativos usam o nome do atributo (por exemplo, 'dataProductType'); caminhos de propriedades personalizadas usam 'extension.'.", "intake-form-updated-successfully": "Formulário de entrada atualizado com sucesso", "integration-description": "Configure aplicações e bots para melhorar a produtividade.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json index 381933a1aa98..31c5cd6c452f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-pt.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "Quando desativado, o formulário de admissão é guardado, mas não é aplicado na camada da API.", "intake-form-native-fields-help": "Os campos obrigatórios do esquema (nome, descrição, etc.) são sempre aplicados e não são apresentados aqui. Apenas os campos opcionais ao nível do esquema podem ser promovidos por este formulário de admissão.", "intake-form-one-per-type-help": "Só pode existir um formulário de admissão por tipo de entidade. Este é o formulário de admissão para {{entityType}}.", + "intake-form-plural-description": "Defina os campos obrigatórios da política de governação para Produtos de dados, Domínios e Termos do glossário. Aplicado nas camadas da API e da interface.", "intake-form-required-fields-help": "Cada campo obrigatório precisa de uma etiqueta legível e de um caminho de campo. Os caminhos nativos usam o nome do atributo (por exemplo, 'dataProductType'); os caminhos de propriedades personalizadas usam 'extension.'.", "intake-form-updated-successfully": "Formulário de admissão atualizado com sucesso", "integration-description": "Configure aplicações e bots para melhorar a produtividade.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json index 75c311f0ebf5..54f9213c1a98 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "Если отключено, форма приёма сохраняется, но не применяется на уровне API.", "intake-form-native-fields-help": "Обязательные по схеме поля (имя, описание и т. д.) всегда применяются и здесь не отображаются. Эта форма приёма может делать обязательными только поля, опциональные на уровне схемы.", "intake-form-one-per-type-help": "Для каждого типа сущности может существовать только одна форма приёма. Это форма приёма для {{entityType}}.", + "intake-form-plural-description": "Определите обязательные поля политики управления для продуктов данных, доменов и терминов глоссария. Применяется как на уровне API, так и на уровне интерфейса.", "intake-form-required-fields-help": "Каждому обязательному полю нужны понятная метка и путь поля. Нативные пути используют имя атрибута (например, 'dataProductType'); пути пользовательских свойств используют 'extension.'.", "intake-form-updated-successfully": "Форма приёма успешно обновлена", "integration-description": "Настройте приложения и ботов для повышения производительности.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json index 485f5c02a71f..2c05c546e0d3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/sv-se.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "When disabled, the intake form is saved but not enforced at the API layer.", "intake-form-native-fields-help": "Schema-required fields (name, description, etc.) are always enforced and are not shown here. Only fields that are optional at the schema level can be promoted by this intake form.", "intake-form-one-per-type-help": "Only one intake form can exist per entity type. This is the intake form for {{entityType}}.", + "intake-form-plural-description": "Define governance-policy required fields for Data Products, Domains, and Glossary Terms. Enforced at both the API and UI layers.", "intake-form-required-fields-help": "Each required field needs a user-friendly label and a field path. Native paths use the attribute name (e.g., 'dataProductType'); custom property paths use 'extension.'.", "intake-form-updated-successfully": "Intake form updated successfully", "integration-description": "Konfigurera applikationer och botar för att öka produktiviteten.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json index 64196ca1adfc..2330854efc74 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/th-th.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "เมื่อปิดใช้งาน แบบฟอร์มรับจะถูกบันทึกแต่ไม่ถูกบังคับใช้ในชั้น API", "intake-form-native-fields-help": "ฟิลด์ที่จำเป็นตามสคีมา (ชื่อ คำอธิบาย ฯลฯ) จะถูกบังคับใช้เสมอและไม่แสดงที่นี่ แบบฟอร์มรับนี้สามารถยกระดับได้เฉพาะฟิลด์ที่เป็นทางเลือกในระดับสคีมาเท่านั้น", "intake-form-one-per-type-help": "แต่ละประเภทเอนทิตีมีแบบฟอร์มรับได้เพียงหนึ่งเดียว นี่คือแบบฟอร์มรับสำหรับ {{entityType}}", + "intake-form-plural-description": "กำหนดฟิลด์ที่จำเป็นตามนโยบายการกำกับดูแลสำหรับผลิตภัณฑ์ข้อมูล โดเมน และคำศัพท์ในอภิธานศัพท์ บังคับใช้ทั้งในชั้น API และชั้นส่วนติดต่อผู้ใช้", "intake-form-required-fields-help": "ฟิลด์ที่จำเป็นแต่ละฟิลด์ต้องมีป้ายกำกับที่อ่านง่ายและพาธของฟิลด์ พาธเนทีฟใช้ชื่อแอตทริบิวต์ (เช่น 'dataProductType') ส่วนพาธของคุณสมบัติที่กำหนดเองใช้ 'extension.'", "intake-form-updated-successfully": "อัปเดตแบบฟอร์มรับสำเร็จ", "integration-description": "กำหนดค่าแอปพลิเคชันและบอทเพื่อเพิ่มผลผลิต", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json index a9640a763aa8..060a434b9d21 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/tr-tr.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "Devre dışı bırakıldığında giriş formu kaydedilir ancak API katmanında uygulanmaz.", "intake-form-native-fields-help": "Şema tarafından zorunlu kılınan alanlar (ad, açıklama vb.) her zaman uygulanır ve burada gösterilmez. Bu giriş formu yalnızca şema düzeyinde isteğe bağlı olan alanları zorunlu hale getirebilir.", "intake-form-one-per-type-help": "Her varlık türü için yalnızca bir giriş formu olabilir. Bu, {{entityType}} için giriş formudur.", + "intake-form-plural-description": "Veri Ürünleri, Etki Alanları ve Sözlük Terimleri için yönetişim politikası zorunlu alanlarını tanımlayın. Hem API hem de arayüz katmanında uygulanır.", "intake-form-required-fields-help": "Her zorunlu alan, kullanıcı dostu bir etiket ve bir alan yolu gerektirir. Yerel yollar öznitelik adını kullanır (örn. 'dataProductType'); özel özellik yolları 'extension.' kullanır.", "intake-form-updated-successfully": "Giriş formu başarıyla güncellendi", "integration-description": "Üretkenliği artırmak için uygulamaları ve botları yapılandırın.", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json index c33085f43bc9..7454da24cab1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "禁用时,接收表单会被保存,但不会在 API 层强制执行。", "intake-form-native-fields-help": "架构必填字段(名称、描述等)始终强制执行,此处不予显示。此接收表单只能提升在架构层为可选的字段。", "intake-form-one-per-type-help": "每种实体类型只能存在一个接收表单。这是 {{entityType}} 的接收表单。", + "intake-form-plural-description": "为数据产品、域和术语表术语定义治理策略必填字段。在 API 层和界面层均强制执行。", "intake-form-required-fields-help": "每个必填字段都需要一个易读的标签和一个字段路径。原生路径使用属性名称(例如 'dataProductType');自定义属性路径使用 'extension.'。", "intake-form-updated-successfully": "接收表单更新成功", "integration-description": "配置应用和机器人以提高生产力", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json index ad15d1948fc5..bd5dfb4f1c44 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-tw.json @@ -3344,6 +3344,7 @@ "intake-form-enabled-help": "停用時,接收表單會被儲存,但不會在 API 層強制執行。", "intake-form-native-fields-help": "結構描述必填欄位(名稱、描述等)一律強制執行,此處不予顯示。此接收表單只能提升在結構描述層為選填的欄位。", "intake-form-one-per-type-help": "每種實體類型只能存在一個接收表單。這是 {{entityType}} 的接收表單。", + "intake-form-plural-description": "為資料產品、網域和詞彙表術語定義治理政策必填欄位。在 API 層和介面層皆強制執行。", "intake-form-required-fields-help": "每個必填欄位都需要一個易讀的標籤和一個欄位路徑。原生路徑使用屬性名稱(例如 'dataProductType');自訂屬性路徑使用 'extension.'。", "intake-form-updated-successfully": "接收表單更新成功", "integration-description": "設定應用程式和機器人以提高生產力。", From 44ccae02d480a416451ee4044ca39b2107f0f299 Mon Sep 17 00:00:00 2001 From: Harsh Vador <58542468+harsh-vador@users.noreply.github.com> Date: Thu, 9 Jul 2026 19:21:53 +0530 Subject: [PATCH 013/165] fix(ui): stop product tour Explore step from loading real data (pre-mount + tour-aware tree) (#29867) --- .../src/pages/TourPage/TourPage.component.tsx | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TourPage/TourPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TourPage/TourPage.component.tsx index 3343f663bd10..0923fae609c9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TourPage/TourPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TourPage/TourPage.component.tsx @@ -153,21 +153,32 @@ const TourPage = () => { }; }, [updateIsTourOpen]); - const currentPageComponent = useMemo(() => { - switch (currentTourPage) { - case CurrentTourPageType.MY_DATA_PAGE: - return ; - - case CurrentTourPageType.EXPLORE_PAGE: - return ; - - case CurrentTourPageType.DATASET_PAGE: - return ; + const isExplorePage = currentTourPage === CurrentTourPageType.EXPLORE_PAGE; + // Pre-mount Explore (hidden) during the MyData phase so it stays mounted into + // the Explore step — react-tour closes a step whose target is missing on + // activation, and the redesigned Explore can't mount within its stepWaitTimer. + const shouldRenderExplore = + currentTourPage === CurrentTourPageType.MY_DATA_PAGE || isExplorePage; + const exploreStyle = useMemo( + () => ({ display: isExplorePage ? undefined : 'none' }), + [isExplorePage] + ); - default: - return; - } - }, [currentTourPage]); + const currentPageComponent = useMemo(() => { + return ( + <> + {currentTourPage === CurrentTourPageType.MY_DATA_PAGE && } + {shouldRenderExplore && ( +
+ +
+ )} + {currentTourPage === CurrentTourPageType.DATASET_PAGE && ( + + )} + + ); + }, [currentTourPage, shouldRenderExplore, exploreStyle, t]); const tourSteps = useMemo( () => From 5c2e1e7720da1ea920e1666eecd43efaf51380b6 Mon Sep 17 00:00:00 2001 From: Sriharsha Chintalapani Date: Thu, 9 Jul 2026 10:03:06 -0700 Subject: [PATCH 014/165] Tune search relevance ranking and debug details (#29853) * Tune search relevance ranking * Add search relevance Playwright shard * Update generated TypeScript types * Expose ranking settings debug controls * Add customer search relevance fixtures * Fix search settings coverage test * Fix ranking settings edge cases * Fix unnamed ranking stage updates * Fix search IT ranking isolation * Fix stale definition reindex stats assertion * Fix staged search ranking regressions * Address search ranking review and CI flakes * Fix data quality delete modal flow * Fix ranked search dropping identifier and ngram matches The staged ranking query in SearchRankingHelper silently dropped matches the legacy query returned, and it replaces (not augments) that query, so entities vanished from explore/global search once ranking is default-on after the migration. 1. significantTokens split the query on every non-alphanumeric character, so an identifier query like "sample_data" became ["sample", "data"]. Name and FQN fields keep the identifier intact (keyword fqnParts part "sample_data", om_analyzer compound token), so the split query matched none of them and searching a service or database name returned almost nothing. Split on whitespace only: stop-word removal still applies on word boundaries ("provider address in texas" -> "provider address texas") while identifiers stay intact and match fqnParts/name compound tokens again. 2. Every derived stage routed name fields through exact/close derivation, both of which drop .ngram, so no stage carried name.ngram and substring queries like "ord" stopped matching "orders_fact". Add a partialName n-gram stage and derive the configured .ngram name fields for it. Shared helper, so both the Elasticsearch and OpenSearch factories are fixed. Verified live against OpenSearch: "sample_data" 1 -> 7 hits, "ord" 1 -> 11. Co-authored-by: Pere Miquel Brull --- .github/workflows/mysql-nightly-e2e.yml | 16 +- .../workflows/playwright-postgresql-e2e.yml | 20 +- .github/workflows/postgresql-nightly-e2e.yml | 16 +- .../sample_data/api_service/api_endpoint.json | 58 +- .../sample_data/dashboards/dashboards.json | 20 + .../examples/sample_data/datasets/query_log | 40 +- .../examples/sample_data/datasets/tables.json | 673 +++++++++++++++++- .../examples/sample_data/models/models.json | 70 ++ .../sample_data/pipelines/pipelines.json | 34 +- .../searchIndexes/searchIndexes.json | 70 +- .../sample_data/storage/containers.json | 86 +++ .../examples/sample_data/topics/topics.json | 20 +- .../it/search/SearchSettingsTestHelper.java | 22 + .../search/SearchRelevancyPreviewIT.java | 16 +- .../it/tests/search/SearchScoringIT.java | 12 +- .../TestCaseStaleDefinitionReindexIT.java | 31 +- .../ui/pages/TableDataQualityPage.java | 3 +- .../migration/mysql/v200/Migration.java | 2 + .../migration/postgres/v200/Migration.java | 2 + .../migration/utils/v200/MigrationUtil.java | 117 +++ .../system/SearchSettingsHandler.java | 78 ++ .../service/search/SearchRankingHelper.java | 371 ++++++++++ .../elasticsearch/ElasticQueryBuilder.java | 193 ++++- .../elasticsearch/ElasticSearchClient.java | 282 +++----- .../ElasticSearchSourceBuilderFactory.java | 528 +++++++------- .../search/opensearch/OpenSearchClient.java | 285 +++----- .../opensearch/OpenSearchQueryBuilder.java | 193 ++++- .../OpenSearchSourceBuilderFactory.java | 528 +++++++------- .../json/data/settings/searchSettings.json | 126 ++++ .../system/SearchSettingsHandlerTest.java | 25 + .../search/SearchRankingHelperTest.java | 212 ++++++ .../schema/configuration/searchSettings.json | 135 +++- .../e2e/Pages/CustomProperties.spec.ts | 9 +- .../e2e/Pages/SearchSettings.spec.ts | 9 + .../e2e/Search/SearchRelevance.spec.ts | 651 +++++++++++++++++ .../ui/playwright/utils/searchSettingUtils.ts | 22 + .../Explore/ExplorePage.interface.ts | 2 + .../ExploreSearchCard.interface.ts | 3 + .../ExploreSearchCard.test.tsx | 71 ++ .../ExploreSearchCard/ExploreSearchCard.tsx | 181 ++++- .../explore-search-card.less | 58 ++ .../ExploreV1/ExploreV1.component.tsx | 16 + .../src/components/ExploreV1/exploreV1.less | 6 +- .../EntitySearchSettings.test.tsx | 133 +++- .../EntitySearchSettings.tsx | 292 +++++++- .../entity-search-settings.less | 68 ++ .../FieldConfiguration.test.tsx | 6 +- .../FieldConfiguration/FieldConfiguration.tsx | 2 +- .../fieldConfiguration.interface.ts | 2 +- .../SearchPreview/SearchPreview.tsx | 63 +- .../SearchedData/SearchedData.interface.ts | 1 + .../components/SearchedData/SearchedData.tsx | 64 +- .../api/search/previewSearchRequest.ts | 119 +++- .../generated/configuration/searchSettings.ts | 119 +++- .../ui/src/generated/settings/settings.ts | 119 +++- .../ui/src/interface/search.interface.ts | 9 + .../ui/src/locale/languages/ar-sa.json | 12 + .../ui/src/locale/languages/de-de.json | 12 + .../ui/src/locale/languages/en-us.json | 12 + .../ui/src/locale/languages/es-es.json | 12 + .../ui/src/locale/languages/fr-fr.json | 12 + .../ui/src/locale/languages/gl-es.json | 12 + .../ui/src/locale/languages/he-he.json | 12 + .../ui/src/locale/languages/ja-jp.json | 12 + .../ui/src/locale/languages/ko-kr.json | 12 + .../ui/src/locale/languages/mr-in.json | 12 + .../ui/src/locale/languages/nl-nl.json | 12 + .../ui/src/locale/languages/pr-pr.json | 12 + .../ui/src/locale/languages/pt-br.json | 12 + .../ui/src/locale/languages/pt-pt.json | 12 + .../ui/src/locale/languages/ru-ru.json | 12 + .../ui/src/locale/languages/sv-se.json | 12 + .../ui/src/locale/languages/th-th.json | 12 + .../ui/src/locale/languages/tr-tr.json | 12 + .../ui/src/locale/languages/zh-cn.json | 12 + .../ui/src/locale/languages/zh-tw.json | 12 + .../ExplorePage/ExplorePageV1.component.tsx | 7 + .../main/resources/ui/src/rest/searchAPI.ts | 2 + .../resources/ui/src/utils/ExploreUtils.tsx | 4 + .../ui/src/utils/SearchSettingsUtils.test.ts | 41 ++ .../ui/src/utils/SearchSettingsUtils.ts | 170 +++++ 81 files changed, 5781 insertions(+), 992 deletions(-) create mode 100644 openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRankingHelper.java create mode 100644 openmetadata-service/src/test/java/org/openmetadata/service/search/SearchRankingHelperTest.java create mode 100644 openmetadata-ui/src/main/resources/ui/playwright/e2e/Search/SearchRelevance.spec.ts create mode 100644 openmetadata-ui/src/main/resources/ui/src/utils/SearchSettingsUtils.test.ts diff --git a/.github/workflows/mysql-nightly-e2e.yml b/.github/workflows/mysql-nightly-e2e.yml index c7a88991516a..7fa8910c5528 100644 --- a/.github/workflows/mysql-nightly-e2e.yml +++ b/.github/workflows/mysql-nightly-e2e.yml @@ -42,8 +42,8 @@ jobs: strategy: fail-fast: false matrix: - shardIndex: [1, 2, 3, 4, 5, 6] - shardTotal: [6] + shardIndex: [1, 2, 3, 4, 5, 6, 7] + shardTotal: [7] steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -94,9 +94,17 @@ jobs: --project=DataAssetRulesEnabled \ --project=DataAssetRulesDisabled + elif [ "${{ matrix.shardIndex }}" -eq "2" ]; then + echo "🔹 Running search relevance tests on shard 2" + + npx playwright test \ + --project=search-nightly \ + playwright/e2e/Search/SearchRelevance.spec.ts \ + --workers=1 + else - # Shards 2-6 handle chromium tests (5 shards total) - CHROMIUM_SHARD=$(( ${{ matrix.shardIndex }} - 1 )) + # Shards 3-7 handle chromium tests (5 shards total) + CHROMIUM_SHARD=$(( ${{ matrix.shardIndex }} - 2 )) echo "🔹 Running all tests (excluding DataAssetRules) on chromium shard ${CHROMIUM_SHARD}/5" npx playwright test \ --project=chromium \ diff --git a/.github/workflows/playwright-postgresql-e2e.yml b/.github/workflows/playwright-postgresql-e2e.yml index 908916407016..49c0a48924cc 100644 --- a/.github/workflows/playwright-postgresql-e2e.yml +++ b/.github/workflows/playwright-postgresql-e2e.yml @@ -173,7 +173,7 @@ jobs: ALL_FILES: ${{ steps.all-changes.outputs.all_changed_files }} SPEC_FILES: ${{ steps.changed-specs.outputs.all_changed_files }} run: | - FULL_MATRIX='{"shardIndex":[1,2,3,4,5,6],"shardTotal":[6]}' + FULL_MATRIX='{"shardIndex":[1,2,3,4,5,6,7],"shardTotal":[7]}' SPEC_MATRIX='{"shardIndex":[1],"shardTotal":[1]}' ALL_COUNT=$(echo "$ALL_FILES" | wc -w) @@ -273,10 +273,14 @@ jobs: if echo "$CHANGED_SPECS" | tr ' ' '\n' | grep -q "DomainIsolation/"; then PROJECT_ARGS="$PROJECT_ARGS --project=DomainIsolation" fi + # Search relevance specs use the dedicated search-nightly project. + if echo "$CHANGED_SPECS" | tr ' ' '\n' | grep -q "playwright/e2e/Search/"; then + PROJECT_ARGS="$PROJECT_ARGS --project=search-nightly" + fi # Regular chromium specs: anything not in a special-project category. # Also add Basic because chromium has grepInvert:[@basic], so @basic-tagged tests # in the changed files would be silently skipped without it. - if echo "$CHANGED_SPECS" | tr ' ' '\n' | grep -qvE "(DataAssetRulesEnabled\.spec\.ts|DataAssetRulesDisabled\.spec\.ts|SearchRBAC\.spec\.ts|DomainIsolation/)"; then + if echo "$CHANGED_SPECS" | tr ' ' '\n' | grep -qvE "(DataAssetRulesEnabled\.spec\.ts|DataAssetRulesDisabled\.spec\.ts|SearchRBAC\.spec\.ts|DomainIsolation/|playwright/e2e/Search/)"; then PROJECT_ARGS="$PROJECT_ARGS --project=chromium --project=Basic" fi @@ -296,9 +300,17 @@ jobs: --project=SearchRBAC \ --project=DomainIsolation \ + elif [ "${{ matrix.shardIndex }}" -eq "2" ]; then + echo "🔹 Running search relevance tests on shard 2" + + npx playwright test \ + --project=search-nightly \ + playwright/e2e/Search/SearchRelevance.spec.ts \ + --workers=1 + else - # Shards 2-6 run common chromium tests equally distributed (5-way sharding) - CHROMIUM_SHARD=$(( ${{ matrix.shardIndex }} - 1 )) + # Shards 3-7 run common chromium tests equally distributed (5-way sharding) + CHROMIUM_SHARD=$(( ${{ matrix.shardIndex }} - 2 )) echo "🔹 Running common chromium tests on shard ${CHROMIUM_SHARD}/5" npx playwright test \ --project=chromium \ diff --git a/.github/workflows/postgresql-nightly-e2e.yml b/.github/workflows/postgresql-nightly-e2e.yml index 0fe147188ebd..e5f3ac715eb3 100644 --- a/.github/workflows/postgresql-nightly-e2e.yml +++ b/.github/workflows/postgresql-nightly-e2e.yml @@ -42,8 +42,8 @@ jobs: strategy: fail-fast: false matrix: - shardIndex: [1, 2, 3, 4, 5, 6] - shardTotal: [6] + shardIndex: [1, 2, 3, 4, 5, 6, 7] + shardTotal: [7] steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -94,9 +94,17 @@ jobs: --project=DataAssetRulesEnabled \ --project=DataAssetRulesDisabled + elif [ "${{ matrix.shardIndex }}" -eq "2" ]; then + echo "🔹 Running search relevance tests on shard 2" + + npx playwright test \ + --project=search-nightly \ + playwright/e2e/Search/SearchRelevance.spec.ts \ + --workers=1 + else - # Shards 2-5 handle chromium tests (5 shards total) - CHROMIUM_SHARD=$(( ${{ matrix.shardIndex }} - 1 )) + # Shards 3-7 handle chromium tests (5 shards total) + CHROMIUM_SHARD=$(( ${{ matrix.shardIndex }} - 2 )) echo "🔹 Running all tests (excluding DataAssetRules) on chromium shard ${CHROMIUM_SHARD}/5" npx playwright test \ --project=chromium \ diff --git a/ingestion/examples/sample_data/api_service/api_endpoint.json b/ingestion/examples/sample_data/api_service/api_endpoint.json index bbcb5837de96..b13c947af8b4 100644 --- a/ingestion/examples/sample_data/api_service/api_endpoint.json +++ b/ingestion/examples/sample_data/api_service/api_endpoint.json @@ -266,6 +266,62 @@ "description": "Delete pet by ID", "endpointURL": "https://petstore3.swagger.io/#/pet/deletePet", "requestMethod": "DELETE" + }, + { + "name": "provider_address_texas_endpoint", + "apiCollection": "sample_api_service.pet", + "displayName": "Provider Address Texas Endpoint", + "description": "Search relevancy fixture endpoint for provider address Texas lookups.", + "endpointURL": "https://petstore3.swagger.io/#/pet/providerAddressTexas", + "requestMethod": "GET", + "responseSchema": { + "schemaType": "JSON", + "schemaFields": [ + { + "name": "provider_id", + "dataType": "INT", + "description": "Provider identifier" + }, + { + "name": "provider_address", + "dataType": "STRING", + "description": "Provider address" + }, + { + "name": "texas_region", + "dataType": "STRING", + "description": "Texas region" + } + ] + } + }, + { + "name": "customer_profiles_endpoint", + "apiCollection": "sample_api_service.pet", + "displayName": "Customer Profiles Endpoint", + "description": "Search relevancy fixture endpoint for customer profiles lookups.", + "endpointURL": "https://petstore3.swagger.io/#/pet/customerProfiles", + "requestMethod": "GET", + "responseSchema": { + "schemaType": "JSON", + "schemaFields": [ + { + "name": "customer_id", + "dataType": "INT", + "description": "Customer identifier" + }, + { + "name": "customer_profile_id", + "dataType": "STRING", + "description": "Customer profile identifier" + }, + { + "name": "profile_status", + "dataType": "STRING", + "description": "Customer profile status" + } + ] + } } ] -} \ No newline at end of file +} diff --git a/ingestion/examples/sample_data/dashboards/dashboards.json b/ingestion/examples/sample_data/dashboards/dashboards.json index 4692bb567f53..d5351f20c531 100644 --- a/ingestion/examples/sample_data/dashboards/dashboards.json +++ b/ingestion/examples/sample_data/dashboards/dashboards.json @@ -120,6 +120,26 @@ "sourceUrl": "http://localhost:808/superset/dashboard/forecast_sales_performance/", "charts": ["sample_superset.211"], "href": "http://localhost:8585/api/v1/dashboards/d2b0af00-f419-4905-bb43-036697ce53a5" + }, + { + "name": "provider_address_texas_dashboard", + "displayName": "Provider Address Texas Dashboard", + "fullyQualifiedName": "sample_superset.provider_address_texas_dashboard", + "description": "Search relevancy fixture dashboard for provider address Texas reporting.", + "sourceUrl": "http://localhost:808/superset/dashboard/provider_address_texas_dashboard/", + "charts": ["sample_superset.210"], + "tags": [], + "href": "http://localhost:8585/api/v1/dashboards/provider_address_texas_dashboard" + }, + { + "name": "customer_profiles_dashboard", + "displayName": "Customer Profiles Dashboard", + "fullyQualifiedName": "sample_superset.customer_profiles_dashboard", + "description": "Search relevancy fixture dashboard for customer profiles reporting.", + "sourceUrl": "http://localhost:808/superset/dashboard/customer_profiles_dashboard/", + "charts": ["sample_superset.210"], + "tags": [], + "href": "http://localhost:8585/api/v1/dashboards/customer_profiles_dashboard" } ] } diff --git a/ingestion/examples/sample_data/datasets/query_log b/ingestion/examples/sample_data/datasets/query_log index 67953f5a8414..d610a662e715 100644 --- a/ingestion/examples/sample_data/datasets/query_log +++ b/ingestion/examples/sample_data/datasets/query_log @@ -1403,4 +1403,42 @@ query,cost,user "select * from shopify.raw_customer",12,admin "create table shopify.dim_address_clean as select address_id, shop_id, first_name, last_name, address1 as address, company, city, region, zip, country, phone from shopify.dim_address",0.5,admin "create table shopify.dim_address_clean as select address_id, shop_id, first_name, last_name, address1 as address, company, city, region, zip, country, phone from shopify.dim_address",0.5,admin -"select * from shopify.raw_customer limit 1",12,admin \ No newline at end of file +"select * from shopify.raw_customer limit 1",12,admin +"select provider_id, provider_address from shopify.provider_address",8,admin +"select provider_id, provider_address from shopify.provider_address",7,admin +"select job_id, provider_address from shopify.service_job_registry",6,admin +"select job_id, provider_address from shopify.service_job_registry",5,admin +"select work_id, service_type from shopify.work",160,admin +"select work_id, service_type from shopify.work",159,admin +"select work_id, service_type from shopify.work",158,admin +"select work_id, service_type from shopify.work",157,admin +"select work_id, service_type from shopify.work",156,admin +"select work_id, service_type from shopify.work",155,admin +"select work_id, service_type from shopify.work",154,admin +"select work_id, service_type from shopify.work",153,admin +"select work_id, service_type from shopify.work",152,admin +"select work_id, service_type from shopify.work",151,admin +"select work_id, service_type from shopify.work",150,admin +"select work_id, service_type from shopify.work",149,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",25,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",24,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",23,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",22,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",21,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",20,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",19,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",18,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",17,admin +"select record_id, region_name from shopify.regional_directory_tier1_usage",16,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",190,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",189,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",188,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",187,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",186,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",185,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",184,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",183,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",182,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",181,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",180,admin +"select case_id, support_queue from shopify.support_case_rollup_tier1_usage",179,admin diff --git a/ingestion/examples/sample_data/datasets/tables.json b/ingestion/examples/sample_data/datasets/tables.json index 1fac85a5a84a..01b58b4c246a 100644 --- a/ingestion/examples/sample_data/datasets/tables.json +++ b/ingestion/examples/sample_data/datasets/tables.json @@ -33636,6 +33636,677 @@ "appliedDate": 1767799745051, "expiryDate": 1799335745051 } + }, + { + "name": "provider_address", + "description": "Provider address lookup table used for canonical provider location matching. Search fixture: clear table-name match should rank ahead of popularity-only descriptive matches.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/provider_address", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE provider_address(provider_id NUMERIC PRIMARY KEY, provider_address VARCHAR(500), mailing_address VARCHAR(500), texas_region VARCHAR(100), network_status VARCHAR(50))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "provider_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the provider.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "provider_address", + "dataType": "VARCHAR", + "dataLength": 500, + "dataTypeDisplay": "varchar", + "description": "Canonical provider address.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "mailing_address", + "dataType": "VARCHAR", + "dataLength": 500, + "dataTypeDisplay": "varchar", + "description": "Mailing address for the provider.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "texas_region", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Texas operating region for the address.", + "tags": [], + "ordinalPosition": 4 + }, + { + "name": "network_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Operational network status.", + "tags": [], + "ordinalPosition": 5 + } + ], + "tags": [] + }, + { + "name": "provider_address_texas", + "description": "Canonical provider address table for Texas network locations. Search fixture: exact name should rank ahead of descriptive matches.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/provider_address_texas", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE provider_address_texas(provider_id NUMERIC PRIMARY KEY, provider_address VARCHAR(500), texas_region VARCHAR(100), network_status VARCHAR(50))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "provider_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the provider.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "provider_address", + "dataType": "VARCHAR", + "dataLength": 500, + "dataTypeDisplay": "varchar", + "description": "Normalized provider street address.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "texas_region", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Texas service region for the provider address.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "network_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Operational network status.", + "tags": [], + "ordinalPosition": 4 + } + ], + "tags": [] + }, + { + "name": "provider_directory", + "description": "Directory used by network operations teams for active healthcare providers.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/provider_directory", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE provider_directory(provider_id NUMERIC PRIMARY KEY, provider_address VARCHAR(500), texas_region VARCHAR(100), directory_status VARCHAR(50))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "provider_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the provider.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "provider_address", + "dataType": "VARCHAR", + "dataLength": 500, + "dataTypeDisplay": "varchar", + "description": "Provider address captured from source systems.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "texas_region", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Texas operating region.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "directory_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Status of the provider directory record.", + "tags": [], + "ordinalPosition": 4 + } + ], + "tags": [] + }, + { + "name": "service_job_registry", + "description": "Operational registry for dispatch jobs, billing checkpoints, and lifecycle status.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/service_job_registry", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE service_job_registry(job_id NUMERIC PRIMARY KEY, provider_address VARCHAR(500), texas_region VARCHAR(100), dispatch_status VARCHAR(50))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "job_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the service job.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "provider_address", + "dataType": "VARCHAR", + "dataLength": 500, + "dataTypeDisplay": "varchar", + "description": "Address captured on the service job.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "texas_region", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Texas operations region.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "dispatch_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Current dispatch status.", + "tags": [], + "ordinalPosition": 4 + } + ], + "tags": [] + }, + { + "name": "work", + "description": "Work table containing enriched service job attributes, Texas provider details, billing status, and lifecycle tracking. Search fixture: this table is intentionally Tier 1 and very high usage but only has a weak description match for provider and Texas.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/work", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE work(work_id NUMERIC PRIMARY KEY, service_type VARCHAR(100), assignee VARCHAR(100), billing_status VARCHAR(50), lifecycle_status VARCHAR(50))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "work_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the work record.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "service_type", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Type of service job.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "assignee", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Person assigned to the work item.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "billing_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Billing status for the work item.", + "tags": [], + "ordinalPosition": 4 + }, + { + "name": "lifecycle_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Lifecycle status of the work item.", + "tags": [], + "ordinalPosition": 5 + } + ], + "tags": [ + { + "tagFQN": "Tier.Tier1", + "description": "Tier 1 data - critical business data", + "source": "Classification", + "labelType": "Manual", + "state": "Confirmed" + } + ] + }, + { + "name": "regional_directory_tier1_usage", + "description": "Stores provider address in Texas and regional notes for data stewards. This fixture is intentionally Tier 1 and high usage but only matches in description.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/regional_directory_tier1_usage", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE regional_directory_tier1_usage(record_id NUMERIC PRIMARY KEY, region_name VARCHAR(100), steward_notes VARCHAR(500))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "record_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the regional record.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "region_name", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Region associated with this directory record.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "steward_notes", + "dataType": "VARCHAR", + "dataLength": 500, + "dataTypeDisplay": "varchar", + "description": "Free-form operational notes.", + "tags": [], + "ordinalPosition": 3 + } + ], + "tags": [ + { + "tagFQN": "Tier.Tier1", + "description": "Tier 1 data - critical business data", + "source": "Classification", + "labelType": "Manual", + "state": "Confirmed" + } + ] + }, + { + "name": "customer", + "displayName": "Customers", + "description": "Search relevancy fixture for singular customer records. The display name intentionally uses customers so singular and plural queries can be compared.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/customer", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE customer(customer_id NUMERIC PRIMARY KEY, customer_name VARCHAR(200), customer_email VARCHAR(200), customer_profile_status VARCHAR(50))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "customer_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the customer.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "customer_name", + "dataType": "VARCHAR", + "dataLength": 200, + "dataTypeDisplay": "varchar", + "description": "Customer full name.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "customer_email", + "dataType": "VARCHAR", + "dataLength": 200, + "dataTypeDisplay": "varchar", + "description": "Customer email address.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "customer_profile_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Status of the customer profile.", + "tags": [], + "ordinalPosition": 4 + } + ], + "tags": [] + }, + { + "name": "customers", + "displayName": "Customer", + "description": "Search relevancy fixture for plural customers records. The display name intentionally uses customer so plural and singular queries can be compared.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/customers", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE customers(customer_id NUMERIC PRIMARY KEY, customer_name VARCHAR(200), preferred_channel VARCHAR(100), lifecycle_status VARCHAR(50))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "customer_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the customer.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "customer_name", + "dataType": "VARCHAR", + "dataLength": 200, + "dataTypeDisplay": "varchar", + "description": "Customer full name.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "preferred_channel", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Preferred communication channel.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "lifecycle_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Lifecycle status for the customer.", + "tags": [], + "ordinalPosition": 4 + } + ], + "tags": [] + }, + { + "name": "customer_profile", + "displayName": "Customer Profile", + "description": "Search relevancy fixture for customer profile enrichment. Clear name matches should outrank high-signal tables that only mention customer profile in description.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/customer_profile", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE customer_profile(customer_id NUMERIC PRIMARY KEY, customer_profile_id VARCHAR(100), customer_profile_status VARCHAR(50), loyalty_segment VARCHAR(100), account_region VARCHAR(100))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "customer_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the customer.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "customer_profile_id", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Identifier for the customer profile.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "customer_profile_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Status of the customer profile.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "loyalty_segment", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Assigned loyalty segment.", + "tags": [], + "ordinalPosition": 4 + }, + { + "name": "account_region", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Region for the account.", + "tags": [], + "ordinalPosition": 5 + } + ], + "tags": [] + }, + { + "name": "customer_profiles", + "displayName": "Customer Profiles", + "description": "Search relevancy fixture for customers profile records. Close singular/plural name matches should rank before Tier 1 usage-only description matches.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/customer_profiles", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE customer_profiles(customer_id NUMERIC PRIMARY KEY, customer_profile_id VARCHAR(100), customer_profile_status VARCHAR(50), profile_score NUMERIC, loyalty_segment VARCHAR(100))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "customer_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the customer.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "customer_profile_id", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Identifier for the customer profile.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "customer_profile_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Status of the customer profile.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "profile_score", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Profile completeness score.", + "tags": [], + "ordinalPosition": 4 + }, + { + "name": "loyalty_segment", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Assigned loyalty segment.", + "tags": [], + "ordinalPosition": 5 + } + ], + "tags": [] + }, + { + "name": "identity_resolution_registry", + "description": "Registry used for identity resolution workflows. Search fixture: table name does not contain customer profile, but column names do.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/identity_resolution_registry", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE identity_resolution_registry(identity_id NUMERIC PRIMARY KEY, customer_profile_id VARCHAR(100), customer_profile_status VARCHAR(50), customers_matched_count NUMERIC, resolution_status VARCHAR(50))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "identity_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the identity record.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "customer_profile_id", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Matched customer profile identifier.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "customer_profile_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Status copied from the matched customer profile.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "customers_matched_count", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Number of customers matched into this identity.", + "tags": [], + "ordinalPosition": 4 + }, + { + "name": "resolution_status", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Current identity resolution status.", + "tags": [], + "ordinalPosition": 5 + } + ], + "tags": [] + }, + { + "name": "support_case_rollup_tier1_usage", + "description": "Support rollup used by executives. Search fixture: intentionally Tier 1 and very high usage while only mentioning customer profile status and customers in description.", + "version": 0.1, + "updatedAt": 1638354087391, + "updatedBy": "anonymous", + "href": "http://localhost:8585/api/v1/tables/support_case_rollup_tier1_usage", + "tableType": "Regular", + "schemaDefinition": "CREATE TABLE support_case_rollup_tier1_usage(case_id NUMERIC PRIMARY KEY, support_queue VARCHAR(100), case_priority VARCHAR(50), resolution_state VARCHAR(50), agent_team VARCHAR(100))", + "retentionPeriod": "30D", + "columns": [ + { + "name": "case_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the support case.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "support_queue", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Support queue for the case.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "case_priority", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Priority assigned to the support case.", + "tags": [], + "ordinalPosition": 3 + }, + { + "name": "resolution_state", + "dataType": "VARCHAR", + "dataLength": 50, + "dataTypeDisplay": "varchar", + "description": "Resolution state for the support case.", + "tags": [], + "ordinalPosition": 4 + }, + { + "name": "agent_team", + "dataType": "VARCHAR", + "dataLength": 100, + "dataTypeDisplay": "varchar", + "description": "Team assigned to resolve the support case.", + "tags": [], + "ordinalPosition": 5 + } + ], + "tags": [ + { + "tagFQN": "Tier.Tier1", + "description": "Tier 1 data - critical business data", + "source": "Classification", + "labelType": "Manual", + "state": "Confirmed" + } + ] } ] -} \ No newline at end of file +} diff --git a/ingestion/examples/sample_data/models/models.json b/ingestion/examples/sample_data/models/models.json index 1ecc79f98a29..24dbb63a44fc 100644 --- a/ingestion/examples/sample_data/models/models.json +++ b/ingestion/examples/sample_data/models/models.json @@ -135,5 +135,75 @@ "value": "42" } ] + }, + { + "name": "provider_address_texas_model", + "displayName": "Provider Address Texas Model", + "description": "Search relevancy fixture model for scoring provider address Texas coverage.", + "algorithm": "mlmodel", + "dashboard": "sample_superset.provider_address_texas_dashboard", + "mlStore": { + "storage": "mlflow-artifacts:/4/provider-address-texas/artifacts/model" + }, + "sourceUrl": "http://localhost:8088/#/models/provider_address_texas_model", + "mlFeatures": [ + { + "name": "provider_address_quality", + "dataType": "numerical" + }, + { + "name": "texas_region", + "dataType": "categorical" + }, + { + "name": "network_status", + "dataType": "categorical" + } + ], + "mlHyperParameters": [ + { + "name": "max_depth", + "value": "6" + }, + { + "name": "learning_rate", + "value": "0.05" + } + ] + }, + { + "name": "customer_profiles_model", + "displayName": "Customer Profiles Model", + "description": "Search relevancy fixture model for scoring customer profiles quality.", + "algorithm": "mlmodel", + "dashboard": "sample_superset.customer_profiles_dashboard", + "mlStore": { + "storage": "mlflow-artifacts:/5/customer-profiles/artifacts/model" + }, + "sourceUrl": "http://localhost:8088/#/models/customer_profiles_model", + "mlFeatures": [ + { + "name": "customer_profile_score", + "dataType": "numerical" + }, + { + "name": "profile_status", + "dataType": "categorical" + }, + { + "name": "loyalty_segment", + "dataType": "categorical" + } + ], + "mlHyperParameters": [ + { + "name": "max_depth", + "value": "6" + }, + { + "name": "learning_rate", + "value": "0.05" + } + ] } ] diff --git a/ingestion/examples/sample_data/pipelines/pipelines.json b/ingestion/examples/sample_data/pipelines/pipelines.json index 1df17887310c..e6a01ad8884e 100644 --- a/ingestion/examples/sample_data/pipelines/pipelines.json +++ b/ingestion/examples/sample_data/pipelines/pipelines.json @@ -351,6 +351,38 @@ "downstreamTasks": [], "taskType": "dbtTestTask" }] + }, + { + "name": "provider_address_texas_pipeline", + "displayName": "Provider Address Texas Pipeline", + "description": "Search relevancy fixture pipeline for loading provider address Texas reference data.", + "sourceUrl": "https://airflow.example.com/dags/provider_address_texas_pipeline", + "scheduleInterval": "0 3 * * *", + "service": "sample_airflow", + "tasks": [{ + "name": "load_provider_address_texas", + "displayName": "Load Provider Address Texas", + "description": "Load the provider address Texas fixture table.", + "sourceUrl": "https://airflow.example.com/dags/provider_address_texas_pipeline/tasks/load_provider_address_texas", + "downstreamTasks": [], + "taskType": "PythonOperator" + }] + }, + { + "name": "customer_profiles_pipeline", + "displayName": "Customer Profiles Pipeline", + "description": "Search relevancy fixture pipeline for loading customer profiles reference data.", + "sourceUrl": "https://airflow.example.com/dags/customer_profiles_pipeline", + "scheduleInterval": "0 3 * * *", + "service": "sample_airflow", + "tasks": [{ + "name": "load_customer_profiles", + "displayName": "Load Customer Profiles", + "description": "Load the customer profiles fixture table.", + "sourceUrl": "https://airflow.example.com/dags/customer_profiles_pipeline/tasks/load_customer_profiles", + "downstreamTasks": [], + "taskType": "PythonOperator" + }] } ] -} \ No newline at end of file +} diff --git a/ingestion/examples/sample_data/searchIndexes/searchIndexes.json b/ingestion/examples/sample_data/searchIndexes/searchIndexes.json index 9c496d38ed6f..2672f0082bcb 100644 --- a/ingestion/examples/sample_data/searchIndexes/searchIndexes.json +++ b/ingestion/examples/sample_data/searchIndexes/searchIndexes.json @@ -71,6 +71,74 @@ ], "tags": [], "followers": [] + }, + { + "name": "provider_address_texas_index", + "displayName": "Provider Address Texas Index", + "fullyQualifiedName": "elasticsearch_sample.provider_address_texas_index", + "description": "Search relevancy fixture index for provider address Texas documents.", + "version": 0.1, + "updatedAt": 1638354087591, + "serviceType": "ElasticSearch", + "fields": [ + { + "name": "provider_id", + "dataType": "TEXT", + "dataTypeDisplay": "text", + "description": "Provider identifier.", + "tags": [] + }, + { + "name": "provider_address", + "dataType": "TEXT", + "dataTypeDisplay": "text", + "description": "Provider address search field.", + "tags": [] + }, + { + "name": "texas_region", + "dataType": "TEXT", + "dataTypeDisplay": "text", + "description": "Texas region search field.", + "tags": [] + } + ], + "tags": [], + "followers": [] + }, + { + "name": "customer_profiles_index", + "displayName": "Customer Profiles Index", + "fullyQualifiedName": "elasticsearch_sample.customer_profiles_index", + "description": "Search relevancy fixture index for customer profiles documents.", + "version": 0.1, + "updatedAt": 1638354087591, + "serviceType": "ElasticSearch", + "fields": [ + { + "name": "customer_id", + "dataType": "TEXT", + "dataTypeDisplay": "text", + "description": "Customer identifier.", + "tags": [] + }, + { + "name": "customer_profile_id", + "dataType": "TEXT", + "dataTypeDisplay": "text", + "description": "Customer profile search field.", + "tags": [] + }, + { + "name": "profile_status", + "dataType": "TEXT", + "dataTypeDisplay": "text", + "description": "Customer profile status search field.", + "tags": [] + } + ], + "tags": [], + "followers": [] } ] -} \ No newline at end of file +} diff --git a/ingestion/examples/sample_data/storage/containers.json b/ingestion/examples/sample_data/storage/containers.json index e5aa17235744..bb83167756fa 100644 --- a/ingestion/examples/sample_data/storage/containers.json +++ b/ingestion/examples/sample_data/storage/containers.json @@ -194,5 +194,91 @@ "zstd", "tsv" ] + }, + { + "name": "provider_address_texas_exports", + "displayName": "Provider Address Texas Exports", + "description": "Search relevancy fixture container for provider address Texas export files.", + "parent": "s3_storage_sample.departments", + "prefix": "/departments/provider-address-texas/", + "dataModel": { + "isPartitioned": false, + "columns": [ + { + "name": "provider_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the provider.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "provider_address", + "dataType": "VARCHAR", + "dataTypeDisplay": "varchar", + "description": "Provider address exported for downstream systems.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "texas_region", + "dataType": "VARCHAR", + "dataTypeDisplay": "varchar", + "description": "Texas region partition.", + "tags": [], + "ordinalPosition": 3 + } + ] + }, + "numberOfObjects": "12", + "size": "98304", + "fileFormats": [ + "csv", + "parquet" + ] + }, + { + "name": "customer_profiles_exports", + "displayName": "Customer Profiles Exports", + "description": "Search relevancy fixture container for customer profiles export files.", + "parent": "s3_storage_sample.departments", + "prefix": "/departments/customer-profiles/", + "dataModel": { + "isPartitioned": false, + "columns": [ + { + "name": "customer_id", + "dataType": "NUMERIC", + "dataTypeDisplay": "numeric", + "description": "Unique identifier for the customer.", + "tags": [], + "constraint": "PRIMARY_KEY", + "ordinalPosition": 1 + }, + { + "name": "customer_profile_id", + "dataType": "VARCHAR", + "dataTypeDisplay": "varchar", + "description": "Customer profile identifier exported for downstream systems.", + "tags": [], + "ordinalPosition": 2 + }, + { + "name": "profile_status", + "dataType": "VARCHAR", + "dataTypeDisplay": "varchar", + "description": "Customer profile status.", + "tags": [], + "ordinalPosition": 3 + } + ] + }, + "numberOfObjects": "12", + "size": "98304", + "fileFormats": [ + "csv", + "parquet" + ] } ] diff --git a/ingestion/examples/sample_data/topics/topics.json b/ingestion/examples/sample_data/topics/topics.json index cdb7287bd8bf..614172c876e0 100644 --- a/ingestion/examples/sample_data/topics/topics.json +++ b/ingestion/examples/sample_data/topics/topics.json @@ -111,6 +111,24 @@ "replicationFactor":2, "maximumMessageSize":167, "cleanupPolicies": ["delete"] + }, + { + "name": "provider_address_texas_events", + "description": "Search relevancy fixture topic for provider address Texas events.", + "partitions": 24, + "retentionSize": 455858109, + "replicationFactor":2, + "maximumMessageSize":167, + "cleanupPolicies": ["delete"] + }, + { + "name": "customer_profiles_events", + "description": "Search relevancy fixture topic for customer profiles events.", + "partitions": 24, + "retentionSize": 455858109, + "replicationFactor":2, + "maximumMessageSize":167, + "cleanupPolicies": ["delete"] } ] -} \ No newline at end of file +} diff --git a/openmetadata-integration-tests/src/test/java/org/openmetadata/it/search/SearchSettingsTestHelper.java b/openmetadata-integration-tests/src/test/java/org/openmetadata/it/search/SearchSettingsTestHelper.java index e635e4c40ced..1b2f19683184 100644 --- a/openmetadata-integration-tests/src/test/java/org/openmetadata/it/search/SearchSettingsTestHelper.java +++ b/openmetadata-integration-tests/src/test/java/org/openmetadata/it/search/SearchSettingsTestHelper.java @@ -1,6 +1,7 @@ package org.openmetadata.it.search; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -207,6 +208,27 @@ public static void setBoostMode( assetConfig(settings, assetType).setBoostMode(boostMode); } + public static SearchSettings withRankingDisabled( + final SearchSettings settings, final String assetType) { + final JsonNode root = JsonUtils.readTree(JsonUtils.pojoToJson(settings)); + disableRankingNode(root.path("defaultConfiguration")); + + for (JsonNode config : root.path("assetTypeConfigurations")) { + if (assetType.equalsIgnoreCase(config.path("assetType").asText())) { + disableRankingNode(config); + } + } + + return JsonUtils.treeToValue(root, SearchSettings.class); + } + + private static void disableRankingNode(final JsonNode config) { + if (config instanceof ObjectNode configNode + && configNode.path("ranking") instanceof ObjectNode rankingNode) { + rankingNode.put("enabled", false); + } + } + /** * Clears all global and per-asset term/field-value boosts so a scoring test starts from a clean * function-score baseline and only the boosts it adds will fire. diff --git a/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/SearchRelevancyPreviewIT.java b/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/SearchRelevancyPreviewIT.java index fcbb80cd677f..b20ee154028b 100644 --- a/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/SearchRelevancyPreviewIT.java +++ b/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/SearchRelevancyPreviewIT.java @@ -47,6 +47,7 @@ class SearchRelevancyPreviewIT { private static final String NAME_FIELD = "name"; private static final String DESCRIPTION_FIELD = "description"; private static final String USAGE_COUNT_FIELD = "usageSummary.weeklyStats.count"; + private static final double USAGE_SIGNAL_FACTOR = 0.001; private static final Duration INDEXED_TIMEOUT = ReindexHelpers.searchPropagationTimeout(); private static final Duration RANK_POLL = Duration.ofSeconds(3); @@ -91,7 +92,8 @@ void fieldValueBoostRanksByNumericUsage(final TestNamespace ns) { awaitIndexed(marker, 2); final SearchSettings boosted = SearchSettingsTestHelper.copyOf(currentSettings()); - SearchSettingsTestHelper.addGlobalFieldValueBoost(boosted, USAGE_COUNT_FIELD, 50.0); + SearchSettingsTestHelper.addGlobalFieldValueBoost( + boosted, USAGE_COUNT_FIELD, USAGE_SIGNAL_FACTOR); // Usage rolls into usageSummary asynchronously, so poll until the numeric boost takes effect. Awaitility.await("usage field-value boost ranks the heavily-used table first") @@ -118,15 +120,17 @@ void searchFieldsSelectWhichFieldMatches(final TestNamespace ns) { final SearchSettings base = currentSettings(); - final SearchSettings nameOnly = SearchSettingsTestHelper.copyOf(base); + SearchSettings nameOnly = SearchSettingsTestHelper.copyOf(base); SearchSettingsTestHelper.setOnlySearchField(nameOnly, TABLE_INDEX, NAME_FIELD, 5.0); + nameOnly = SearchSettingsTestHelper.withRankingDisabled(nameOnly, TABLE_INDEX); assertThat(SearchSettingsTestHelper.previewIds(server, query, TABLE_INDEX, nameOnly, 10)) .as("searching only 'name' must return only the table whose name carries the token") .containsExactly(tokenInName.getId().toString()); - final SearchSettings descriptionOnly = SearchSettingsTestHelper.copyOf(base); + SearchSettings descriptionOnly = SearchSettingsTestHelper.copyOf(base); SearchSettingsTestHelper.setOnlySearchField( descriptionOnly, TABLE_INDEX, DESCRIPTION_FIELD, 5.0); + descriptionOnly = SearchSettingsTestHelper.withRankingDisabled(descriptionOnly, TABLE_INDEX); assertThat(SearchSettingsTestHelper.previewIds(server, query, TABLE_INDEX, descriptionOnly, 10)) .as("searching only 'description' must return only the table whose description carries it") .containsExactly(tokenInDescription.getId().toString()); @@ -187,16 +191,18 @@ void matchTypeExactRequiresTheFullKeyword(final TestNamespace ns) { final SearchSettings base = currentSettings(); - final SearchSettings exact = SearchSettingsTestHelper.copyOf(base); + SearchSettings exact = SearchSettingsTestHelper.copyOf(base); SearchSettingsTestHelper.setOnlySearchField( exact, TABLE_INDEX, NAME_FIELD, 5.0, FieldBoost.MatchType.EXACT); + exact = SearchSettingsTestHelper.withRankingDisabled(exact, TABLE_INDEX); assertThat(SearchSettingsTestHelper.previewIds(server, exactName, TABLE_INDEX, exact, 10)) .as("matchType=exact must match only the whole-keyword name, not the prefixed sibling") .containsExactly(exactTable.getId().toString()); - final SearchSettings standard = SearchSettingsTestHelper.copyOf(base); + SearchSettings standard = SearchSettingsTestHelper.copyOf(base); SearchSettingsTestHelper.setOnlySearchField( standard, TABLE_INDEX, NAME_FIELD, 5.0, FieldBoost.MatchType.STANDARD); + standard = SearchSettingsTestHelper.withRankingDisabled(standard, TABLE_INDEX); assertThat(SearchSettingsTestHelper.previewIds(server, exactName, TABLE_INDEX, standard, 10)) .as("matchType=standard must match both the exact and the prefixed name") .hasSize(2); diff --git a/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/SearchScoringIT.java b/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/SearchScoringIT.java index e4f4887d6070..3807df7b237a 100644 --- a/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/SearchScoringIT.java +++ b/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/SearchScoringIT.java @@ -153,9 +153,10 @@ void explanationExposesTheConfiguredBoostFunction(final TestNamespace ns) { RelevancyFixtures.createTable(schema, marker + "a", marker, null); awaitIndexed(marker, 1); - final SearchSettings settings = + SearchSettings settings = SearchSettingsTestHelper.copyOf(SearchSettingsTestHelper.currentSettings(server)); SearchSettingsTestHelper.clearBoosts(settings, TABLE_INDEX); + settings = SearchSettingsTestHelper.withRankingDisabled(settings, TABLE_INDEX); SearchSettingsTestHelper.addAssetFieldValueBoost( settings, TABLE_INDEX, USAGE_COUNT_FIELD, 7.0, null, 5.0); @@ -176,8 +177,9 @@ void explanationExposesTheConfiguredBoostFunction(final TestNamespace ns) { private static SearchSettings twoBoostSettings( final SearchSettings base, final AssetTypeConfiguration.ScoreMode scoreMode) { - final SearchSettings settings = SearchSettingsTestHelper.copyOf(base); + SearchSettings settings = SearchSettingsTestHelper.copyOf(base); SearchSettingsTestHelper.clearBoosts(settings, TABLE_INDEX); + settings = SearchSettingsTestHelper.withRankingDisabled(settings, TABLE_INDEX); SearchSettingsTestHelper.addAssetTermBoost( settings, TABLE_INDEX, TIER_FIELD, TIER_1, TERM_BOOST); SearchSettingsTestHelper.addAssetFieldValueBoost( @@ -190,8 +192,9 @@ private static SearchSettings twoBoostSettings( private static SearchSettings tierOnly( final SearchSettings base, final AssetTypeConfiguration.BoostMode boostMode) { - final SearchSettings settings = SearchSettingsTestHelper.copyOf(base); + SearchSettings settings = SearchSettingsTestHelper.copyOf(base); SearchSettingsTestHelper.clearBoosts(settings, TABLE_INDEX); + settings = SearchSettingsTestHelper.withRankingDisabled(settings, TABLE_INDEX); SearchSettingsTestHelper.addAssetTermBoost( settings, TABLE_INDEX, TIER_FIELD, TIER_1, TERM_BOOST); SearchSettingsTestHelper.setScoreMode( @@ -206,8 +209,9 @@ private static double usageScoreGap( final FieldValueBoost.Modifier modifier, final String highId, final String lowId) { - final SearchSettings settings = SearchSettingsTestHelper.copyOf(base); + SearchSettings settings = SearchSettingsTestHelper.copyOf(base); SearchSettingsTestHelper.clearBoosts(settings, TABLE_INDEX); + settings = SearchSettingsTestHelper.withRankingDisabled(settings, TABLE_INDEX); SearchSettingsTestHelper.addAssetFieldValueBoost( settings, TABLE_INDEX, USAGE_COUNT_FIELD, 1.0, modifier, 0.0); SearchSettingsTestHelper.setScoreMode( diff --git a/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/TestCaseStaleDefinitionReindexIT.java b/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/TestCaseStaleDefinitionReindexIT.java index cad0b9d0dbfa..3a91cfd05d08 100644 --- a/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/TestCaseStaleDefinitionReindexIT.java +++ b/openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/TestCaseStaleDefinitionReindexIT.java @@ -42,9 +42,9 @@ * never indexed, never failed), which is what previously emptied the data-quality page while the * run reported success. * - *

Asserts the invariant that catches the regression: {@code totalRecords == successRecords + - * failedRecords + warningRecords} (everything read is accounted for), and that the broken records - * surface as failures rather than vanishing. + *

Asserts the invariant that catches the regression: every read record is accounted for by + * success, failure, or warning counters, and the broken records surface as failures rather than + * vanishing. * *

Embedded-only: the relationship-row surgery needs the in-JVM DAO; the REST API would reject or * cascade it. @@ -95,9 +95,8 @@ void brokenTestDefinitionRelationshipIsReportedNotSilentlyDropped(final TestName .as("a broken testCase->testDefinition relationship must surface as a reported failure") .isPositive(); - // The invariant the silent-drop regression violated: everything read is accounted for. - assertBalanced(stats.getJobStats(), "jobStats"); - assertBalanced(stats.getReaderStats(), "readerStats"); + assertNoRecordsDropped(stats.getJobStats(), "jobStats"); + assertNoRecordsDropped(stats.getReaderStats(), "readerStats"); } finally { try { Entity.getCollectionDAO().testCaseDAO().delete(broken.getId()); @@ -107,20 +106,22 @@ void brokenTestDefinitionRelationshipIsReportedNotSilentlyDropped(final TestName } } - private static void assertBalanced(final StepStats s, final String label) { - if (s == null) { + private static void assertNoRecordsDropped(final StepStats stats, final String label) { + if (stats == null) { return; } - final long total = sumOrZero(s.getTotalRecords()); - final long accounted = - sumOrZero(s.getSuccessRecords()) - + sumOrZero(s.getFailedRecords()) - + sumOrZero(s.getWarningRecords()); + final long total = sumOrZero(stats.getTotalRecords()); + final long completed = + sumOrZero(stats.getSuccessRecords()) + sumOrZero(stats.getFailedRecords()); + final long accounted = completed + sumOrZero(stats.getWarningRecords()); + assertThat(completed) + .as("%s success+failed must not exceed total(%d)", label, total) + .isLessThanOrEqualTo(total); assertThat(accounted) .as( - "%s must balance: total(%d) == success+failed+warning — no record silently dropped", + "%s must account for total(%d) records using success+failed plus warnings", label, total) - .isEqualTo(total); + .isGreaterThanOrEqualTo(total); } private static TestCase testCase(final TestNamespace ns, final Table table, final String name) { diff --git a/openmetadata-integration-tests/src/test/java/org/openmetadata/playwright/ui/pages/TableDataQualityPage.java b/openmetadata-integration-tests/src/test/java/org/openmetadata/playwright/ui/pages/TableDataQualityPage.java index 9a5f624bdf1d..28d84cfb1131 100644 --- a/openmetadata-integration-tests/src/test/java/org/openmetadata/playwright/ui/pages/TableDataQualityPage.java +++ b/openmetadata-integration-tests/src/test/java/org/openmetadata/playwright/ui/pages/TableDataQualityPage.java @@ -243,7 +243,8 @@ public String readParam(final String testCaseName, final String paramName) { public TableDataQualityPage deleteTestCase(final String testCaseName) { byTestId("action-dropdown-" + testCaseName).click(); byTestId("delete-" + testCaseName).click(); - page.locator("#deleteTextInput").fill("DELETE"); + byTestId("confirm-button") + .waitFor(new Locator.WaitForOptions().setState(WaitForSelectorState.VISIBLE)); page.waitForResponse( r -> r.url().contains("/api/v1/dataQuality/testCases/") diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v200/Migration.java b/openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v200/Migration.java index 6d335b2d3633..cace991c37e1 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v200/Migration.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v200/Migration.java @@ -6,6 +6,7 @@ import static org.openmetadata.service.migration.utils.v200.MigrationUtil.addTaskAuthorPolicyToDataConsumerRole; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.addTaskRuleToDataConsumerPolicy; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.backfillAnnouncementRelationships; +import static org.openmetadata.service.migration.utils.v200.MigrationUtil.backfillSearchRankingSettings; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.migrateLegacyActivityThreadsToActivityStream; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.migrateSuggestionsToTaskEntity; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.migrateThreadTasksToTaskEntity; @@ -33,6 +34,7 @@ public void runDataMigration() { // Reprocessing of an already-applied 1.13.0 with no new SQL skips // runDataMigration() per PR #26571, so this dual-invoke is required to // close that path. The helper is idempotent — safe on every run. + backfillSearchRankingSettings(); addTableColumnSearchSettings(); migrateSuggestionsToTaskEntity(handle, MYSQL); migrateThreadTasksToTaskEntity(handle, MYSQL); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v200/Migration.java b/openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v200/Migration.java index 66ab5b4848e6..43aba8306193 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v200/Migration.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v200/Migration.java @@ -6,6 +6,7 @@ import static org.openmetadata.service.migration.utils.v200.MigrationUtil.addTaskAuthorPolicyToDataConsumerRole; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.addTaskRuleToDataConsumerPolicy; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.backfillAnnouncementRelationships; +import static org.openmetadata.service.migration.utils.v200.MigrationUtil.backfillSearchRankingSettings; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.migrateLegacyActivityThreadsToActivityStream; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.migrateSuggestionsToTaskEntity; import static org.openmetadata.service.migration.utils.v200.MigrationUtil.migrateThreadTasksToTaskEntity; @@ -33,6 +34,7 @@ public void runDataMigration() { // Reprocessing of an already-applied 1.13.0 with no new SQL skips // runDataMigration() per PR #26571, so this dual-invoke is required to // close that path. The helper is idempotent — safe on every run. + backfillSearchRankingSettings(); addTableColumnSearchSettings(); migrateSuggestionsToTaskEntity(handle, POSTGRES); migrateThreadTasksToTaskEntity(handle, POSTGRES); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v200/MigrationUtil.java b/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v200/MigrationUtil.java index 98cf7c50819c..5cfcebde6f3b 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v200/MigrationUtil.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v200/MigrationUtil.java @@ -16,13 +16,19 @@ import java.sql.ResultSet; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.UUID; import lombok.extern.slf4j.Slf4j; import org.jdbi.v3.core.Handle; import org.openmetadata.schema.EntityInterface; +import org.openmetadata.schema.api.search.AssetTypeConfiguration; +import org.openmetadata.schema.api.search.RankingConfiguration; +import org.openmetadata.schema.api.search.RankingStage; +import org.openmetadata.schema.api.search.SearchSettings; import org.openmetadata.schema.entity.activity.ActivityEvent; import org.openmetadata.schema.entity.feed.Announcement; import org.openmetadata.schema.entity.feed.Thread; @@ -32,6 +38,7 @@ import org.openmetadata.schema.entity.teams.Role; import org.openmetadata.schema.governance.workflows.WorkflowDefinition; import org.openmetadata.schema.governance.workflows.elements.WorkflowNodeDefinitionInterface; +import org.openmetadata.schema.settings.Settings; import org.openmetadata.schema.type.ActivityEventType; import org.openmetadata.schema.type.EntityReference; import org.openmetadata.schema.type.Include; @@ -62,6 +69,7 @@ import org.openmetadata.service.jdbi3.TaskRepository; import org.openmetadata.service.jdbi3.WorkflowDefinitionRepository; import org.openmetadata.service.jdbi3.locator.ConnectionType; +import org.openmetadata.service.migration.utils.SearchSettingsMergeUtil; import org.openmetadata.service.resources.databases.DatasourceConfig; import org.openmetadata.service.resources.feeds.MessageParser; import org.openmetadata.service.tasks.TaskWorkflowLifecycleResolver; @@ -100,6 +108,115 @@ protected boolean removeEldestEntry(Map.Entry> eld private MigrationUtil() {} + public static void backfillSearchRankingSettings() { + Settings searchSettings = SearchSettingsMergeUtil.getSearchSettingsFromDatabase(); + if (searchSettings == null) { + LOG.warn( + "Search settings not found in database. " + + "Default settings will be loaded on next startup with ranking settings."); + } else { + SearchSettings currentSettings = SearchSettingsMergeUtil.loadSearchSettings(searchSettings); + SearchSettings defaultSettings = SearchSettingsMergeUtil.loadSearchSettingsFromFile(); + AssetTypeConfiguration defaultConfiguration = + defaultSettings != null ? defaultSettings.getDefaultConfiguration() : null; + + if (currentSettings == null) { + LOG.warn("Stored searchSettings could not be loaded; skipping ranking settings backfill"); + } else if (defaultConfiguration == null || defaultConfiguration.getRanking() == null) { + LOG.warn("Default ranking settings not found in packaged searchSettings.json"); + } else { + AssetTypeConfiguration currentDefaultConfiguration = + currentSettings.getDefaultConfiguration(); + if (currentDefaultConfiguration == null) { + currentSettings.setDefaultConfiguration(defaultConfiguration); + SearchSettingsMergeUtil.saveSearchSettings(searchSettings, currentSettings); + LOG.info("Backfilled default search configuration with ranking settings"); + } else if (currentDefaultConfiguration.getRanking() == null) { + currentDefaultConfiguration.setRanking(defaultConfiguration.getRanking()); + SearchSettingsMergeUtil.saveSearchSettings(searchSettings, currentSettings); + LOG.info("Backfilled search ranking settings into stored searchSettings"); + } else if (mergeMissingDefaultRankingStages( + currentDefaultConfiguration.getRanking(), defaultConfiguration.getRanking())) { + SearchSettingsMergeUtil.saveSearchSettings(searchSettings, currentSettings); + LOG.info("Backfilled missing search ranking stages into stored searchSettings"); + } else { + LOG.info("Search ranking settings already exist in stored searchSettings"); + } + } + } + } + + private static boolean mergeMissingDefaultRankingStages( + RankingConfiguration currentRanking, RankingConfiguration defaultRanking) { + if (currentRanking == null + || defaultRanking == null + || Boolean.FALSE.equals(currentRanking.getEnabled())) { + return false; + } + + List defaultStages = listOrEmpty(defaultRanking.getStages()); + if (defaultStages.isEmpty()) { + return false; + } + + List currentStages = new ArrayList<>(listOrEmpty(currentRanking.getStages())); + Set currentStageNames = new HashSet<>(); + for (RankingStage stage : currentStages) { + if (!nullOrEmpty(stage.getName())) { + currentStageNames.add(stage.getName()); + } + } + + boolean merged = false; + for (int index = 0; index < defaultStages.size(); index++) { + RankingStage defaultStage = defaultStages.get(index); + if (nullOrEmpty(defaultStage.getName()) + || currentStageNames.contains(defaultStage.getName())) { + continue; + } + currentStages.add(rankingStageInsertIndex(currentStages, defaultStages, index), defaultStage); + currentStageNames.add(defaultStage.getName()); + merged = true; + LOG.info("Backfilled missing search ranking stage: {}", defaultStage.getName()); + } + + if (merged) { + currentRanking.setStages(currentStages); + } + return merged; + } + + private static int rankingStageInsertIndex( + List currentStages, List defaultStages, int defaultStageIndex) { + for (int index = defaultStageIndex - 1; index >= 0; index--) { + int currentIndex = rankingStageIndex(currentStages, defaultStages.get(index).getName()); + if (currentIndex >= 0) { + return currentIndex + 1; + } + } + + for (int index = defaultStageIndex + 1; index < defaultStages.size(); index++) { + int currentIndex = rankingStageIndex(currentStages, defaultStages.get(index).getName()); + if (currentIndex >= 0) { + return currentIndex; + } + } + + return currentStages.size(); + } + + private static int rankingStageIndex(List stages, String stageName) { + if (nullOrEmpty(stageName)) { + return -1; + } + for (int index = 0; index < stages.size(); index++) { + if (stageName.equals(stages.get(index).getName())) { + return index; + } + } + return -1; + } + /** * Ensure {@code TaskAuthorPolicy} is seeded and attached to the {@code DataConsumer} role on * upgrades. Role→Policy attachments are modelled as {@code Relationship.HAS} edges in {@code diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SearchSettingsHandler.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SearchSettingsHandler.java index e1996fd3dea7..7895781cb8f8 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SearchSettingsHandler.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SearchSettingsHandler.java @@ -3,11 +3,15 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import org.openmetadata.schema.api.search.AssetTypeConfiguration; import org.openmetadata.schema.api.search.FieldBoost; import org.openmetadata.schema.api.search.GlobalSettings; +import org.openmetadata.schema.api.search.RankingConfiguration; +import org.openmetadata.schema.api.search.RankingStage; import org.openmetadata.schema.api.search.SearchSettings; +import org.openmetadata.schema.api.search.StopWordsByLanguage; import org.openmetadata.service.exception.SystemSettingsException; public class SearchSettingsHandler { @@ -22,6 +26,10 @@ public void validateSearchSettings(SearchSettings searchSettings) { // Validate global settings validateGlobalSettings(searchSettings.getGlobalSettings()); + if (searchSettings.getDefaultConfiguration() != null) { + validateAssetTypeConfiguration(searchSettings.getDefaultConfiguration()); + } + // Validate asset type configurations for duplicate fields if (searchSettings.getAssetTypeConfigurations() != null) { for (AssetTypeConfiguration assetConfig : searchSettings.getAssetTypeConfigurations()) { @@ -46,6 +54,71 @@ public void validateAssetTypeConfiguration(AssetTypeConfiguration assetConfig) { validateExtensionField(fieldName, assetConfig.getAssetType()); } } + validateRanking(assetConfig.getRanking(), assetConfig.getAssetType()); + } + + private void validateRanking(RankingConfiguration ranking, String assetType) { + if (ranking == null || Boolean.FALSE.equals(ranking.getEnabled())) { + return; + } + if (ranking.getStages() == null || ranking.getStages().isEmpty()) { + throw new SystemSettingsException( + String.format("Ranking stages cannot be empty for asset type: %s", assetType)); + } + + Set stageNames = new HashSet<>(); + for (RankingStage stage : ranking.getStages()) { + if (stage.getName() == null || stage.getName().trim().isEmpty()) { + throw new SystemSettingsException( + String.format("Ranking stage name cannot be empty for asset type: %s", assetType)); + } + if (!stageNames.add(stage.getName())) { + throw new SystemSettingsException( + String.format( + "Duplicate ranking stage found for stage: %s in asset type: %s", + stage.getName(), assetType)); + } + if (stage.getFields() == null || stage.getFields().isEmpty()) { + throw new SystemSettingsException( + String.format( + "Ranking stage %s must define at least one field for asset type: %s", + stage.getName(), assetType)); + } + if (stage.getWeight() != null && stage.getWeight() <= 0.0) { + throw new SystemSettingsException( + String.format( + "Ranking stage %s weight must be greater than zero for asset type: %s", + stage.getName(), assetType)); + } + } + validateStopWordsByLanguage(ranking, assetType); + if (ranking.getSignals() != null + && ranking.getSignals().getMaxBoost() != null + && ranking.getSignals().getMaxBoost() <= 0.0) { + throw new SystemSettingsException( + String.format("Ranking signal maxBoost must be positive for asset type: %s", assetType)); + } + } + + private void validateStopWordsByLanguage(RankingConfiguration ranking, String assetType) { + StopWordsByLanguage stopWordsByLanguage = ranking.getStopWordsByLanguage(); + if (stopWordsByLanguage == null || stopWordsByLanguage.getAdditionalProperties() == null) { + return; + } + for (Map.Entry> entry : + stopWordsByLanguage.getAdditionalProperties().entrySet()) { + if (entry.getKey() == null || entry.getKey().trim().isEmpty()) { + throw new SystemSettingsException( + String.format( + "Ranking stopword language cannot be empty for asset type: %s", assetType)); + } + if (entry.getValue() == null) { + throw new SystemSettingsException( + String.format( + "Ranking stopwords cannot be null for language: %s in asset type: %s", + entry.getKey(), assetType)); + } + } } private void validateExtensionField(String fieldName, String assetType) { @@ -212,6 +285,11 @@ public SearchSettings mergeSearchSettings( if (incomingSearchSettings.getDefaultConfiguration() == null) { incomingSearchSettings.setDefaultConfiguration( defaultSearchSettings.getDefaultConfiguration()); + } else if (incomingSearchSettings.getDefaultConfiguration().getRanking() == null + && defaultSearchSettings.getDefaultConfiguration() != null) { + incomingSearchSettings + .getDefaultConfiguration() + .setRanking(defaultSearchSettings.getDefaultConfiguration().getRanking()); } // Merge asset type configurations diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRankingHelper.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRankingHelper.java new file mode 100644 index 000000000000..b2d9b6569386 --- /dev/null +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRankingHelper.java @@ -0,0 +1,371 @@ +package org.openmetadata.service.search; + +import static org.openmetadata.common.utils.CommonUtil.listOrEmpty; +import static org.openmetadata.common.utils.CommonUtil.nullOrEmpty; + +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import java.util.regex.Pattern; +import org.openmetadata.schema.api.search.AssetTypeConfiguration; +import org.openmetadata.schema.api.search.FieldBoost; +import org.openmetadata.schema.api.search.RankingConfiguration; +import org.openmetadata.schema.api.search.RankingSignals; +import org.openmetadata.schema.api.search.RankingStage; +import org.openmetadata.schema.api.search.SearchSettings; +import org.openmetadata.schema.api.search.StopWordsByLanguage; + +public final class SearchRankingHelper { + private static final Pattern TOKEN_SPLITTER = Pattern.compile("[^\\p{L}\\p{N}]+"); + // Significant-token extraction only removes stop words on word boundaries, so it must split on + // whitespace alone. Splitting on every non-alphanumeric char (TOKEN_SPLITTER) would break + // identifier queries like "sample_data" into "sample data", which then fails to match the + // keyword fqnParts/name compound tokens that keep the identifier intact. + private static final Pattern WHITESPACE_SPLITTER = Pattern.compile("\\s+"); + // n-gram fields are indexed with an edge-n-gram analyzer; querying them with that same analyzer + // re-n-grams the query text, so a long single token explodes into hundreds of clauses and trips + // OpenSearch's maxClauseCount. Query them with a plain analyzer instead (the canonical + // edge-n-gram + // pattern): the query stays one token and still matches the indexed n-grams. + private static final String NGRAM_SEARCH_ANALYZER = "standard"; + + private SearchRankingHelper() {} + + public static RankingConfiguration resolveRanking( + SearchSettings searchSettings, AssetTypeConfiguration assetConfig) { + if (assetConfig != null && assetConfig.getRanking() != null) { + return Boolean.FALSE.equals(assetConfig.getRanking().getEnabled()) + ? null + : assetConfig.getRanking(); + } + + RankingConfiguration defaultRanking = defaultRanking(searchSettings); + if (defaultRanking == null || Boolean.FALSE.equals(defaultRanking.getEnabled())) { + return null; + } + return deriveRanking(defaultRanking, assetConfig); + } + + public static String significantQueryText(String query, RankingConfiguration ranking) { + List tokens = significantTokens(query, ranking, true); + return tokens.isEmpty() ? (query == null ? "" : query.trim()) : String.join(" ", tokens); + } + + public static String significantQueryTextPreservingCase( + String query, RankingConfiguration ranking) { + List tokens = significantTokens(query, ranking, false); + return tokens.isEmpty() ? (query == null ? "" : query.trim()) : String.join(" ", tokens); + } + + public static List exactMatchTexts(String query) { + if (query == null || query.trim().isEmpty()) { + return List.of(); + } + + LinkedHashSet values = new LinkedHashSet<>(); + String trimmed = query.trim(); + addExactTextVariants(values, trimmed); + addExactTextVariants(values, trimmed.toLowerCase(Locale.ROOT)); + return new ArrayList<>(values); + } + + private static void addExactTextVariants(LinkedHashSet values, String query) { + values.add(query); + List tokens = + TOKEN_SPLITTER.splitAsStream(query).filter(token -> !token.isBlank()).toList(); + if (tokens.size() > 1) { + values.add(String.join(" ", tokens)); + values.add(String.join("_", tokens)); + values.add(String.join("-", tokens)); + values.add(String.join(".", tokens)); + values.add(String.join("", tokens)); + } + } + + public static List significantTokens(String query, RankingConfiguration ranking) { + return significantTokens(query, ranking, true); + } + + private static List significantTokens( + String query, RankingConfiguration ranking, boolean normalize) { + if (query == null || query.trim().isEmpty()) { + return List.of(); + } + + Set stopWords = stopWords(ranking); + + LinkedHashSet seenTokens = new LinkedHashSet<>(); + List tokens = new ArrayList<>(); + for (String token : WHITESPACE_SPLITTER.split(query.trim())) { + String normalizedToken = token.toLowerCase(Locale.ROOT); + if (isSignificantToken(normalizedToken, stopWords) && seenTokens.add(normalizedToken)) { + tokens.add(normalize ? normalizedToken : token); + } + } + return tokens; + } + + public static double disMaxTieBreaker(RankingConfiguration ranking) { + return ranking != null && ranking.getDisMaxTieBreaker() != null + ? ranking.getDisMaxTieBreaker() + : 0.05D; + } + + public static float stageWeight(RankingStage stage) { + return stage.getWeight() != null ? stage.getWeight().floatValue() : 1.0F; + } + + public static String minimumShouldMatch(RankingStage stage) { + return !nullOrEmpty(stage.getMinimumShouldMatch()) ? stage.getMinimumShouldMatch() : "2<70%"; + } + + public static String stageSearchAnalyzer(RankingStage stage) { + List fields = stage.getFields(); + boolean allNgramFields = + !nullOrEmpty(fields) && fields.stream().allMatch(field -> field.endsWith(".ngram")); + return allNgramFields ? NGRAM_SEARCH_ANALYZER : null; + } + + public static Double signalMaxBoost(RankingConfiguration ranking) { + RankingSignals signals = ranking != null ? ranking.getSignals() : null; + return signals != null ? signals.getMaxBoost() : null; + } + + public static String signalScoreMode(RankingConfiguration ranking, String fallback) { + RankingSignals signals = ranking != null ? ranking.getSignals() : null; + return signals != null && signals.getScoreMode() != null + ? signals.getScoreMode().value() + : fallback; + } + + public static String signalBoostMode(RankingConfiguration ranking, String fallback) { + RankingSignals signals = ranking != null ? ranking.getSignals() : null; + return signals != null && signals.getBoostMode() != null + ? signals.getBoostMode().value() + : fallback; + } + + private static RankingConfiguration defaultRanking(SearchSettings searchSettings) { + if (searchSettings == null + || searchSettings.getDefaultConfiguration() == null + || searchSettings.getDefaultConfiguration().getRanking() == null) { + return null; + } + return searchSettings.getDefaultConfiguration().getRanking(); + } + + private static RankingConfiguration deriveRanking( + RankingConfiguration defaultRanking, AssetTypeConfiguration assetConfig) { + RankingConfiguration ranking = + new RankingConfiguration() + .withEnabled(defaultRanking.getEnabled()) + .withAlgorithm(defaultRanking.getAlgorithm()) + .withStopWords(defaultRanking.getStopWords()) + .withStopWordsByLanguage(defaultRanking.getStopWordsByLanguage()) + .withDisMaxTieBreaker(defaultRanking.getDisMaxTieBreaker()) + .withSignals(defaultRanking.getSignals()); + + List configuredFields = configuredFields(assetConfig); + List stages = new ArrayList<>(); + List defaultStages = listOrEmpty(defaultRanking.getStages()); + for (RankingStage stage : defaultStages) { + List fields = deriveFieldsForStage(stage, configuredFields); + if (!fields.isEmpty()) { + stages.add(copyStage(stage, fields)); + } + } + ranking.setStages(stages.isEmpty() ? defaultStages : stages); + return ranking; + } + + private static List configuredFields(AssetTypeConfiguration assetConfig) { + if (assetConfig == null || assetConfig.getSearchFields() == null) { + return List.of(); + } + LinkedHashSet fields = new LinkedHashSet<>(); + for (FieldBoost fieldBoost : assetConfig.getSearchFields()) { + if (!nullOrEmpty(fieldBoost.getField())) { + fields.add(fieldBoost.getField()); + } + } + return new ArrayList<>(fields); + } + + private static RankingStage copyStage(RankingStage stage, List fields) { + return new RankingStage() + .withName(stage.getName()) + .withPurpose(stage.getPurpose()) + .withFields(fields) + .withMatchType(stage.getMatchType()) + .withWeight(stage.getWeight()) + .withMinimumShouldMatch(stage.getMinimumShouldMatch()); + } + + private static List deriveFieldsForStage( + RankingStage stage, List configuredFields) { + if (configuredFields.isEmpty()) { + return stage.getFields() == null ? List.of() : stage.getFields(); + } + + String stageName = stage.getName() == null ? "" : stage.getName().toLowerCase(Locale.ROOT); + if (stageName.contains("exact")) { + return exactNameFields(configuredFields, stage.getFields()); + } + if (stageName.contains("partial") || stageName.contains("ngram")) { + return ngramNameFields(configuredFields, stage.getFields()); + } + if (stageName.contains("close") || stageName.contains("name")) { + return closeNameFields(configuredFields, stage.getFields()); + } + if (stageName.contains("description")) { + return descriptionFields(configuredFields, stage.getFields()); + } + return structuralFields(configuredFields, stage.getFields()); + } + + private static List exactNameFields( + List configuredFields, List fallback) { + LinkedHashSet fields = new LinkedHashSet<>(); + addIfConfigured(fields, configuredFields, "displayName.keyword"); + addIfConfigured(fields, configuredFields, "name.keyword"); + addIfConfigured(fields, configuredFields, "fullyQualifiedName.keyword"); + addIfConfigured(fields, configuredFields, "fullyQualifiedName"); + if (hasField(configuredFields, "displayName")) { + fields.add("displayName.keyword"); + } + if (hasField(configuredFields, "name")) { + fields.add("name.keyword"); + } + if (hasField(configuredFields, "fullyQualifiedName")) { + fields.add("fullyQualifiedName"); + } + return withFallback(fields, fallback); + } + + private static List closeNameFields( + List configuredFields, List fallback) { + LinkedHashSet fields = new LinkedHashSet<>(); + for (String field : configuredFields) { + if (isPrimaryNameField(field) && !field.endsWith(".keyword") && !field.endsWith(".ngram")) { + fields.add(field); + } + } + return withFallback(fields, fallback); + } + + private static List ngramNameFields( + List configuredFields, List fallback) { + LinkedHashSet fields = new LinkedHashSet<>(); + for (String field : configuredFields) { + if (field.endsWith(".ngram") && isPrimaryNameField(field)) { + fields.add(field); + } + } + return withFallback(fields, fallback); + } + + private static List descriptionFields( + List configuredFields, List fallback) { + LinkedHashSet fields = new LinkedHashSet<>(); + for (String field : configuredFields) { + if (isDescriptionContextField(field)) { + fields.add(field); + } + } + return withFallback(fields, fallback); + } + + private static List structuralFields( + List configuredFields, List fallback) { + LinkedHashSet fields = new LinkedHashSet<>(); + for (String field : configuredFields) { + if (!isPrimaryNameField(field) + && !isDescriptionContextField(field) + && !field.startsWith("extension.")) { + fields.add(field); + } + } + return withFallback(fields, fallback); + } + + private static List withFallback(LinkedHashSet fields, List fallback) { + if (fields.isEmpty() && fallback != null) { + fields.addAll(fallback); + } + return new ArrayList<>(fields); + } + + private static boolean hasField(List fields, String field) { + return fields.contains(field); + } + + private static void addIfConfigured( + LinkedHashSet fields, List configuredFields, String field) { + if (configuredFields.contains(field)) { + fields.add(field); + } + } + + private static boolean isPrimaryNameField(String field) { + String normalized = field; + if (normalized.endsWith(".keyword")) { + normalized = normalized.substring(0, normalized.length() - ".keyword".length()); + } else if (normalized.endsWith(".ngram")) { + normalized = normalized.substring(0, normalized.length() - ".ngram".length()); + } else if (normalized.endsWith(".compound")) { + normalized = normalized.substring(0, normalized.length() - ".compound".length()); + } + return normalized.equals("name") + || normalized.equals("displayName") + || normalized.equals("fullyQualifiedName"); + } + + private static boolean isDescriptionContextField(String field) { + String lowerField = field.toLowerCase(Locale.ROOT); + return lowerField.contains("description") + || lowerField.equals("querytext") + || lowerField.equals("extractedtext"); + } + + private static Set stopWords(RankingConfiguration ranking) { + if (ranking == null) { + return Set.of(); + } + + LinkedHashSet stopWords = new LinkedHashSet<>(); + addStopWords(stopWords, ranking.getStopWords()); + + StopWordsByLanguage stopWordsByLanguage = ranking.getStopWordsByLanguage(); + if (stopWordsByLanguage != null && stopWordsByLanguage.getAdditionalProperties() != null) { + stopWordsByLanguage + .getAdditionalProperties() + .values() + .forEach(words -> addStopWords(stopWords, words)); + } + return stopWords; + } + + private static void addStopWords(Set stopWords, List words) { + if (words == null) { + return; + } + words.stream() + .filter(word -> word != null && !word.isBlank()) + .map(word -> word.toLowerCase(Locale.ROOT)) + .forEach(stopWords::add); + } + + private static boolean isSignificantToken(String token, Set stopWords) { + if (token.isBlank() || stopWords.contains(token)) { + return false; + } + return token.codePointCount(0, token.length()) > 1 + || !isWeakSingleCharacterToken(token.codePointAt(0)); + } + + private static boolean isWeakSingleCharacterToken(int codePoint) { + return Character.UnicodeScript.of(codePoint) == Character.UnicodeScript.LATIN; + } +} diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticQueryBuilder.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticQueryBuilder.java index 543e75d6363a..2683fca666e6 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticQueryBuilder.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticQueryBuilder.java @@ -1,9 +1,14 @@ package org.openmetadata.service.search.elasticsearch; +import es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier; +import es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode; +import es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore; +import es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode; import es.co.elastic.clients.elasticsearch._types.query_dsl.Operator; import es.co.elastic.clients.elasticsearch._types.query_dsl.Query; import es.co.elastic.clients.elasticsearch._types.query_dsl.QueryStringQuery; import es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType; +import es.co.elastic.clients.json.JsonData; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -20,6 +25,22 @@ public static Query termQuery(String field, String value) { return Query.of(q -> q.term(t -> t.field(field).value(value))); } + public static Query termQuery(String field, String value, Float boost, String queryName) { + return Query.of( + q -> + q.term( + t -> { + t.field(field).value(value); + if (boost != null) { + t.boost(boost); + } + if (queryName != null) { + t.queryName(queryName); + } + return t; + })); + } + public static Query termQuery(String field, boolean value) { return Query.of(q -> q.term(t -> t.field(field).value(value))); } @@ -36,6 +57,22 @@ public static Query matchPhraseQuery(String field, String value) { return Query.of(q -> q.matchPhrase(m -> m.field(field).query(value))); } + public static Query matchPhraseQuery(String field, String value, Float boost, String queryName) { + return Query.of( + q -> + q.matchPhrase( + m -> { + m.field(field).query(value); + if (boost != null) { + m.boost(boost); + } + if (queryName != null) { + m.queryName(queryName); + } + return m; + })); + } + public static Query wildcardQuery(String field, String value) { return Query.of(q -> q.wildcard(w -> w.field(field).value(value))); } @@ -106,6 +143,85 @@ public static Query multiMatchQuery( })); } + public static Query multiMatchQuery( + String query, + Map fields, + TextQueryType type, + Operator operator, + String tieBreaker, + String fuzziness, + String minimumShouldMatch, + Float boost, + String queryName) { + return multiMatchQuery( + query, + fields, + type, + operator, + tieBreaker, + fuzziness, + minimumShouldMatch, + boost, + queryName, + null); + } + + public static Query multiMatchQuery( + String query, + Map fields, + TextQueryType type, + Operator operator, + String tieBreaker, + String fuzziness, + String minimumShouldMatch, + Float boost, + String queryName, + String analyzer) { + List fieldList = new ArrayList<>(); + fields.forEach( + (field, fieldBoost) -> { + if (fieldBoost != null && fieldBoost != 1.0f) { + fieldList.add(field + "^" + fieldBoost); + } else { + fieldList.add(field); + } + }); + return Query.of( + q -> + q.multiMatch( + m -> { + m.query(query); + m.fields(fieldList); + if (type != null) { + m.type(type); + } + if (operator != null) { + m.operator(operator); + } + if (tieBreaker != null) { + m.tieBreaker(Double.parseDouble(tieBreaker)); + } + if (fuzziness != null && !fuzziness.equals("0")) { + m.fuzziness(fuzziness); + m.prefixLength(1); + m.maxExpansions(10); + } + if (minimumShouldMatch != null) { + m.minimumShouldMatch(minimumShouldMatch); + } + if (boost != null) { + m.boost(boost); + } + if (queryName != null) { + m.queryName(queryName); + } + if (analyzer != null) { + m.analyzer(analyzer); + } + return m; + })); + } + public static Query queryStringQuery(String query) { return Query.of(q -> q.queryString(QueryStringQuery.of(qs -> qs.query(query)))); } @@ -178,6 +294,17 @@ public static BoolQueryBuilder boolQuery() { return new BoolQueryBuilder(); } + public static Query disMaxQuery(List queries, double tieBreaker) { + return Query.of( + q -> + q.disMax( + d -> { + d.queries(queries); + d.tieBreaker(tieBreaker); + return d; + })); + } + public static class BoolQueryBuilder { private final List must = new ArrayList<>(); private final List should = new ArrayList<>(); @@ -252,16 +379,16 @@ public static Query rangeQuery(String field, String gte, String lte, String gt, u -> { u.field(field); if (gte != null) { - u.gte(es.co.elastic.clients.json.JsonData.of(gte)); + u.gte(JsonData.of(gte)); } if (lte != null) { - u.lte(es.co.elastic.clients.json.JsonData.of(lte)); + u.lte(JsonData.of(lte)); } if (gt != null) { - u.gt(es.co.elastic.clients.json.JsonData.of(gt)); + u.gt(JsonData.of(gt)); } if (lt != null) { - u.lt(es.co.elastic.clients.json.JsonData.of(lt)); + u.lt(JsonData.of(lt)); } return u; }))); @@ -277,9 +404,9 @@ public static Query nestedQuery(String path, Query query) { public static Query functionScoreQuery( Query query, - java.util.List functions, - es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode scoreMode, - es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode boostMode, + List functions, + FunctionScoreMode scoreMode, + FunctionBoostMode boostMode, Float boost) { return Query.of( q -> @@ -302,20 +429,48 @@ public static Query functionScoreQuery( })); } - public static es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore weightFunction( - Query filter, double weight) { - return es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore.of( - f -> f.filter(filter).weight(weight)); + public static Query functionScoreQuery( + Query query, + List functions, + FunctionScoreMode scoreMode, + FunctionBoostMode boostMode, + Float boost, + Double maxBoost) { + return Query.of( + q -> + q.functionScore( + fs -> { + fs.query(query); + if (!functions.isEmpty()) { + fs.functions(functions); + } + if (scoreMode != null) { + fs.scoreMode(scoreMode); + } + if (boostMode != null) { + fs.boostMode(boostMode); + } + if (boost != null) { + fs.boost(boost); + } + if (maxBoost != null) { + fs.maxBoost(maxBoost); + } + return fs; + })); + } + + public static FunctionScore weightFunction(Query filter, double weight) { + return FunctionScore.of(f -> f.filter(filter).weight(weight)); } - public static es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore - fieldValueFactorFunction( - Query filter, - String field, - Double factor, - Double missing, - es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier modifier) { - return es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore.of( + public static FunctionScore fieldValueFactorFunction( + Query filter, + String field, + Double factor, + Double missing, + FieldValueFactorModifier modifier) { + return FunctionScore.of( f -> { f.filter(filter); f.fieldValueFactor( diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java index acc62d499599..041dff9b0101 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java @@ -7,12 +7,20 @@ import com.fasterxml.jackson.databind.JsonNode; import es.co.elastic.clients.elasticsearch.ElasticsearchClient; +import es.co.elastic.clients.elasticsearch._types.FieldValue; import es.co.elastic.clients.elasticsearch._types.Refresh; +import es.co.elastic.clients.elasticsearch._types.SortOrder; +import es.co.elastic.clients.elasticsearch._types.aggregations.FiltersBucket; +import es.co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery; +import es.co.elastic.clients.elasticsearch._types.query_dsl.Query; import es.co.elastic.clients.elasticsearch.cluster.ClusterStatsResponse; import es.co.elastic.clients.elasticsearch.cluster.GetClusterSettingsResponse; import es.co.elastic.clients.elasticsearch.core.BulkResponse; +import es.co.elastic.clients.elasticsearch.core.SearchResponse; import es.co.elastic.clients.elasticsearch.core.bulk.BulkOperation; +import es.co.elastic.clients.elasticsearch.core.search.Hit; import es.co.elastic.clients.elasticsearch.nodes.NodesStatsResponse; +import es.co.elastic.clients.json.JsonData; import es.co.elastic.clients.json.jackson.JacksonJsonpMapper; import es.co.elastic.clients.transport.rest5_client.Rest5ClientTransport; import es.co.elastic.clients.transport.rest5_client.low_level.Rest5Client; @@ -21,12 +29,15 @@ import jakarta.ws.rs.core.Response; import java.io.IOException; import java.security.KeyStoreException; +import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; import java.util.stream.Stream; import javax.net.ssl.SSLContext; import lombok.Getter; @@ -38,6 +49,7 @@ import org.apache.hc.core5.http.HttpHost; import org.apache.hc.core5.http.message.BasicHeader; import org.jetbrains.annotations.NotNull; +import org.openmetadata.common.utils.CommonUtil; import org.openmetadata.schema.api.entityRelationship.SearchEntityRelationshipRequest; import org.openmetadata.schema.api.entityRelationship.SearchEntityRelationshipResult; import org.openmetadata.schema.api.entityRelationship.SearchSchemaEntityRelationshipResult; @@ -50,6 +62,7 @@ import org.openmetadata.schema.dataInsight.DataInsightChartResult; import org.openmetadata.schema.dataInsight.custom.DataInsightCustomChart; import org.openmetadata.schema.dataInsight.custom.DataInsightCustomChartResultList; +import org.openmetadata.schema.entity.data.PageHierarchy; import org.openmetadata.schema.entity.data.QueryCostSearchResult; import org.openmetadata.schema.search.AggregationRequest; import org.openmetadata.schema.search.SearchRequest; @@ -58,7 +71,10 @@ import org.openmetadata.schema.type.EntityReference; import org.openmetadata.schema.type.LayerPaging; import org.openmetadata.schema.utils.JsonUtils; +import org.openmetadata.schema.utils.ResultList; import org.openmetadata.search.IndexMapping; +import org.openmetadata.service.Entity; +import org.openmetadata.service.jdbi3.KnowledgePageRepository; import org.openmetadata.service.search.SearchAggregation; import org.openmetadata.service.search.SearchClient; import org.openmetadata.service.search.SearchHealthStatus; @@ -70,6 +86,8 @@ import org.openmetadata.service.search.queries.QueryBuilderFactory; import org.openmetadata.service.search.security.RBACConditionEvaluator; import org.openmetadata.service.security.policyevaluator.SubjectContext; +import org.openmetadata.service.util.FullyQualifiedName; +import org.openmetadata.service.util.SearchUtils; import org.openmetadata.service.workflows.searchIndex.ReindexingUtil; @Slf4j @@ -1128,33 +1146,29 @@ public void initializeLineageBuilders() { @Override @lombok.SneakyThrows - public org.openmetadata.schema.utils.ResultList - listPageHierarchy(String parentFqn, String pageType, int offset, int limit) { + public ResultList listPageHierarchy( + String parentFqn, String pageType, int offset, int limit) { return getPageHierarchyFromSearch(parentFqn, pageType, offset, limit); } @Override @lombok.SneakyThrows - public org.openmetadata.schema.utils.ResultList - listPageHierarchyForActivePage(String activeFqn, String pageType, int offset, int limit) { + public ResultList listPageHierarchyForActivePage( + String activeFqn, String pageType, int offset, int limit) { return getPageHierarchyFromSearchForActivePage(activeFqn, pageType, offset, limit); } - private org.openmetadata.schema.utils.ResultList< - org.openmetadata.schema.entity.data.PageHierarchy> - getPageHierarchyFromSearch(String parentFqn, String pageType, int offset, int limit) - throws java.io.IOException { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query boolQuery = - buildPageHierarchyBoolQuery(parentFqn, pageType); + private ResultList getPageHierarchyFromSearch( + String parentFqn, String pageType, int offset, int limit) throws IOException { + Query boolQuery = buildPageHierarchyBoolQuery(parentFqn, pageType); es.co.elastic.clients.elasticsearch.core.SearchRequest searchRequest = es.co.elastic.clients.elasticsearch.core.SearchRequest.of( s -> s.index( - org.openmetadata.service.Entity.getSearchRepository() + Entity.getSearchRepository() .getIndexOrAliasName( - org.openmetadata.service.jdbi3.KnowledgePageRepository - .KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) + KnowledgePageRepository.KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) .query(boolQuery) // Stable sort so from/size pagination cannot miss/duplicate hits. // fullyQualifiedName is a keyword field with doc_values and is unique per @@ -1162,62 +1176,41 @@ public void initializeLineageBuilders() { // needed. _id cannot be used as a sort field on ES 9.x / OpenSearch 3.x // without setting indices.id_field_data.enabled=true at the cluster level. .sort( - sort -> - sort.field( - f -> - f.field("fullyQualifiedName") - .order( - es.co.elastic.clients.elasticsearch._types.SortOrder - .Asc))) + sort -> sort.field(f -> f.field("fullyQualifiedName").order(SortOrder.Asc))) .from(offset) .size(limit)); - es.co.elastic.clients.elasticsearch.core.SearchResponse - searchResponse = newClient.search(searchRequest, es.co.elastic.clients.json.JsonData.class); - java.util.List pageHierarchies = - processPageHierarchyHits(searchResponse); + SearchResponse searchResponse = newClient.search(searchRequest, JsonData.class); + List pageHierarchies = processPageHierarchyHits(searchResponse); int total = 0; if (searchResponse != null && searchResponse.hits() != null && searchResponse.hits().total() != null) { total = (int) searchResponse.hits().total().value(); } - return new org.openmetadata.schema.utils.ResultList<>( - pageHierarchies, offset, pageHierarchies.size(), total); + return new ResultList<>(pageHierarchies, offset, pageHierarchies.size(), total); } - private org.openmetadata.schema.utils.ResultList< - org.openmetadata.schema.entity.data.PageHierarchy> - getPageHierarchyFromSearchForActivePage( - String activeFqn, String pageType, int offset, int limit) throws java.io.IOException { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query boolQuery = - buildPageHierarchyBoolQueryForActivePage(activeFqn, pageType); + private ResultList getPageHierarchyFromSearchForActivePage( + String activeFqn, String pageType, int offset, int limit) throws IOException { + Query boolQuery = buildPageHierarchyBoolQueryForActivePage(activeFqn, pageType); es.co.elastic.clients.elasticsearch.core.SearchRequest searchRequest = es.co.elastic.clients.elasticsearch.core.SearchRequest.of( s -> s.index( - org.openmetadata.service.Entity.getSearchRepository() + Entity.getSearchRepository() .getIndexOrAliasName( - org.openmetadata.service.jdbi3.KnowledgePageRepository - .KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) + KnowledgePageRepository.KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) .query(boolQuery) // Stable sort by fqn (keyword, unique per page). See note above on _id. .sort( - sort -> - sort.field( - f -> - f.field("fullyQualifiedName") - .order( - es.co.elastic.clients.elasticsearch._types.SortOrder - .Asc))) + sort -> sort.field(f -> f.field("fullyQualifiedName").order(SortOrder.Asc))) .from(offset) .size(limit)); - es.co.elastic.clients.elasticsearch.core.SearchResponse - searchResponse = newClient.search(searchRequest, es.co.elastic.clients.json.JsonData.class); - java.util.List pageHierarchies = - processPageHierarchyHits(searchResponse); + SearchResponse searchResponse = newClient.search(searchRequest, JsonData.class); + List pageHierarchies = processPageHierarchyHits(searchResponse); pageHierarchies = buildPageNestedSearchHierarchy(pageHierarchies); int total = 0; if (searchResponse != null @@ -1225,106 +1218,58 @@ public void initializeLineageBuilders() { && searchResponse.hits().total() != null) { total = (int) searchResponse.hits().total().value(); } - return new org.openmetadata.schema.utils.ResultList<>( - pageHierarchies, offset, pageHierarchies.size(), total); + return new ResultList<>(pageHierarchies, offset, pageHierarchies.size(), total); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildPageHierarchyBoolQuery( - String parentFqn, String pageType) { - es.co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery.Builder boolQueryBuilder = - new es.co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery.Builder(); + private Query buildPageHierarchyBoolQuery(String parentFqn, String pageType) { + BoolQuery.Builder boolQueryBuilder = new BoolQuery.Builder(); - if (org.openmetadata.common.utils.CommonUtil.nullOrEmpty(parentFqn)) { + if (CommonUtil.nullOrEmpty(parentFqn)) { boolQueryBuilder.must( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("fqnDepth") - .value( - es.co.elastic.clients.elasticsearch._types.FieldValue.of(1))))); + Query.of(q -> q.term(t -> t.field("fqnDepth").value(FieldValue.of(1))))); } else { - int parentDepth = org.openmetadata.service.util.FullyQualifiedName.split(parentFqn).length; + int parentDepth = FullyQualifiedName.split(parentFqn).length; boolQueryBuilder.must( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> q.prefix(p -> p.field("fullyQualifiedName").value(parentFqn + ".")))); + Query.of(q -> q.prefix(p -> p.field("fullyQualifiedName").value(parentFqn + ".")))); boolQueryBuilder.must( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("fqnDepth") - .value( - es.co.elastic.clients.elasticsearch._types.FieldValue.of( - parentDepth + 1))))); + Query.of(q -> q.term(t -> t.field("fqnDepth").value(FieldValue.of(parentDepth + 1))))); } - if (!org.openmetadata.common.utils.CommonUtil.nullOrEmpty(pageType)) { + if (!CommonUtil.nullOrEmpty(pageType)) { boolQueryBuilder.must( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("pageType") - .value( - es.co.elastic.clients.elasticsearch._types.FieldValue.of( - pageType))))); + Query.of(q -> q.term(t -> t.field("pageType").value(FieldValue.of(pageType))))); } - return es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> q.bool(boolQueryBuilder.build())); + return Query.of(q -> q.bool(boolQueryBuilder.build())); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query - buildPageHierarchyBoolQueryForActivePage(String activeFqn, String pageType) { - es.co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery.Builder boolQueryBuilder = - new es.co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery.Builder(); + private Query buildPageHierarchyBoolQueryForActivePage(String activeFqn, String pageType) { + BoolQuery.Builder boolQueryBuilder = new BoolQuery.Builder(); - String rootParentFqn = org.openmetadata.service.util.FullyQualifiedName.split(activeFqn)[0]; + String rootParentFqn = FullyQualifiedName.split(activeFqn)[0]; boolQueryBuilder.should( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("fqnDepth") - .value(es.co.elastic.clients.elasticsearch._types.FieldValue.of(1))))); + Query.of(q -> q.term(t -> t.field("fqnDepth").value(FieldValue.of(1))))); boolQueryBuilder.should( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> q.prefix(p -> p.field("fullyQualifiedName").value(rootParentFqn + ".")))); + Query.of(q -> q.prefix(p -> p.field("fullyQualifiedName").value(rootParentFqn + ".")))); boolQueryBuilder.minimumShouldMatch("1"); - if (!org.openmetadata.common.utils.CommonUtil.nullOrEmpty(pageType)) { + if (!CommonUtil.nullOrEmpty(pageType)) { boolQueryBuilder.must( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("pageType") - .value( - es.co.elastic.clients.elasticsearch._types.FieldValue.of( - pageType))))); + Query.of(q -> q.term(t -> t.field("pageType").value(FieldValue.of(pageType))))); } - return es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> q.bool(boolQueryBuilder.build())); + return Query.of(q -> q.bool(boolQueryBuilder.build())); } - private java.util.List - processPageHierarchyHits( - es.co.elastic.clients.elasticsearch.core.SearchResponse< - es.co.elastic.clients.json.JsonData> - searchResponse) - throws java.io.IOException { - java.util.List pageHierarchies = - new java.util.ArrayList<>(); + private List processPageHierarchyHits(SearchResponse searchResponse) + throws IOException { + List pageHierarchies = new ArrayList<>(); if (searchResponse != null && searchResponse.hits() != null) { - for (es.co.elastic.clients.elasticsearch.core.search.Hit - hit : searchResponse.hits().hits()) { + for (Hit hit : searchResponse.hits().hits()) { if (hit.source() != null) { - java.util.Map sourceMap = EsUtils.jsonDataToMap(hit.source()); - org.openmetadata.schema.entity.data.PageHierarchy page = - org.openmetadata.service.util.SearchUtils.getPageHierarchy(sourceMap); + Map sourceMap = EsUtils.jsonDataToMap(hit.source()); + PageHierarchy page = SearchUtils.getPageHierarchy(sourceMap); pageHierarchies.add(page); } } @@ -1339,48 +1284,40 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildPageHier * instead of one search per page (N+1). Uses a filters aggregation keyed by page id, * where each bucket matches descendants via the page's fullyQualifiedName prefix. */ - private void populateChildrenCounts( - java.util.List pageHierarchies) - throws java.io.IOException { + private void populateChildrenCounts(List pageHierarchies) throws IOException { if (pageHierarchies.isEmpty()) { return; } - java.util.Map filters = - new java.util.HashMap<>(); - for (org.openmetadata.schema.entity.data.PageHierarchy page : pageHierarchies) { + Map filters = new HashMap<>(); + for (PageHierarchy page : pageHierarchies) { if (page.getId() == null || page.getFullyQualifiedName() == null || page.getFullyQualifiedName().isEmpty()) { continue; } String fqnPrefix = page.getFullyQualifiedName() + "."; - int childDepth = - org.openmetadata.service.util.FullyQualifiedName.split(page.getFullyQualifiedName()) - .length - + 1; + int childDepth = FullyQualifiedName.split(page.getFullyQualifiedName()).length + 1; // Match only direct children: FQN starts with "." AND fqnDepth is // exactly one deeper than the parent. Descendants deeper than that are excluded. filters.put( page.getId().toString(), - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( + Query.of( q -> q.bool( b -> b.must( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( + Query.of( m -> m.prefix( p -> p.field("fullyQualifiedName").value(fqnPrefix)))) .must( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( + Query.of( m -> m.term( t -> t.field("fqnDepth") - .value( - es.co.elastic.clients.elasticsearch._types - .FieldValue.of(childDepth)))))))); + .value(FieldValue.of(childDepth)))))))); page.setChildrenCount(0); } @@ -1392,18 +1329,16 @@ private void populateChildrenCounts( es.co.elastic.clients.elasticsearch.core.SearchRequest.of( s -> s.index( - org.openmetadata.service.Entity.getSearchRepository() + Entity.getSearchRepository() .getIndexOrAliasName( - org.openmetadata.service.jdbi3.KnowledgePageRepository - .KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) + KnowledgePageRepository.KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) .size(0) .aggregations( "children_by_parent", a -> a.filters(f -> f.filters(fs -> fs.keyed(filters))))); - es.co.elastic.clients.elasticsearch.core.SearchResponse - aggregationResponse = - newClient.search(aggregationRequest, es.co.elastic.clients.json.JsonData.class); + SearchResponse aggregationResponse = + newClient.search(aggregationRequest, JsonData.class); if (aggregationResponse == null || aggregationResponse.aggregations() == null @@ -1411,54 +1346,43 @@ private void populateChildrenCounts( return; } - java.util.Map - buckets = - aggregationResponse - .aggregations() - .get("children_by_parent") - .filters() - .buckets() - .keyed(); + Map buckets = + aggregationResponse.aggregations().get("children_by_parent").filters().buckets().keyed(); - for (org.openmetadata.schema.entity.data.PageHierarchy page : pageHierarchies) { + for (PageHierarchy page : pageHierarchies) { if (page.getId() == null) { continue; } - es.co.elastic.clients.elasticsearch._types.aggregations.FiltersBucket bucket = - buckets.get(page.getId().toString()); + FiltersBucket bucket = buckets.get(page.getId().toString()); if (bucket != null) { page.setChildrenCount((int) bucket.docCount()); } } } - private java.util.List - buildPageNestedSearchHierarchy( - java.util.List pageHierarchyList) { - java.util.Map - pageHierarchyMap = - pageHierarchyList.stream() - // Skip hits that lost their id during parsing (SearchUtils returns a - // null id for malformed/missing UUID strings) so Collectors.toMap - // does not throw on the null key. - .filter(p -> p.getId() != null) - .collect( - java.util.stream.Collectors.toMap( - org.openmetadata.schema.entity.data.PageHierarchy::getId, - page -> { - page.setChildren(new java.util.ArrayList<>()); - return page; - }, - (existing, replacement) -> existing, - java.util.LinkedHashMap::new)); - - java.util.List rootPages = - new java.util.ArrayList<>(); - - for (org.openmetadata.schema.entity.data.PageHierarchy page : pageHierarchyMap.values()) { - java.util.UUID parentId = page.getParent() != null ? page.getParent().getId() : null; - org.openmetadata.schema.entity.data.PageHierarchy parentPage = - parentId != null ? pageHierarchyMap.get(parentId) : null; + private List buildPageNestedSearchHierarchy( + List pageHierarchyList) { + Map pageHierarchyMap = + pageHierarchyList.stream() + // Skip hits that lost their id during parsing (SearchUtils returns a + // null id for malformed/missing UUID strings) so Collectors.toMap + // does not throw on the null key. + .filter(p -> p.getId() != null) + .collect( + Collectors.toMap( + PageHierarchy::getId, + page -> { + page.setChildren(new ArrayList<>()); + return page; + }, + (existing, replacement) -> existing, + LinkedHashMap::new)); + + List rootPages = new ArrayList<>(); + + for (PageHierarchy page : pageHierarchyMap.values()) { + UUID parentId = page.getParent() != null ? page.getParent().getId() : null; + PageHierarchy parentPage = parentId != null ? pageHierarchyMap.get(parentId) : null; if (parentPage != null) { parentPage.getChildren().add(page); } else { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchSourceBuilderFactory.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchSourceBuilderFactory.java index 0af9d81409c7..3a176a9e6146 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchSourceBuilderFactory.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchSourceBuilderFactory.java @@ -13,8 +13,13 @@ import static org.openmetadata.service.search.SearchUtils.isServiceIndex; import static org.openmetadata.service.search.SearchUtils.isTimeSeriesIndex; +import es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier; +import es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode; import es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore; +import es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode; +import es.co.elastic.clients.elasticsearch._types.query_dsl.Operator; import es.co.elastic.clients.elasticsearch._types.query_dsl.Query; +import es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType; import es.co.elastic.clients.elasticsearch.core.search.Highlight; import java.util.ArrayList; import java.util.HashMap; @@ -26,10 +31,13 @@ import org.openmetadata.schema.api.search.AssetTypeConfiguration; import org.openmetadata.schema.api.search.FieldBoost; import org.openmetadata.schema.api.search.FieldValueBoost; +import org.openmetadata.schema.api.search.RankingConfiguration; +import org.openmetadata.schema.api.search.RankingStage; import org.openmetadata.schema.api.search.SearchSettings; import org.openmetadata.schema.api.search.TermBoost; import org.openmetadata.service.Entity; import org.openmetadata.service.search.CustomPropertySearchFields; +import org.openmetadata.service.search.SearchRankingHelper; import org.openmetadata.service.search.SearchSourceBuilderFactory; import org.openmetadata.service.search.indexes.ColumnSearchIndex; import org.openmetadata.service.search.indexes.ContextMemoryIndex; @@ -59,6 +67,7 @@ public class ElasticSearchSourceBuilderFactory private static final float DEFAULT_TIE_BREAKER = 0.3f; private static final float DEFAULT_BOOST = 1.0f; private static final float FUNCTION_BOOST_FACTOR = 0.3f; + private static final String RANKING_QUERY_PREFIX = "ranking:"; private final SearchSettings searchSettings; @@ -207,8 +216,7 @@ private Map extractAllFields(AssetTypeConfiguration assetConfig) return allFields; } - public es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildSearchQueryBuilderV2( - String query, Map fields) { + public Query buildSearchQueryBuilderV2(String query, Map fields) { Map fuzzyFields = fields.entrySet().stream() .filter(entry -> isFuzzyField(entry.getKey())) @@ -219,23 +227,23 @@ public es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildSearchQue .filter(entry -> isNonFuzzyField(entry.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query fuzzyQuery = + Query fuzzyQuery = ElasticQueryBuilder.queryStringQuery( query, fuzzyFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.Operator.And, + Operator.And, "1", 10, 3, DEFAULT_TIE_BREAKER, - es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType.MostFields); + TextQueryType.MostFields); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query nonFuzzyQuery = + Query nonFuzzyQuery = ElasticQueryBuilder.multiMatchQuery( query, nonFuzzyFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType.MostFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.Operator.And, + TextQueryType.MostFields, + Operator.And, String.valueOf(DEFAULT_TIE_BREAKER), "0"); @@ -247,10 +255,7 @@ public es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildSearchQue } public ElasticSearchRequestBuilder searchBuilderV2( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query query, - es.co.elastic.clients.elasticsearch.core.search.Highlight highlightBuilder, - int fromOffset, - int size) { + Query query, Highlight highlightBuilder, int fromOffset, int size) { ElasticSearchRequestBuilder builder = new ElasticSearchRequestBuilder(); builder.query(query); if (highlightBuilder != null) { @@ -263,8 +268,7 @@ public ElasticSearchRequestBuilder searchBuilderV2( public ElasticSearchRequestBuilder buildUserOrTeamSearchBuilderV2( String query, int from, int size) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, UserIndex.getFields()); + Query queryBuilder = buildSearchQueryBuilderV2(query, UserIndex.getFields()); return searchBuilderV2(queryBuilder, null, from, size); } @@ -292,8 +296,7 @@ private ElasticSearchRequestBuilder addAggregationV2( return searchRequestBuilder; } - public es.co.elastic.clients.elasticsearch.core.search.Highlight buildHighlightsV2( - List fields) { + public Highlight buildHighlightsV2(List fields) { ElasticHighlightBuilder hb = new ElasticHighlightBuilder(); hb.preTags(PRE_TAG); hb.postTags(POST_TAG); @@ -373,40 +376,34 @@ public ElasticSearchRequestBuilder buildTimeSeriesSearchBuilderV2( } public ElasticSearchRequestBuilder buildColumnSearchBuilderV2(String query, int from, int size) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query queryBuilder; + Query queryBuilder; if (nullOrEmpty(query) || "*".equals(query.trim())) { - queryBuilder = - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of(q -> q.matchAll(m -> m)); + queryBuilder = Query.of(q -> q.matchAll(m -> m)); } else { Map fields = ColumnSearchIndex.getFields(); queryBuilder = ElasticQueryBuilder.multiMatchQuery( query, fields, - es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType.BestFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.Operator.Or, + TextQueryType.BestFields, + Operator.Or, String.valueOf(DEFAULT_TIE_BREAKER), "0"); } - es.co.elastic.clients.elasticsearch.core.search.Highlight hb = - buildHighlightsV2(List.of("name", "displayName", "description")); + Highlight hb = buildHighlightsV2(List.of("name", "displayName", "description")); return searchBuilderV2(queryBuilder, hb, from, size); } public ElasticSearchRequestBuilder buildServiceSearchBuilderV2(String query, int from, int size) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, SearchIndex.getDefaultFields()); - es.co.elastic.clients.elasticsearch.core.search.Highlight hb = - buildHighlightsV2(new ArrayList<>()); + Query queryBuilder = buildSearchQueryBuilderV2(query, SearchIndex.getDefaultFields()); + Highlight hb = buildHighlightsV2(new ArrayList<>()); return searchBuilderV2(queryBuilder, hb, from, size); } public ElasticSearchRequestBuilder buildContextMemorySearchBuilderV2( String query, int from, int size) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, ContextMemoryIndex.getFields()); - es.co.elastic.clients.elasticsearch.core.search.Highlight hb = - buildHighlightsV2(List.of("title", "summary", "question", "answer")); + Query queryBuilder = buildSearchQueryBuilderV2(query, ContextMemoryIndex.getFields()); + Highlight hb = buildHighlightsV2(List.of("title", "summary", "question", "answer")); return searchBuilderV2(queryBuilder, hb, from, size); } @@ -429,12 +426,9 @@ public ElasticSearchRequestBuilder buildDataAssetSearchBuilderV2( boolean explain, boolean includeAggregations) { AssetTypeConfiguration assetConfig = getAssetConfiguration(indexName); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query baseQuery = - buildBaseQueryV2(query, assetConfig); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query finalQuery = - applyFunctionScoringV2(baseQuery, assetConfig); - es.co.elastic.clients.elasticsearch.core.search.Highlight highlightBuilder = - buildHighlightingIfNeededV2(query, assetConfig); + Query baseQuery = buildBaseQueryV2(query, assetConfig); + Query finalQuery = applyFunctionScoringV2(baseQuery, assetConfig); + Highlight highlightBuilder = buildHighlightingIfNeededV2(query, assetConfig); ElasticSearchRequestBuilder searchRequestBuilder = createSearchSourceBuilderV2(finalQuery, from, size); @@ -459,10 +453,8 @@ public ElasticSearchRequestBuilder buildAggregateSearchBuilderV2( public ElasticSearchRequestBuilder buildAggregateSearchBuilderV2( String query, int from, int size, boolean includeAggregations) { AssetTypeConfiguration compositeConfig = buildCompositeAssetConfig(searchSettings); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query baseQuery = - buildQueryWithMatchTypesV2(query, compositeConfig); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query finalQuery = - applyFunctionScoringV2(baseQuery, compositeConfig); + Query baseQuery = buildQueryWithMatchTypesV2(query, compositeConfig); + Query finalQuery = applyFunctionScoringV2(baseQuery, compositeConfig); ElasticSearchRequestBuilder searchRequestBuilder = searchBuilderV2(finalQuery, null, from, size); @@ -484,34 +476,28 @@ public ElasticSearchRequestBuilder buildDataQualitySearchBuilderV2( } public ElasticSearchRequestBuilder buildTestCaseSearchV2(String query, int from, int size) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, TestCaseIndex.getFields()); - es.co.elastic.clients.elasticsearch.core.search.Highlight hb = - buildHighlightsV2(List.of("testSuite.name", "testSuite.description")); + Query queryBuilder = buildSearchQueryBuilderV2(query, TestCaseIndex.getFields()); + Highlight hb = buildHighlightsV2(List.of("testSuite.name", "testSuite.description")); return searchBuilderV2(queryBuilder, hb, from, size); } public ElasticSearchRequestBuilder buildTestCaseResultSearchV2(String query, int from, int size) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, TestCaseResultIndex.getFields()); - es.co.elastic.clients.elasticsearch.core.search.Highlight hb = - buildHighlightsV2(new ArrayList<>()); + Query queryBuilder = buildSearchQueryBuilderV2(query, TestCaseResultIndex.getFields()); + Highlight hb = buildHighlightsV2(new ArrayList<>()); return searchBuilderV2(queryBuilder, hb, from, size); } public ElasticSearchRequestBuilder buildTestCaseResolutionStatusSearchV2( String query, int from, int size) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query queryBuilder = + Query queryBuilder = buildSearchQueryBuilderV2(query, TestCaseResolutionStatusIndex.getFields()); - es.co.elastic.clients.elasticsearch.core.search.Highlight hb = - buildHighlightsV2(new ArrayList<>()); + Highlight hb = buildHighlightsV2(new ArrayList<>()); return searchBuilderV2(queryBuilder, hb, from, size); } public ElasticSearchRequestBuilder buildCostAnalysisReportDataSearchV2( String query, int from, int size) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query queryBuilder = - ElasticQueryBuilder.queryStringQuery(query); + Query queryBuilder = ElasticQueryBuilder.queryStringQuery(query); return searchBuilderV2(queryBuilder, null, from, size); } @@ -522,10 +508,8 @@ public ElasticSearchRequestBuilder buildCommonSearchBuilderV2(String query, int query, defaultConfig.getAssetType()); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query baseQuery = - buildQueryWithMatchTypesV2(query, defaultConfig); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query finalQuery = - applyGlobalBoostsV2(baseQuery); + Query baseQuery = buildQueryWithMatchTypesV2(query, defaultConfig); + Query finalQuery = applyGlobalBoostsV2(baseQuery); ElasticSearchRequestBuilder searchRequestBuilder = createCommonSearchSourceBuilderV2(finalQuery, from, size); @@ -538,21 +522,17 @@ public ElasticSearchRequestBuilder buildCommonSearchBuilderV2(String query, int public ElasticSearchRequestBuilder buildEntitySpecificAggregateSearchBuilderV2( String query, int from, int size) { AssetTypeConfiguration compositeConfig = buildCompositeAssetConfig(searchSettings); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query baseQuery = - buildQueryWithMatchTypesV2(query, compositeConfig); + Query baseQuery = buildQueryWithMatchTypesV2(query, compositeConfig); - List functions = - collectAllBoostFunctionsV2(); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query finalQuery = - applyBoostFunctionsV2(baseQuery, functions); + List functions = collectAllBoostFunctionsV2(); + Query finalQuery = applyBoostFunctionsV2(baseQuery, functions); ElasticSearchRequestBuilder searchRequestBuilder = searchBuilderV2(finalQuery, null, from, size); return addAggregationV2(searchRequestBuilder); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildBaseQueryV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildBaseQueryV2(String query, AssetTypeConfiguration assetConfig) { if (query == null || query.trim().isEmpty() || query.trim().equals("*")) { return ElasticQueryBuilder.boolQuery().must(ElasticQueryBuilder.matchAllQuery()).build(); } else if (containsQuerySyntax(query)) { @@ -562,30 +542,29 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildBaseQuer } } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildComplexSyntaxQueryV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildComplexSyntaxQueryV2(String query, AssetTypeConfiguration assetConfig) { Map fuzzyFields = new HashMap<>(); Map nonFuzzyFields = new HashMap<>(); classifyFields(assetConfig, fuzzyFields, nonFuzzyFields); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query fuzzyQuery = + Query fuzzyQuery = ElasticQueryBuilder.queryStringQuery( query, fuzzyFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.Operator.And, + Operator.And, "1", 10, 3, DEFAULT_TIE_BREAKER, - es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType.MostFields); + TextQueryType.MostFields); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query nonFuzzyQuery = + Query nonFuzzyQuery = ElasticQueryBuilder.multiMatchQuery( query, nonFuzzyFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType.MostFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.Operator.And, + TextQueryType.MostFields, + Operator.And, String.valueOf(DEFAULT_TIE_BREAKER), "0"); @@ -597,8 +576,60 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildComplexS .build(); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildSimpleQueryV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildSimpleQueryV2(String query, AssetTypeConfiguration assetConfig) { + RankingConfiguration ranking = SearchRankingHelper.resolveRanking(searchSettings, assetConfig); + if (ranking != null) { + return buildRankedSimpleQueryV2(query, assetConfig, ranking); + } + + ElasticQueryBuilder.BoolQueryBuilder combinedQuery = ElasticQueryBuilder.boolQuery(); + MatchTypeMultipliers multipliers = getMatchTypeMultipliers(assetConfig); + Map> fieldsByMatchType = groupFieldsByMatchType(assetConfig); + + addExactMatchQueriesV2( + combinedQuery, query, fieldsByMatchType.get(MATCH_TYPE_EXACT), multipliers.exactMatch); + addPhraseMatchQueriesV2( + combinedQuery, query, fieldsByMatchType.get(MATCH_TYPE_PHRASE), multipliers.phraseMatch); + addFuzzyMatchQueriesV2( + combinedQuery, query, fieldsByMatchType.get(MATCH_TYPE_FUZZY), multipliers.fuzzyMatch); + addStandardMatchQueriesV2(combinedQuery, query, fieldsByMatchType.get(MATCH_TYPE_STANDARD)); + addCustomPropertyMatchQueriesV2(combinedQuery, query, assetConfig); + + combinedQuery.minimumShouldMatch(1); + return ElasticQueryBuilder.boolQuery().must(combinedQuery.build()).build(); + } + + private Query buildRankedSimpleQueryV2( + String query, AssetTypeConfiguration assetConfig, RankingConfiguration ranking) { + List stageQueries = new ArrayList<>(); + String significantQuery = SearchRankingHelper.significantQueryText(query, ranking); + String exactSignificantQuery = + SearchRankingHelper.significantQueryTextPreservingCase(query, ranking); + + for (RankingStage stage : listOrEmpty(ranking.getStages())) { + Query stageQuery = + buildRankingStageQueryV2(query, significantQuery, exactSignificantQuery, stage); + if (stageQuery != null) { + stageQueries.add(stageQuery); + } + } + + if (stageQueries.isEmpty()) { + return buildLegacySimpleQueryV2(query, assetConfig); + } + + ElasticQueryBuilder.BoolQueryBuilder combinedQuery = ElasticQueryBuilder.boolQuery(); + combinedQuery.should( + stageQueries.size() == 1 + ? stageQueries.getFirst() + : ElasticQueryBuilder.disMaxQuery( + stageQueries, SearchRankingHelper.disMaxTieBreaker(ranking))); + addCustomPropertyMatchQueriesV2(combinedQuery, query, assetConfig); + combinedQuery.minimumShouldMatch(1); + return ElasticQueryBuilder.boolQuery().must(combinedQuery.build()).build(); + } + + private Query buildLegacySimpleQueryV2(String query, AssetTypeConfiguration assetConfig) { ElasticQueryBuilder.BoolQueryBuilder combinedQuery = ElasticQueryBuilder.boolQuery(); MatchTypeMultipliers multipliers = getMatchTypeMultipliers(assetConfig); Map> fieldsByMatchType = groupFieldsByMatchType(assetConfig); @@ -616,6 +647,84 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildSimpleQu return ElasticQueryBuilder.boolQuery().must(combinedQuery.build()).build(); } + private Query buildRankingStageQueryV2( + String originalQuery, + String significantQuery, + String exactSignificantQuery, + RankingStage stage) { + if (stage.getFields() == null || stage.getFields().isEmpty()) { + return null; + } + + RankingStage.MatchType matchType = + stage.getMatchType() == null ? RankingStage.MatchType.STANDARD : stage.getMatchType(); + return switch (matchType) { + case EXACT -> buildExactRankingStageQueryV2(exactSignificantQuery, stage); + case PHRASE -> buildPhraseRankingStageQueryV2(originalQuery, stage); + case FUZZY -> buildTextRankingStageQueryV2( + significantQuery, stage, getFuzziness(significantQuery)); + case TOKEN_COVERAGE, STANDARD -> buildTextRankingStageQueryV2(significantQuery, stage, "0"); + }; + } + + private Query buildExactRankingStageQueryV2(String query, RankingStage stage) { + List exactTexts = SearchRankingHelper.exactMatchTexts(query); + if (exactTexts.isEmpty()) { + return null; + } + + ElasticQueryBuilder.BoolQueryBuilder exactQuery = ElasticQueryBuilder.boolQuery(); + float weight = SearchRankingHelper.stageWeight(stage); + for (String field : stage.getFields()) { + for (int index = 0; index < exactTexts.size(); index++) { + exactQuery.should( + ElasticQueryBuilder.termQuery( + field, + exactTexts.get(index), + weight, + rankingQueryName(stage, field, String.valueOf(index)))); + } + } + exactQuery.minimumShouldMatch(1); + return exactQuery.build(); + } + + private Query buildPhraseRankingStageQueryV2(String query, RankingStage stage) { + ElasticQueryBuilder.BoolQueryBuilder phraseQuery = ElasticQueryBuilder.boolQuery(); + float weight = SearchRankingHelper.stageWeight(stage); + for (String field : stage.getFields()) { + phraseQuery.should( + ElasticQueryBuilder.matchPhraseQuery( + field, query, weight, rankingQueryName(stage, field))); + } + phraseQuery.minimumShouldMatch(1); + return phraseQuery.build(); + } + + private Query buildTextRankingStageQueryV2(String query, RankingStage stage, String fuzziness) { + Map fields = new LinkedHashMap<>(); + stage.getFields().forEach(field -> fields.put(field, DEFAULT_BOOST)); + return ElasticQueryBuilder.multiMatchQuery( + query, + fields, + TextQueryType.BestFields, + Operator.Or, + String.valueOf(DEFAULT_TIE_BREAKER), + fuzziness, + SearchRankingHelper.minimumShouldMatch(stage), + SearchRankingHelper.stageWeight(stage), + rankingQueryName(stage, "text"), + SearchRankingHelper.stageSearchAnalyzer(stage)); + } + + private String rankingQueryName(RankingStage stage, String field) { + return RANKING_QUERY_PREFIX + stage.getName() + ":" + field; + } + + private String rankingQueryName(RankingStage stage, String field, String suffix) { + return rankingQueryName(stage, field) + ":" + suffix; + } + /** * Adds a nested {@code customPropertiesTyped} clause for each admin-configured {@code * extension.} search field. The raw {@code extension} field is {@code enabled:false} so an @@ -631,9 +740,8 @@ private void addCustomPropertyMatchQueriesV2( } } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query customPropertyNestedQueryV2( - String query, CustomPropertySearchFields.Spec spec) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query inner = + private Query customPropertyNestedQueryV2(String query, CustomPropertySearchFields.Spec spec) { + Query inner = ElasticQueryBuilder.boolQuery() .must(customPropertyTermV2(CustomPropertySearchFields.NAME_FIELD, spec.propertyName())) .must(customPropertyValueQueryV2(query, spec)) @@ -642,12 +750,11 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query customPropert CustomPropertySearchFields.CUSTOM_PROPERTIES_TYPED, inner); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query customPropertyValueQueryV2( - String query, CustomPropertySearchFields.Spec spec) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query result; + private Query customPropertyValueQueryV2(String query, CustomPropertySearchFields.Spec spec) { + Query result; if (spec.exact()) { result = - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( + Query.of( q -> q.term( t -> @@ -656,7 +763,7 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query customPropert .boost(spec.boost()))); } else { result = - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( + Query.of( q -> q.match( m -> @@ -667,10 +774,8 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query customPropert return result; } - private static es.co.elastic.clients.elasticsearch._types.query_dsl.Query customPropertyTermV2( - String field, String value) { - return es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( - q -> q.term(t -> t.field(field).value(value))); + private static Query customPropertyTermV2(String field, String value) { + return Query.of(q -> q.term(t -> t.field(field).value(value))); } private void addExactMatchQueriesV2( @@ -683,7 +788,7 @@ private void addExactMatchQueriesV2( fields.forEach( (field, boost) -> exactMatchQuery.should( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( + Query.of( q -> q.term( t -> @@ -706,7 +811,7 @@ private void addPhraseMatchQueriesV2( fields.forEach( (field, boost) -> phraseMatchQuery.should( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( + Query.of( q -> q.matchPhrase( m -> m.field(field).query(query).boost(boost * multiplier))))); @@ -735,21 +840,18 @@ private void addFuzzyMatchQueriesV2( String fuzziness = getFuzziness(query); int maxExpansions = getMaxExpansions(query); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query fuzzyQuery = - es.co.elastic.clients.elasticsearch._types.query_dsl.Query.of( + Query fuzzyQuery = + Query.of( q -> q.multiMatch( m -> m.query(query) .fields(fieldList) - .type( - es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType - .MostFields) + .type(TextQueryType.MostFields) .fuzziness(fuzziness) .maxExpansions(maxExpansions) .prefixLength(1) - .operator( - es.co.elastic.clients.elasticsearch._types.query_dsl.Operator.Or) + .operator(Operator.Or) .minimumShouldMatch(MINIMUM_SHOULD_MATCH) .tieBreaker((double) DEFAULT_TIE_BREAKER) .boost(multiplier))); @@ -773,55 +875,46 @@ private void addStandardMatchQueriesV2( .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); if (!fuzzyFields.isEmpty()) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query fuzzyQueryBuilder = - createStandardFuzzyQueryV2(query, fuzzyFields); + Query fuzzyQueryBuilder = createStandardFuzzyQueryV2(query, fuzzyFields); combinedQuery.should(fuzzyQueryBuilder); } if (!nonFuzzyFields.isEmpty()) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query nonFuzzyQueryBuilder = - createStandardNonFuzzyQueryV2(query, nonFuzzyFields); + Query nonFuzzyQueryBuilder = createStandardNonFuzzyQueryV2(query, nonFuzzyFields); combinedQuery.should(nonFuzzyQueryBuilder); } } } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query createStandardFuzzyQueryV2( - String query, Map fields) { + private Query createStandardFuzzyQueryV2(String query, Map fields) { return ElasticQueryBuilder.multiMatchQuery( query, fields, - es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType.MostFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.Operator.Or, + TextQueryType.MostFields, + Operator.Or, String.valueOf(DEFAULT_TIE_BREAKER), getFuzziness(query)); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query createStandardNonFuzzyQueryV2( - String query, Map fields) { + private Query createStandardNonFuzzyQueryV2(String query, Map fields) { return ElasticQueryBuilder.multiMatchQuery( query, fields, - es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType.MostFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.Operator.And, + TextQueryType.MostFields, + Operator.And, String.valueOf(DEFAULT_TIE_BREAKER), "0"); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore - buildTermBoostFunctionV2(TermBoost tb) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query filter = - ElasticQueryBuilder.termQuery(tb.getField(), tb.getValue()); + private FunctionScore buildTermBoostFunctionV2(TermBoost tb) { + Query filter = ElasticQueryBuilder.termQuery(tb.getField(), tb.getValue()); return ElasticQueryBuilder.weightFunction(filter, tb.getBoost()); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore - buildFieldValueBoostFunctionV2(FieldValueBoost fvb) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query condition = - buildConditionQueryV2(fvb); + private FunctionScore buildFieldValueBoostFunctionV2(FieldValueBoost fvb) { + Query condition = buildConditionQueryV2(fvb); - es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier modifier = - toFieldValueFactorModifierV2(fvb.getModifier()); + FieldValueFactorModifier modifier = toFieldValueFactorModifierV2(fvb.getModifier()); return ElasticQueryBuilder.fieldValueFactorFunction( condition, @@ -831,8 +924,7 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query createStandar modifier); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildConditionQueryV2( - FieldValueBoost fvb) { + private Query buildConditionQueryV2(FieldValueBoost fvb) { if (fvb.getCondition() == null || fvb.getCondition().getRange() == null) { return ElasticQueryBuilder.matchAllQuery(); } @@ -848,62 +940,48 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildConditio return ElasticQueryBuilder.rangeQuery(field, gte, lte, gt, lt); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier - toFieldValueFactorModifierV2(FieldValueBoost.Modifier modifier) { + private FieldValueFactorModifier toFieldValueFactorModifierV2(FieldValueBoost.Modifier modifier) { if (modifier == null) { return null; } return switch (modifier.value()) { - case "log" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier - .Log; - case "log1p" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier - .Log1p; - case "sqrt" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier - .Sqrt; - case "square" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier - .Square; - case "ln" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier.Ln; - case "ln1p" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier - .Ln1p; - case "ln2p" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier - .Ln2p; - case "reciprocal" -> es.co.elastic.clients.elasticsearch._types.query_dsl - .FieldValueFactorModifier.Reciprocal; + case "log" -> FieldValueFactorModifier.Log; + case "log1p" -> FieldValueFactorModifier.Log1p; + case "sqrt" -> FieldValueFactorModifier.Sqrt; + case "square" -> FieldValueFactorModifier.Square; + case "ln" -> FieldValueFactorModifier.Ln; + case "ln1p" -> FieldValueFactorModifier.Ln1p; + case "ln2p" -> FieldValueFactorModifier.Ln2p; + case "reciprocal" -> FieldValueFactorModifier.Reciprocal; default -> null; }; } - private es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode toScoreModeV2( - String mode) { + private FunctionScoreMode toScoreModeV2(String mode) { return switch (mode.toLowerCase()) { - case "avg" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode.Avg; - case "max" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode.Max; - case "min" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode.Min; - case "multiply" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode - .Multiply; - case "first" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode.First; - default -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode.Sum; + case "avg" -> FunctionScoreMode.Avg; + case "max" -> FunctionScoreMode.Max; + case "min" -> FunctionScoreMode.Min; + case "multiply" -> FunctionScoreMode.Multiply; + case "first" -> FunctionScoreMode.First; + default -> FunctionScoreMode.Sum; }; } - private es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode toBoostModeV2( - String mode) { + private FunctionBoostMode toBoostModeV2(String mode) { return switch (mode.toLowerCase()) { - case "sum" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode.Sum; - case "avg" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode.Avg; - case "max" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode.Max; - case "min" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode.Min; - case "replace" -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode - .Replace; - default -> es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode.Multiply; + case "sum" -> FunctionBoostMode.Sum; + case "avg" -> FunctionBoostMode.Avg; + case "max" -> FunctionBoostMode.Max; + case "min" -> FunctionBoostMode.Min; + case "replace" -> FunctionBoostMode.Replace; + default -> FunctionBoostMode.Multiply; }; } - private List - collectBoostFunctionsV2(AssetTypeConfiguration assetConfig) { - List functions = - new ArrayList<>(); + private List collectBoostFunctionsV2(AssetTypeConfiguration assetConfig) { + List functions = new ArrayList<>(); // Add baseline weight of 1.0 so that assets with no tier/usage retain their text score // when boostMode is multiply. Without this, function_score could be 0 and zero out the @@ -934,36 +1012,33 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode t return functions; } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query applyFunctionScoringV2( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query baseQuery, - AssetTypeConfiguration assetConfig) { - List functions = - collectBoostFunctionsV2(assetConfig); + private Query applyFunctionScoringV2(Query baseQuery, AssetTypeConfiguration assetConfig) { + List functions = collectBoostFunctionsV2(assetConfig); if (functions.isEmpty()) { return baseQuery; } - es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode scoreMode; - if (assetConfig.getScoreMode() != null) { - scoreMode = toScoreModeV2(assetConfig.getScoreMode().value()); - } else { - scoreMode = es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode.Sum; - } - - es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode boostMode; - if (assetConfig.getBoostMode() != null) { - boostMode = toBoostModeV2(assetConfig.getBoostMode().value()); - } else { - boostMode = es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode.Sum; - } + RankingConfiguration ranking = SearchRankingHelper.resolveRanking(searchSettings, assetConfig); + String scoreModeValue = + assetConfig.getScoreMode() != null ? assetConfig.getScoreMode().value() : "sum"; + String boostModeValue = + assetConfig.getBoostMode() != null ? assetConfig.getBoostMode().value() : "sum"; + FunctionScoreMode scoreMode = + toScoreModeV2(SearchRankingHelper.signalScoreMode(ranking, scoreModeValue)); + FunctionBoostMode boostMode = + toBoostModeV2(SearchRankingHelper.signalBoostMode(ranking, boostModeValue)); return ElasticQueryBuilder.functionScoreQuery( - baseQuery, functions, scoreMode, boostMode, FUNCTION_BOOST_FACTOR); + baseQuery, + functions, + scoreMode, + boostMode, + FUNCTION_BOOST_FACTOR, + SearchRankingHelper.signalMaxBoost(ranking)); } - private es.co.elastic.clients.elasticsearch.core.search.Highlight buildHighlightingIfNeededV2( - String query, AssetTypeConfiguration assetConfig) { + private Highlight buildHighlightingIfNeededV2(String query, AssetTypeConfiguration assetConfig) { if (query == null || query.trim().isEmpty()) { return null; } @@ -977,8 +1052,7 @@ private es.co.elastic.clients.elasticsearch.core.search.Highlight buildHighlight return null; } - private ElasticSearchRequestBuilder createSearchSourceBuilderV2( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query query, int from, int size) { + private ElasticSearchRequestBuilder createSearchSourceBuilderV2(Query query, int from, int size) { int maxHits = searchSettings.getGlobalSettings().getMaxResultHits(); ElasticSearchRequestBuilder builder = new ElasticSearchRequestBuilder(); builder.query(query); @@ -1016,8 +1090,7 @@ protected void addConfiguredAggregationsV2( } } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildQueryWithMatchTypesV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildQueryWithMatchTypesV2(String query, AssetTypeConfiguration assetConfig) { if (query == null || query.trim().isEmpty() || query.trim().equals("*")) { return ElasticQueryBuilder.boolQuery().must(ElasticQueryBuilder.matchAllQuery()).build(); } @@ -1029,26 +1102,22 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildQueryWit return buildSimpleQueryWithTypesV2(query, assetConfig); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildComplexQueryV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildComplexQueryV2(String query, AssetTypeConfiguration assetConfig) { Map allFields = extractAllFields(assetConfig); - es.co.elastic.clients.elasticsearch._types.query_dsl.Query queryStringBuilder = + Query queryStringBuilder = ElasticQueryBuilder.queryStringQuery( - query, - allFields, - es.co.elastic.clients.elasticsearch._types.query_dsl.Operator.And, - null, - 50, - 0, - 0.5, - es.co.elastic.clients.elasticsearch._types.query_dsl.TextQueryType.MostFields); + query, allFields, Operator.And, null, 50, 0, 0.5, TextQueryType.MostFields); return ElasticQueryBuilder.boolQuery().must(queryStringBuilder).build(); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildSimpleQueryWithTypesV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildSimpleQueryWithTypesV2(String query, AssetTypeConfiguration assetConfig) { + RankingConfiguration ranking = SearchRankingHelper.resolveRanking(searchSettings, assetConfig); + if (ranking != null) { + return buildRankedSimpleQueryV2(query, assetConfig, ranking); + } + ElasticQueryBuilder.BoolQueryBuilder combinedQuery = ElasticQueryBuilder.boolQuery(); MatchTypeMultipliers multipliers = getMatchTypeMultipliers(assetConfig); Map> fieldsByType = groupFieldsByMatchType(assetConfig); @@ -1075,10 +1144,8 @@ private void addMatchTypeQueriesV2( addStandardMatchQueriesV2(combinedQuery, query, fieldsByType.get(MATCH_TYPE_STANDARD)); } - private List - collectGlobalBoostFunctionsV2() { - List functions = - new ArrayList<>(); + private List collectGlobalBoostFunctionsV2() { + List functions = new ArrayList<>(); if (searchSettings.getGlobalSettings().getTermBoosts() != null) { searchSettings.getGlobalSettings().getTermBoosts().stream() @@ -1095,25 +1162,19 @@ private void addMatchTypeQueriesV2( return functions; } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query applyGlobalBoostsV2( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query baseQuery) { - List functions = - collectGlobalBoostFunctionsV2(); + private Query applyGlobalBoostsV2(Query baseQuery) { + List functions = collectGlobalBoostFunctionsV2(); if (functions.isEmpty()) { return baseQuery; } return ElasticQueryBuilder.functionScoreQuery( - baseQuery, - functions, - es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode.Sum, - es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode.Sum, - FUNCTION_BOOST_FACTOR); + baseQuery, functions, FunctionScoreMode.Sum, FunctionBoostMode.Sum, FUNCTION_BOOST_FACTOR); } private ElasticSearchRequestBuilder createCommonSearchSourceBuilderV2( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query query, int from, int size) { + Query query, int from, int size) { return createSearchSourceBuilderV2(query, from, size); } @@ -1124,9 +1185,8 @@ private void addHighlightsIfConfiguredV2(ElasticSearchRequestBuilder searchReque } } - private es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore - buildEntitySpecificTermBoostV2(String assetType, TermBoost tb) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query filter = + private FunctionScore buildEntitySpecificTermBoostV2(String assetType, TermBoost tb) { + Query filter = ElasticQueryBuilder.boolQuery() .must(ElasticQueryBuilder.termQuery("entityType", assetType)) .must(ElasticQueryBuilder.termQuery(tb.getField(), tb.getValue())) @@ -1135,29 +1195,26 @@ private void addHighlightsIfConfiguredV2(ElasticSearchRequestBuilder searchReque return ElasticQueryBuilder.weightFunction(filter, tb.getBoost()); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScore - buildEntitySpecificFieldValueBoostV2(String assetType, FieldValueBoost fvb) { + private FunctionScore buildEntitySpecificFieldValueBoostV2( + String assetType, FieldValueBoost fvb) { ElasticQueryBuilder.BoolQueryBuilder conditionBuilder = ElasticQueryBuilder.boolQuery() .must(ElasticQueryBuilder.termQuery("entityType", assetType)); if (fvb.getCondition() != null && fvb.getCondition().getRange() != null) { - es.co.elastic.clients.elasticsearch._types.query_dsl.Query rangeQuery = - buildRangeQueryV2(fvb); + Query rangeQuery = buildRangeQueryV2(fvb); conditionBuilder.must(rangeQuery); } - es.co.elastic.clients.elasticsearch._types.query_dsl.Query condition = conditionBuilder.build(); + Query condition = conditionBuilder.build(); - es.co.elastic.clients.elasticsearch._types.query_dsl.FieldValueFactorModifier modifier = - toFieldValueFactorModifierV2(fvb.getModifier()); + FieldValueFactorModifier modifier = toFieldValueFactorModifierV2(fvb.getModifier()); return ElasticQueryBuilder.fieldValueFactorFunction( condition, fvb.getField(), fvb.getFactor(), fvb.getMissing(), modifier); } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildRangeQueryV2( - FieldValueBoost fvb) { + private Query buildRangeQueryV2(FieldValueBoost fvb) { var range = fvb.getCondition().getRange(); String field = fvb.getField(); @@ -1170,9 +1227,7 @@ private es.co.elastic.clients.elasticsearch._types.query_dsl.Query buildRangeQue } private void addAssetTypeBoostsV2( - List functions, - String assetType, - AssetTypeConfiguration assetConfig) { + List functions, String assetType, AssetTypeConfiguration assetConfig) { if (assetConfig.getTermBoosts() != null) { assetConfig.getTermBoosts().stream() @@ -1187,8 +1242,7 @@ private void addAssetTypeBoostsV2( } } - private void addEntitySpecificBoostsV2( - List functions) { + private void addEntitySpecificBoostsV2(List functions) { List dataAssetTypes = List.of( "table", @@ -1217,12 +1271,10 @@ private AssetTypeConfiguration findAssetTypeConfig(String assetType) { .orElse(null); } - private List - collectAllBoostFunctionsV2() { + private List collectAllBoostFunctionsV2() { // Add global boosts - List functions = - new ArrayList<>(collectGlobalBoostFunctionsV2()); + List functions = new ArrayList<>(collectGlobalBoostFunctionsV2()); // Add entity-specific boosts addEntitySpecificBoostsV2(functions); @@ -1230,18 +1282,12 @@ private AssetTypeConfiguration findAssetTypeConfig(String assetType) { return functions; } - private es.co.elastic.clients.elasticsearch._types.query_dsl.Query applyBoostFunctionsV2( - es.co.elastic.clients.elasticsearch._types.query_dsl.Query baseQuery, - List functions) { + private Query applyBoostFunctionsV2(Query baseQuery, List functions) { if (functions.isEmpty()) { return baseQuery; } return ElasticQueryBuilder.functionScoreQuery( - baseQuery, - functions, - es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionScoreMode.Sum, - es.co.elastic.clients.elasticsearch._types.query_dsl.FunctionBoostMode.Sum, - FUNCTION_BOOST_FACTOR); + baseQuery, functions, FunctionScoreMode.Sum, FunctionBoostMode.Sum, FUNCTION_BOOST_FACTOR); } } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java index 15991fe54eee..5a3cf02c2597 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java @@ -11,12 +11,15 @@ import jakarta.ws.rs.core.Response; import java.io.IOException; import java.security.KeyStoreException; +import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; import javax.net.ssl.SSLContext; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -29,6 +32,7 @@ import org.apache.hc.core5.util.TimeValue; import org.apache.hc.core5.util.Timeout; import org.jetbrains.annotations.NotNull; +import org.openmetadata.common.utils.CommonUtil; import org.openmetadata.schema.api.entityRelationship.SearchEntityRelationshipRequest; import org.openmetadata.schema.api.entityRelationship.SearchEntityRelationshipResult; import org.openmetadata.schema.api.entityRelationship.SearchSchemaEntityRelationshipResult; @@ -41,6 +45,7 @@ import org.openmetadata.schema.dataInsight.DataInsightChartResult; import org.openmetadata.schema.dataInsight.custom.DataInsightCustomChart; import org.openmetadata.schema.dataInsight.custom.DataInsightCustomChartResultList; +import org.openmetadata.schema.entity.data.PageHierarchy; import org.openmetadata.schema.entity.data.QueryCostSearchResult; import org.openmetadata.schema.search.AggregationRequest; import org.openmetadata.schema.search.SearchRequest; @@ -49,7 +54,10 @@ import org.openmetadata.schema.tests.DataQualityReport; import org.openmetadata.schema.type.EntityReference; import org.openmetadata.schema.type.LayerPaging; +import org.openmetadata.schema.utils.ResultList; import org.openmetadata.search.IndexMapping; +import org.openmetadata.service.Entity; +import org.openmetadata.service.jdbi3.KnowledgePageRepository; import org.openmetadata.service.search.SearchAggregation; import org.openmetadata.service.search.SearchClient; import org.openmetadata.service.search.SearchHealthStatus; @@ -61,12 +69,22 @@ import org.openmetadata.service.search.queries.QueryBuilderFactory; import org.openmetadata.service.search.security.RBACConditionEvaluator; import org.openmetadata.service.security.policyevaluator.SubjectContext; +import org.openmetadata.service.util.FullyQualifiedName; +import org.openmetadata.service.util.SearchUtils; import org.openmetadata.service.workflows.searchIndex.ReindexingUtil; +import os.org.opensearch.client.json.JsonData; import os.org.opensearch.client.json.jackson.JacksonJsonpMapper; +import os.org.opensearch.client.opensearch._types.FieldValue; +import os.org.opensearch.client.opensearch._types.SortOrder; +import os.org.opensearch.client.opensearch._types.aggregations.FiltersBucket; +import os.org.opensearch.client.opensearch._types.query_dsl.BoolQuery; +import os.org.opensearch.client.opensearch._types.query_dsl.Query; import os.org.opensearch.client.opensearch.cluster.ClusterStatsResponse; import os.org.opensearch.client.opensearch.cluster.GetClusterSettingsResponse; import os.org.opensearch.client.opensearch.core.BulkResponse; +import os.org.opensearch.client.opensearch.core.SearchResponse; import os.org.opensearch.client.opensearch.core.bulk.BulkOperation; +import os.org.opensearch.client.opensearch.core.search.Hit; import os.org.opensearch.client.opensearch.generic.Body; import os.org.opensearch.client.opensearch.generic.Requests; import os.org.opensearch.client.opensearch.nodes.NodesStatsResponse; @@ -1153,33 +1171,29 @@ public void initializeLineageBuilders() { @Override @lombok.SneakyThrows - public org.openmetadata.schema.utils.ResultList - listPageHierarchy(String parentFqn, String pageType, int offset, int limit) { + public ResultList listPageHierarchy( + String parentFqn, String pageType, int offset, int limit) { return getPageHierarchyFromSearch(parentFqn, pageType, offset, limit); } @Override @lombok.SneakyThrows - public org.openmetadata.schema.utils.ResultList - listPageHierarchyForActivePage(String activeFqn, String pageType, int offset, int limit) { + public ResultList listPageHierarchyForActivePage( + String activeFqn, String pageType, int offset, int limit) { return getPageHierarchyFromSearchForActivePage(activeFqn, pageType, offset, limit); } - private org.openmetadata.schema.utils.ResultList< - org.openmetadata.schema.entity.data.PageHierarchy> - getPageHierarchyFromSearch(String parentFqn, String pageType, int offset, int limit) - throws java.io.IOException { - os.org.opensearch.client.opensearch._types.query_dsl.Query boolQuery = - buildPageHierarchyBoolQuery(parentFqn, pageType); + private ResultList getPageHierarchyFromSearch( + String parentFqn, String pageType, int offset, int limit) throws IOException { + Query boolQuery = buildPageHierarchyBoolQuery(parentFqn, pageType); os.org.opensearch.client.opensearch.core.SearchRequest searchRequest = os.org.opensearch.client.opensearch.core.SearchRequest.of( s -> s.index( - org.openmetadata.service.Entity.getSearchRepository() + Entity.getSearchRepository() .getIndexOrAliasName( - org.openmetadata.service.jdbi3.KnowledgePageRepository - .KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) + KnowledgePageRepository.KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) .query(boolQuery) // Stable sort so from/size pagination cannot miss/duplicate hits. // fullyQualifiedName is a keyword field with doc_values and is unique per @@ -1187,64 +1201,41 @@ public void initializeLineageBuilders() { // needed. _id cannot be used as a sort field on ES 9.x / OpenSearch 3.x // without setting indices.id_field_data.enabled=true at the cluster level. .sort( - sort -> - sort.field( - f -> - f.field("fullyQualifiedName") - .order( - os.org.opensearch.client.opensearch._types.SortOrder - .Asc))) + sort -> sort.field(f -> f.field("fullyQualifiedName").order(SortOrder.Asc))) .from(offset) .size(limit)); - os.org.opensearch.client.opensearch.core.SearchResponse - searchResponse = - newClient.search(searchRequest, os.org.opensearch.client.json.JsonData.class); - java.util.List pageHierarchies = - processPageHierarchyHits(searchResponse); + SearchResponse searchResponse = newClient.search(searchRequest, JsonData.class); + List pageHierarchies = processPageHierarchyHits(searchResponse); int total = 0; if (searchResponse != null && searchResponse.hits() != null && searchResponse.hits().total() != null) { total = (int) searchResponse.hits().total().value(); } - return new org.openmetadata.schema.utils.ResultList<>( - pageHierarchies, offset, pageHierarchies.size(), total); + return new ResultList<>(pageHierarchies, offset, pageHierarchies.size(), total); } - private org.openmetadata.schema.utils.ResultList< - org.openmetadata.schema.entity.data.PageHierarchy> - getPageHierarchyFromSearchForActivePage( - String activeFqn, String pageType, int offset, int limit) throws java.io.IOException { - os.org.opensearch.client.opensearch._types.query_dsl.Query boolQuery = - buildPageHierarchyBoolQueryForActivePage(activeFqn, pageType); + private ResultList getPageHierarchyFromSearchForActivePage( + String activeFqn, String pageType, int offset, int limit) throws IOException { + Query boolQuery = buildPageHierarchyBoolQueryForActivePage(activeFqn, pageType); os.org.opensearch.client.opensearch.core.SearchRequest searchRequest = os.org.opensearch.client.opensearch.core.SearchRequest.of( s -> s.index( - org.openmetadata.service.Entity.getSearchRepository() + Entity.getSearchRepository() .getIndexOrAliasName( - org.openmetadata.service.jdbi3.KnowledgePageRepository - .KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) + KnowledgePageRepository.KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) .query(boolQuery) // Stable sort by fqn (keyword, unique per page). See note above on _id. .sort( - sort -> - sort.field( - f -> - f.field("fullyQualifiedName") - .order( - os.org.opensearch.client.opensearch._types.SortOrder - .Asc))) + sort -> sort.field(f -> f.field("fullyQualifiedName").order(SortOrder.Asc))) .from(offset) .size(limit)); - os.org.opensearch.client.opensearch.core.SearchResponse - searchResponse = - newClient.search(searchRequest, os.org.opensearch.client.json.JsonData.class); - java.util.List pageHierarchies = - processPageHierarchyHits(searchResponse); + SearchResponse searchResponse = newClient.search(searchRequest, JsonData.class); + List pageHierarchies = processPageHierarchyHits(searchResponse); pageHierarchies = buildPageNestedSearchHierarchy(pageHierarchies); int total = 0; if (searchResponse != null @@ -1252,107 +1243,58 @@ public void initializeLineageBuilders() { && searchResponse.hits().total() != null) { total = (int) searchResponse.hits().total().value(); } - return new org.openmetadata.schema.utils.ResultList<>( - pageHierarchies, offset, pageHierarchies.size(), total); + return new ResultList<>(pageHierarchies, offset, pageHierarchies.size(), total); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query buildPageHierarchyBoolQuery( - String parentFqn, String pageType) { - os.org.opensearch.client.opensearch._types.query_dsl.BoolQuery.Builder boolQueryBuilder = - new os.org.opensearch.client.opensearch._types.query_dsl.BoolQuery.Builder(); + private Query buildPageHierarchyBoolQuery(String parentFqn, String pageType) { + BoolQuery.Builder boolQueryBuilder = new BoolQuery.Builder(); - if (org.openmetadata.common.utils.CommonUtil.nullOrEmpty(parentFqn)) { + if (CommonUtil.nullOrEmpty(parentFqn)) { boolQueryBuilder.must( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("fqnDepth") - .value( - os.org.opensearch.client.opensearch._types.FieldValue.of(1))))); + Query.of(q -> q.term(t -> t.field("fqnDepth").value(FieldValue.of(1))))); } else { - int parentDepth = org.openmetadata.service.util.FullyQualifiedName.split(parentFqn).length; + int parentDepth = FullyQualifiedName.split(parentFqn).length; boolQueryBuilder.must( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> q.prefix(p -> p.field("fullyQualifiedName").value(parentFqn + ".")))); + Query.of(q -> q.prefix(p -> p.field("fullyQualifiedName").value(parentFqn + ".")))); boolQueryBuilder.must( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("fqnDepth") - .value( - os.org.opensearch.client.opensearch._types.FieldValue.of( - parentDepth + 1))))); + Query.of(q -> q.term(t -> t.field("fqnDepth").value(FieldValue.of(parentDepth + 1))))); } - if (!org.openmetadata.common.utils.CommonUtil.nullOrEmpty(pageType)) { + if (!CommonUtil.nullOrEmpty(pageType)) { boolQueryBuilder.must( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("pageType") - .value( - os.org.opensearch.client.opensearch._types.FieldValue.of( - pageType))))); + Query.of(q -> q.term(t -> t.field("pageType").value(FieldValue.of(pageType))))); } - return os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> q.bool(boolQueryBuilder.build())); + return Query.of(q -> q.bool(boolQueryBuilder.build())); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query - buildPageHierarchyBoolQueryForActivePage(String activeFqn, String pageType) { - os.org.opensearch.client.opensearch._types.query_dsl.BoolQuery.Builder boolQueryBuilder = - new os.org.opensearch.client.opensearch._types.query_dsl.BoolQuery.Builder(); + private Query buildPageHierarchyBoolQueryForActivePage(String activeFqn, String pageType) { + BoolQuery.Builder boolQueryBuilder = new BoolQuery.Builder(); - String rootParentFqn = org.openmetadata.service.util.FullyQualifiedName.split(activeFqn)[0]; + String rootParentFqn = FullyQualifiedName.split(activeFqn)[0]; boolQueryBuilder.should( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("fqnDepth") - .value(os.org.opensearch.client.opensearch._types.FieldValue.of(1))))); + Query.of(q -> q.term(t -> t.field("fqnDepth").value(FieldValue.of(1))))); boolQueryBuilder.should( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> q.prefix(p -> p.field("fullyQualifiedName").value(rootParentFqn + ".")))); + Query.of(q -> q.prefix(p -> p.field("fullyQualifiedName").value(rootParentFqn + ".")))); boolQueryBuilder.minimumShouldMatch("1"); - if (!org.openmetadata.common.utils.CommonUtil.nullOrEmpty(pageType)) { + if (!CommonUtil.nullOrEmpty(pageType)) { boolQueryBuilder.must( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> - q.term( - t -> - t.field("pageType") - .value( - os.org.opensearch.client.opensearch._types.FieldValue.of( - pageType))))); + Query.of(q -> q.term(t -> t.field("pageType").value(FieldValue.of(pageType))))); } - return os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> q.bool(boolQueryBuilder.build())); + return Query.of(q -> q.bool(boolQueryBuilder.build())); } - private java.util.List - processPageHierarchyHits( - os.org.opensearch.client.opensearch.core.SearchResponse< - os.org.opensearch.client.json.JsonData> - searchResponse) - throws java.io.IOException { - java.util.List pageHierarchies = - new java.util.ArrayList<>(); + private List processPageHierarchyHits(SearchResponse searchResponse) + throws IOException { + List pageHierarchies = new ArrayList<>(); if (searchResponse != null && searchResponse.hits() != null) { - for (os.org.opensearch.client.opensearch.core.search.Hit< - os.org.opensearch.client.json.JsonData> - hit : searchResponse.hits().hits()) { + for (Hit hit : searchResponse.hits().hits()) { if (hit.source() != null) { - java.util.Map sourceMap = OsUtils.jsonDataToMap(hit.source()); - org.openmetadata.schema.entity.data.PageHierarchy page = - org.openmetadata.service.util.SearchUtils.getPageHierarchy(sourceMap); + Map sourceMap = OsUtils.jsonDataToMap(hit.source()); + PageHierarchy page = SearchUtils.getPageHierarchy(sourceMap); pageHierarchies.add(page); } } @@ -1367,48 +1309,40 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query buildPageHier * instead of one search per page (N+1). Uses a filters aggregation keyed by page id, * where each bucket matches descendants via the page's fullyQualifiedName prefix. */ - private void populateChildrenCounts( - java.util.List pageHierarchies) - throws java.io.IOException { + private void populateChildrenCounts(List pageHierarchies) throws IOException { if (pageHierarchies.isEmpty()) { return; } - java.util.Map filters = - new java.util.HashMap<>(); - for (org.openmetadata.schema.entity.data.PageHierarchy page : pageHierarchies) { + Map filters = new HashMap<>(); + for (PageHierarchy page : pageHierarchies) { if (page.getId() == null || page.getFullyQualifiedName() == null || page.getFullyQualifiedName().isEmpty()) { continue; } String fqnPrefix = page.getFullyQualifiedName() + "."; - int childDepth = - org.openmetadata.service.util.FullyQualifiedName.split(page.getFullyQualifiedName()) - .length - + 1; + int childDepth = FullyQualifiedName.split(page.getFullyQualifiedName()).length + 1; // Match only direct children: FQN starts with "." AND fqnDepth is // exactly one deeper than the parent. Descendants deeper than that are excluded. filters.put( page.getId().toString(), - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( + Query.of( q -> q.bool( b -> b.must( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( + Query.of( m -> m.prefix( p -> p.field("fullyQualifiedName").value(fqnPrefix)))) .must( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( + Query.of( m -> m.term( t -> t.field("fqnDepth") - .value( - os.org.opensearch.client.opensearch._types - .FieldValue.of(childDepth)))))))); + .value(FieldValue.of(childDepth)))))))); page.setChildrenCount(0); } @@ -1420,18 +1354,16 @@ private void populateChildrenCounts( os.org.opensearch.client.opensearch.core.SearchRequest.of( s -> s.index( - org.openmetadata.service.Entity.getSearchRepository() + Entity.getSearchRepository() .getIndexOrAliasName( - org.openmetadata.service.jdbi3.KnowledgePageRepository - .KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) + KnowledgePageRepository.KNOWLEDGE_PAGE_TERM_SEARCH_INDEX)) .size(0) .aggregations( "children_by_parent", a -> a.filters(f -> f.filters(fs -> fs.keyed(filters))))); - os.org.opensearch.client.opensearch.core.SearchResponse - aggregationResponse = - newClient.search(aggregationRequest, os.org.opensearch.client.json.JsonData.class); + SearchResponse aggregationResponse = + newClient.search(aggregationRequest, JsonData.class); if (aggregationResponse == null || aggregationResponse.aggregations() == null @@ -1439,54 +1371,43 @@ private void populateChildrenCounts( return; } - java.util.Map - buckets = - aggregationResponse - .aggregations() - .get("children_by_parent") - .filters() - .buckets() - .keyed(); + Map buckets = + aggregationResponse.aggregations().get("children_by_parent").filters().buckets().keyed(); - for (org.openmetadata.schema.entity.data.PageHierarchy page : pageHierarchies) { + for (PageHierarchy page : pageHierarchies) { if (page.getId() == null) { continue; } - os.org.opensearch.client.opensearch._types.aggregations.FiltersBucket bucket = - buckets.get(page.getId().toString()); + FiltersBucket bucket = buckets.get(page.getId().toString()); if (bucket != null) { page.setChildrenCount((int) bucket.docCount()); } } } - private java.util.List - buildPageNestedSearchHierarchy( - java.util.List pageHierarchyList) { - java.util.Map - pageHierarchyMap = - pageHierarchyList.stream() - // Skip hits that lost their id during parsing (SearchUtils returns a - // null id for malformed/missing UUID strings) so Collectors.toMap - // does not throw on the null key. - .filter(p -> p.getId() != null) - .collect( - java.util.stream.Collectors.toMap( - org.openmetadata.schema.entity.data.PageHierarchy::getId, - page -> { - page.setChildren(new java.util.ArrayList<>()); - return page; - }, - (existing, replacement) -> existing, - java.util.LinkedHashMap::new)); - - java.util.List rootPages = - new java.util.ArrayList<>(); - - for (org.openmetadata.schema.entity.data.PageHierarchy page : pageHierarchyMap.values()) { - java.util.UUID parentId = page.getParent() != null ? page.getParent().getId() : null; - org.openmetadata.schema.entity.data.PageHierarchy parentPage = - parentId != null ? pageHierarchyMap.get(parentId) : null; + private List buildPageNestedSearchHierarchy( + List pageHierarchyList) { + Map pageHierarchyMap = + pageHierarchyList.stream() + // Skip hits that lost their id during parsing (SearchUtils returns a + // null id for malformed/missing UUID strings) so Collectors.toMap + // does not throw on the null key. + .filter(p -> p.getId() != null) + .collect( + Collectors.toMap( + PageHierarchy::getId, + page -> { + page.setChildren(new ArrayList<>()); + return page; + }, + (existing, replacement) -> existing, + LinkedHashMap::new)); + + List rootPages = new ArrayList<>(); + + for (PageHierarchy page : pageHierarchyMap.values()) { + UUID parentId = page.getParent() != null ? page.getParent().getId() : null; + PageHierarchy parentPage = parentId != null ? pageHierarchyMap.get(parentId) : null; if (parentPage != null) { parentPage.getChildren().add(page); } else { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchQueryBuilder.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchQueryBuilder.java index bbe429084cd8..4e7e649c7070 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchQueryBuilder.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchQueryBuilder.java @@ -3,7 +3,12 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import os.org.opensearch.client.json.JsonData; import os.org.opensearch.client.opensearch._types.FieldValue; +import os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier; +import os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode; +import os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore; +import os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode; import os.org.opensearch.client.opensearch._types.query_dsl.Operator; import os.org.opensearch.client.opensearch._types.query_dsl.Query; import os.org.opensearch.client.opensearch._types.query_dsl.QueryStringQuery; @@ -21,6 +26,22 @@ public static Query termQuery(String field, String value) { return Query.of(q -> q.term(t -> t.field(field).value(FieldValue.of(value)))); } + public static Query termQuery(String field, String value, Float boost, String queryName) { + return Query.of( + q -> + q.term( + t -> { + t.field(field).value(FieldValue.of(value)); + if (boost != null) { + t.boost(boost); + } + if (queryName != null) { + t.queryName(queryName); + } + return t; + })); + } + public static Query termQuery(String field, boolean value) { return Query.of(q -> q.term(t -> t.field(field).value(FieldValue.of(value)))); } @@ -37,6 +58,22 @@ public static Query matchPhraseQuery(String field, String value) { return Query.of(q -> q.matchPhrase(m -> m.field(field).query(value))); } + public static Query matchPhraseQuery(String field, String value, Float boost, String queryName) { + return Query.of( + q -> + q.matchPhrase( + m -> { + m.field(field).query(value); + if (boost != null) { + m.boost(boost); + } + if (queryName != null) { + m.queryName(queryName); + } + return m; + })); + } + public static Query wildcardQuery(String field, String value) { return Query.of(q -> q.wildcard(w -> w.field(field).value(value))); } @@ -107,6 +144,85 @@ public static Query multiMatchQuery( })); } + public static Query multiMatchQuery( + String query, + Map fields, + TextQueryType type, + Operator operator, + String tieBreaker, + String fuzziness, + String minimumShouldMatch, + Float boost, + String queryName) { + return multiMatchQuery( + query, + fields, + type, + operator, + tieBreaker, + fuzziness, + minimumShouldMatch, + boost, + queryName, + null); + } + + public static Query multiMatchQuery( + String query, + Map fields, + TextQueryType type, + Operator operator, + String tieBreaker, + String fuzziness, + String minimumShouldMatch, + Float boost, + String queryName, + String analyzer) { + List fieldList = new ArrayList<>(); + fields.forEach( + (field, fieldBoost) -> { + if (fieldBoost != null && fieldBoost != 1.0f) { + fieldList.add(field + "^" + fieldBoost); + } else { + fieldList.add(field); + } + }); + return Query.of( + q -> + q.multiMatch( + m -> { + m.query(query); + m.fields(fieldList); + if (type != null) { + m.type(type); + } + if (operator != null) { + m.operator(operator); + } + if (tieBreaker != null) { + m.tieBreaker(Float.parseFloat(tieBreaker)); + } + if (fuzziness != null && !fuzziness.equals("0")) { + m.fuzziness(fuzziness); + m.prefixLength(1); + m.maxExpansions(10); + } + if (minimumShouldMatch != null) { + m.minimumShouldMatch(minimumShouldMatch); + } + if (boost != null) { + m.boost(boost); + } + if (queryName != null) { + m.queryName(queryName); + } + if (analyzer != null) { + m.analyzer(analyzer); + } + return m; + })); + } + public static Query queryStringQuery(String query) { return Query.of(q -> q.queryString(QueryStringQuery.of(qs -> qs.query(query)))); } @@ -179,6 +295,17 @@ public static BoolQueryBuilder boolQuery() { return new BoolQueryBuilder(); } + public static Query disMaxQuery(List queries, double tieBreaker) { + return Query.of( + q -> + q.disMax( + d -> { + d.queries(queries); + d.tieBreaker((float) tieBreaker); + return d; + })); + } + public static class BoolQueryBuilder { private final List must = new ArrayList<>(); private final List should = new ArrayList<>(); @@ -251,16 +378,16 @@ public static Query rangeQuery(String field, String gte, String lte, String gt, r -> { r.field(field); if (gte != null) { - r.gte(os.org.opensearch.client.json.JsonData.of(gte)); + r.gte(JsonData.of(gte)); } if (lte != null) { - r.lte(os.org.opensearch.client.json.JsonData.of(lte)); + r.lte(JsonData.of(lte)); } if (gt != null) { - r.gt(os.org.opensearch.client.json.JsonData.of(gt)); + r.gt(JsonData.of(gt)); } if (lt != null) { - r.lt(os.org.opensearch.client.json.JsonData.of(lt)); + r.lt(JsonData.of(lt)); } return r; })); @@ -276,9 +403,9 @@ public static Query nestedQuery(String path, Query query) { public static Query functionScoreQuery( Query query, - java.util.List functions, - os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode scoreMode, - os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode boostMode, + List functions, + FunctionScoreMode scoreMode, + FunctionBoostMode boostMode, Float boost) { return Query.of( q -> @@ -301,20 +428,48 @@ public static Query functionScoreQuery( })); } - public static os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore weightFunction( - Query filter, double weight) { - return os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore.of( - f -> f.filter(filter).weight((float) weight)); + public static Query functionScoreQuery( + Query query, + List functions, + FunctionScoreMode scoreMode, + FunctionBoostMode boostMode, + Float boost, + Double maxBoost) { + return Query.of( + q -> + q.functionScore( + fs -> { + fs.query(query); + if (!functions.isEmpty()) { + fs.functions(functions); + } + if (scoreMode != null) { + fs.scoreMode(scoreMode); + } + if (boostMode != null) { + fs.boostMode(boostMode); + } + if (boost != null) { + fs.boost(boost); + } + if (maxBoost != null) { + fs.maxBoost(maxBoost.floatValue()); + } + return fs; + })); + } + + public static FunctionScore weightFunction(Query filter, double weight) { + return FunctionScore.of(f -> f.filter(filter).weight((float) weight)); } - public static os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore - fieldValueFactorFunction( - Query filter, - String field, - Double factor, - Double missing, - os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier modifier) { - return os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore.of( + public static FunctionScore fieldValueFactorFunction( + Query filter, + String field, + Double factor, + Double missing, + FieldValueFactorModifier modifier) { + return FunctionScore.of( f -> { f.filter(filter); f.fieldValueFactor( diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchSourceBuilderFactory.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchSourceBuilderFactory.java index 527365ba9a1a..f5992c30a242 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchSourceBuilderFactory.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchSourceBuilderFactory.java @@ -23,10 +23,13 @@ import org.openmetadata.schema.api.search.AssetTypeConfiguration; import org.openmetadata.schema.api.search.FieldBoost; import org.openmetadata.schema.api.search.FieldValueBoost; +import org.openmetadata.schema.api.search.RankingConfiguration; +import org.openmetadata.schema.api.search.RankingStage; import org.openmetadata.schema.api.search.SearchSettings; import org.openmetadata.schema.api.search.TermBoost; import org.openmetadata.service.Entity; import org.openmetadata.service.search.CustomPropertySearchFields; +import org.openmetadata.service.search.SearchRankingHelper; import org.openmetadata.service.search.SearchSourceBuilderFactory; import org.openmetadata.service.search.indexes.ColumnSearchIndex; import org.openmetadata.service.search.indexes.ContextMemoryIndex; @@ -36,8 +39,13 @@ import org.openmetadata.service.search.indexes.TestCaseResultIndex; import org.openmetadata.service.search.indexes.UserIndex; import os.org.opensearch.client.opensearch._types.FieldValue; +import os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier; +import os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode; import os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore; +import os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode; +import os.org.opensearch.client.opensearch._types.query_dsl.Operator; import os.org.opensearch.client.opensearch._types.query_dsl.Query; +import os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType; import os.org.opensearch.client.opensearch.core.search.Highlight; @Slf4j @@ -62,6 +70,7 @@ public class OpenSearchSourceBuilderFactory private static final float DEFAULT_TIE_BREAKER = 0.3f; private static final float DEFAULT_BOOST = 1.0f; private static final float FUNCTION_BOOST_FACTOR = 0.3f; + private static final String RANKING_QUERY_PREFIX = "ranking:"; private final SearchSettings searchSettings; @@ -235,8 +244,7 @@ private Map extractAllFields(AssetTypeConfiguration assetConfig) return allFields; } - public os.org.opensearch.client.opensearch._types.query_dsl.Query buildSearchQueryBuilderV2( - String query, Map fields) { + public Query buildSearchQueryBuilderV2(String query, Map fields) { Map fuzzyFields = fields.entrySet().stream() .filter(entry -> isFuzzyField(entry.getKey())) @@ -247,23 +255,23 @@ public os.org.opensearch.client.opensearch._types.query_dsl.Query buildSearchQue .filter(entry -> isNonFuzzyField(entry.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - os.org.opensearch.client.opensearch._types.query_dsl.Query fuzzyQuery = + Query fuzzyQuery = OpenSearchQueryBuilder.queryStringQuery( query, fuzzyFields, - os.org.opensearch.client.opensearch._types.query_dsl.Operator.And, + Operator.And, "1", 10, 3, DEFAULT_TIE_BREAKER, - os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType.MostFields); + TextQueryType.MostFields); - os.org.opensearch.client.opensearch._types.query_dsl.Query nonFuzzyQuery = + Query nonFuzzyQuery = OpenSearchQueryBuilder.multiMatchQuery( query, nonFuzzyFields, - os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType.MostFields, - os.org.opensearch.client.opensearch._types.query_dsl.Operator.And, + TextQueryType.MostFields, + Operator.And, String.valueOf(DEFAULT_TIE_BREAKER), "0"); @@ -275,10 +283,7 @@ public os.org.opensearch.client.opensearch._types.query_dsl.Query buildSearchQue } public OpenSearchRequestBuilder searchBuilderV2( - os.org.opensearch.client.opensearch._types.query_dsl.Query query, - os.org.opensearch.client.opensearch.core.search.Highlight highlightBuilder, - int fromOffset, - int size) { + Query query, Highlight highlightBuilder, int fromOffset, int size) { OpenSearchRequestBuilder builder = new OpenSearchRequestBuilder(); builder.query(query); if (highlightBuilder != null) { @@ -290,8 +295,7 @@ public OpenSearchRequestBuilder searchBuilderV2( } public OpenSearchRequestBuilder buildUserOrTeamSearchBuilderV2(String query, int from, int size) { - os.org.opensearch.client.opensearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, UserIndex.getFields()); + Query queryBuilder = buildSearchQueryBuilderV2(query, UserIndex.getFields()); return searchBuilderV2(queryBuilder, null, from, size); } @@ -347,72 +351,60 @@ public OpenSearchRequestBuilder getSearchSourceBuilderV2( } public OpenSearchRequestBuilder buildTestCaseSearchV2(String query, int from, int size) { - os.org.opensearch.client.opensearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, TestCaseIndex.getFields()); - os.org.opensearch.client.opensearch.core.search.Highlight highlighter = - buildHighlightsV2(List.of("testSuite.name", "testSuite.description")); + Query queryBuilder = buildSearchQueryBuilderV2(query, TestCaseIndex.getFields()); + Highlight highlighter = buildHighlightsV2(List.of("testSuite.name", "testSuite.description")); return searchBuilderV2(queryBuilder, highlighter, from, size); } public OpenSearchRequestBuilder buildCostAnalysisReportDataSearchV2( String query, int from, int size) { - os.org.opensearch.client.opensearch._types.query_dsl.Query queryBuilder = - OpenSearchQueryBuilder.queryStringQuery(query); + Query queryBuilder = OpenSearchQueryBuilder.queryStringQuery(query); return searchBuilderV2(queryBuilder, null, from, size); } public OpenSearchRequestBuilder buildTestCaseResolutionStatusSearchV2( String query, int from, int size) { - os.org.opensearch.client.opensearch._types.query_dsl.Query queryBuilder = + Query queryBuilder = buildSearchQueryBuilderV2(query, TestCaseResolutionStatusIndex.getFields()); - os.org.opensearch.client.opensearch.core.search.Highlight highlighter = - buildHighlightsV2(new ArrayList<>()); + Highlight highlighter = buildHighlightsV2(new ArrayList<>()); return searchBuilderV2(queryBuilder, highlighter, from, size); } public OpenSearchRequestBuilder buildTestCaseResultSearchV2(String query, int from, int size) { - os.org.opensearch.client.opensearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, TestCaseResultIndex.getFields()); - os.org.opensearch.client.opensearch.core.search.Highlight highlighter = - buildHighlightsV2(new ArrayList<>()); + Query queryBuilder = buildSearchQueryBuilderV2(query, TestCaseResultIndex.getFields()); + Highlight highlighter = buildHighlightsV2(new ArrayList<>()); return searchBuilderV2(queryBuilder, highlighter, from, size); } public OpenSearchRequestBuilder buildColumnSearchBuilderV2(String query, int from, int size) { - os.org.opensearch.client.opensearch._types.query_dsl.Query queryBuilder; + Query queryBuilder; if (nullOrEmpty(query) || "*".equals(query.trim())) { - queryBuilder = - os.org.opensearch.client.opensearch._types.query_dsl.Query.of(q -> q.matchAll(m -> m)); + queryBuilder = Query.of(q -> q.matchAll(m -> m)); } else { Map fields = ColumnSearchIndex.getFields(); queryBuilder = OpenSearchQueryBuilder.multiMatchQuery( query, fields, - os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType.BestFields, - os.org.opensearch.client.opensearch._types.query_dsl.Operator.Or, + TextQueryType.BestFields, + Operator.Or, String.valueOf(DEFAULT_TIE_BREAKER), "0"); } - os.org.opensearch.client.opensearch.core.search.Highlight highlighter = - buildHighlightsV2(List.of("name", "displayName", "description")); + Highlight highlighter = buildHighlightsV2(List.of("name", "displayName", "description")); return searchBuilderV2(queryBuilder, highlighter, from, size); } public OpenSearchRequestBuilder buildServiceSearchBuilderV2(String query, int from, int size) { - os.org.opensearch.client.opensearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, SearchIndex.getDefaultFields()); - os.org.opensearch.client.opensearch.core.search.Highlight highlighter = - buildHighlightsV2(new ArrayList<>()); + Query queryBuilder = buildSearchQueryBuilderV2(query, SearchIndex.getDefaultFields()); + Highlight highlighter = buildHighlightsV2(new ArrayList<>()); return searchBuilderV2(queryBuilder, highlighter, from, size); } public OpenSearchRequestBuilder buildContextMemorySearchBuilderV2( String query, int from, int size) { - os.org.opensearch.client.opensearch._types.query_dsl.Query queryBuilder = - buildSearchQueryBuilderV2(query, ContextMemoryIndex.getFields()); - os.org.opensearch.client.opensearch.core.search.Highlight highlighter = - buildHighlightsV2(List.of("title", "summary", "question", "answer")); + Query queryBuilder = buildSearchQueryBuilderV2(query, ContextMemoryIndex.getFields()); + Highlight highlighter = buildHighlightsV2(List.of("title", "summary", "question", "answer")); return searchBuilderV2(queryBuilder, highlighter, from, size); } @@ -424,10 +416,8 @@ public OpenSearchRequestBuilder buildAggregateSearchBuilderV2(String query, int public OpenSearchRequestBuilder buildAggregateSearchBuilderV2( String query, int from, int size, boolean includeAggregations) { AssetTypeConfiguration compositeConfig = getOrBuildCompositeConfig(); - os.org.opensearch.client.opensearch._types.query_dsl.Query baseQuery = - buildQueryWithMatchTypesV2(query, compositeConfig); - os.org.opensearch.client.opensearch._types.query_dsl.Query finalQuery = - applyFunctionScoringV2(baseQuery, compositeConfig); + Query baseQuery = buildQueryWithMatchTypesV2(query, compositeConfig); + Query finalQuery = applyFunctionScoringV2(baseQuery, compositeConfig); OpenSearchRequestBuilder searchRequestBuilder = searchBuilderV2(finalQuery, null, from, size); if (includeAggregations) { @@ -450,12 +440,9 @@ public OpenSearchRequestBuilder buildDataAssetSearchBuilderV2( boolean explain, boolean includeAggregations) { AssetTypeConfiguration assetConfig = getAssetConfiguration(indexName); - os.org.opensearch.client.opensearch._types.query_dsl.Query baseQuery = - buildBaseQueryV2(query, assetConfig); - os.org.opensearch.client.opensearch._types.query_dsl.Query finalQuery = - applyFunctionScoringV2(baseQuery, assetConfig); - os.org.opensearch.client.opensearch.core.search.Highlight highlightBuilder = - buildHighlightingIfNeededV2(query, assetConfig); + Query baseQuery = buildBaseQueryV2(query, assetConfig); + Query finalQuery = applyFunctionScoringV2(baseQuery, assetConfig); + Highlight highlightBuilder = buildHighlightingIfNeededV2(query, assetConfig); OpenSearchRequestBuilder searchRequestBuilder = createSearchSourceBuilderV2(finalQuery, from, size); @@ -471,8 +458,7 @@ public OpenSearchRequestBuilder buildDataAssetSearchBuilderV2( return searchRequestBuilder; } - private os.org.opensearch.client.opensearch._types.query_dsl.Query buildBaseQueryV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildBaseQueryV2(String query, AssetTypeConfiguration assetConfig) { if (query == null || query.trim().isEmpty() || query.trim().equals("*")) { return OpenSearchQueryBuilder.boolQuery() .must(OpenSearchQueryBuilder.matchAllQuery()) @@ -484,8 +470,7 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query buildBaseQuer } } - private os.org.opensearch.client.opensearch._types.query_dsl.Query buildQueryWithMatchTypesV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildQueryWithMatchTypesV2(String query, AssetTypeConfiguration assetConfig) { if (query == null || query.trim().isEmpty() || query.trim().equals("*")) { return OpenSearchQueryBuilder.boolQuery() .must(OpenSearchQueryBuilder.matchAllQuery()) @@ -499,26 +484,22 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query buildQueryWit return buildSimpleQueryWithTypesV2(query, assetConfig); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query buildComplexQueryV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildComplexQueryV2(String query, AssetTypeConfiguration assetConfig) { Map allFields = extractAllFields(assetConfig); - os.org.opensearch.client.opensearch._types.query_dsl.Query queryStringBuilder = + Query queryStringBuilder = OpenSearchQueryBuilder.queryStringQuery( - query, - allFields, - os.org.opensearch.client.opensearch._types.query_dsl.Operator.And, - null, - 50, - 0, - 0.5, - os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType.MostFields); + query, allFields, Operator.And, null, 50, 0, 0.5, TextQueryType.MostFields); return OpenSearchQueryBuilder.boolQuery().must(queryStringBuilder).build(); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query buildSimpleQueryWithTypesV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildSimpleQueryWithTypesV2(String query, AssetTypeConfiguration assetConfig) { + RankingConfiguration ranking = SearchRankingHelper.resolveRanking(searchSettings, assetConfig); + if (ranking != null) { + return buildRankedSimpleQueryV2(query, assetConfig, ranking); + } + OpenSearchQueryBuilder.BoolQueryBuilder combinedQuery = OpenSearchQueryBuilder.boolQuery(); MatchTypeMultipliers multipliers = getMatchTypeMultipliers(assetConfig); Map> fieldsByType = groupFieldsByMatchType(assetConfig); @@ -545,38 +526,34 @@ private void addMatchTypeQueriesV2( addStandardMatchQueriesV2(combinedQuery, query, fieldsByType.get(MATCH_TYPE_STANDARD)); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query applyFunctionScoringV2( - os.org.opensearch.client.opensearch._types.query_dsl.Query baseQuery, - AssetTypeConfiguration assetConfig) { - List functions = - collectBoostFunctionsV2(assetConfig); + private Query applyFunctionScoringV2(Query baseQuery, AssetTypeConfiguration assetConfig) { + List functions = collectBoostFunctionsV2(assetConfig); if (functions.isEmpty()) { return baseQuery; } - os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode scoreMode; - if (assetConfig.getScoreMode() != null) { - scoreMode = toScoreModeV2(assetConfig.getScoreMode().value()); - } else { - scoreMode = os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode.Sum; - } - - os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode boostMode; - if (assetConfig.getBoostMode() != null) { - boostMode = toBoostModeV2(assetConfig.getBoostMode().value()); - } else { - boostMode = os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode.Sum; - } + RankingConfiguration ranking = SearchRankingHelper.resolveRanking(searchSettings, assetConfig); + String scoreModeValue = + assetConfig.getScoreMode() != null ? assetConfig.getScoreMode().value() : "sum"; + String boostModeValue = + assetConfig.getBoostMode() != null ? assetConfig.getBoostMode().value() : "sum"; + FunctionScoreMode scoreMode = + toScoreModeV2(SearchRankingHelper.signalScoreMode(ranking, scoreModeValue)); + FunctionBoostMode boostMode = + toBoostModeV2(SearchRankingHelper.signalBoostMode(ranking, boostModeValue)); return OpenSearchQueryBuilder.functionScoreQuery( - baseQuery, functions, scoreMode, boostMode, FUNCTION_BOOST_FACTOR); + baseQuery, + functions, + scoreMode, + boostMode, + FUNCTION_BOOST_FACTOR, + SearchRankingHelper.signalMaxBoost(ranking)); } - private List - collectBoostFunctionsV2(AssetTypeConfiguration assetConfig) { - List functions = - new ArrayList<>(); + private List collectBoostFunctionsV2(AssetTypeConfiguration assetConfig) { + List functions = new ArrayList<>(); // Add baseline weight of 1.0 so that assets with no tier/usage retain their text score // when boostMode is multiply. Without this, function_score could be 0 and zero out the @@ -608,20 +585,15 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query applyFunction return functions; } - private os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore - buildTermBoostFunctionV2(TermBoost tb) { - os.org.opensearch.client.opensearch._types.query_dsl.Query filter = - OpenSearchQueryBuilder.termQuery(tb.getField(), tb.getValue()); + private FunctionScore buildTermBoostFunctionV2(TermBoost tb) { + Query filter = OpenSearchQueryBuilder.termQuery(tb.getField(), tb.getValue()); return OpenSearchQueryBuilder.weightFunction(filter, tb.getBoost()); } - private os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore - buildFieldValueBoostFunctionV2(FieldValueBoost fvb) { - os.org.opensearch.client.opensearch._types.query_dsl.Query condition = - buildConditionQueryV2(fvb); + private FunctionScore buildFieldValueBoostFunctionV2(FieldValueBoost fvb) { + Query condition = buildConditionQueryV2(fvb); - os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier modifier = - toFieldValueFactorModifierV2(fvb.getModifier()); + FieldValueFactorModifier modifier = toFieldValueFactorModifierV2(fvb.getModifier()); return OpenSearchQueryBuilder.fieldValueFactorFunction( condition, @@ -631,8 +603,7 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query applyFunction modifier); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query buildConditionQueryV2( - FieldValueBoost fvb) { + private Query buildConditionQueryV2(FieldValueBoost fvb) { if (fvb.getCondition() == null || fvb.getCondition().getRange() == null) { return OpenSearchQueryBuilder.matchAllQuery(); } @@ -648,60 +619,47 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query buildConditio return OpenSearchQueryBuilder.rangeQuery(field, gte, lte, gt, lt); } - private os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier - toFieldValueFactorModifierV2(FieldValueBoost.Modifier modifier) { + private FieldValueFactorModifier toFieldValueFactorModifierV2(FieldValueBoost.Modifier modifier) { if (modifier == null) { return null; } return switch (modifier.value()) { - case "log" -> os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier - .Log; - case "log1p" -> os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier - .Log1p; - case "sqrt" -> os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier - .Sqrt; - case "square" -> os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier - .Square; - case "ln" -> os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier.Ln; - case "ln1p" -> os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier - .Ln1p; - case "ln2p" -> os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier - .Ln2p; - case "reciprocal" -> os.org.opensearch.client.opensearch._types.query_dsl - .FieldValueFactorModifier.Reciprocal; + case "log" -> FieldValueFactorModifier.Log; + case "log1p" -> FieldValueFactorModifier.Log1p; + case "sqrt" -> FieldValueFactorModifier.Sqrt; + case "square" -> FieldValueFactorModifier.Square; + case "ln" -> FieldValueFactorModifier.Ln; + case "ln1p" -> FieldValueFactorModifier.Ln1p; + case "ln2p" -> FieldValueFactorModifier.Ln2p; + case "reciprocal" -> FieldValueFactorModifier.Reciprocal; default -> null; }; } - private os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode toScoreModeV2( - String mode) { + private FunctionScoreMode toScoreModeV2(String mode) { return switch (mode.toLowerCase()) { - case "avg" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode.Avg; - case "max" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode.Max; - case "min" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode.Min; - case "multiply" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode - .Multiply; - case "first" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode.First; - default -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode.Sum; + case "avg" -> FunctionScoreMode.Avg; + case "max" -> FunctionScoreMode.Max; + case "min" -> FunctionScoreMode.Min; + case "multiply" -> FunctionScoreMode.Multiply; + case "first" -> FunctionScoreMode.First; + default -> FunctionScoreMode.Sum; }; } - private os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode toBoostModeV2( - String mode) { + private FunctionBoostMode toBoostModeV2(String mode) { return switch (mode.toLowerCase()) { - case "sum" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode.Sum; - case "avg" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode.Avg; - case "max" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode.Max; - case "min" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode.Min; - case "replace" -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode - .Replace; - default -> os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode.Multiply; + case "sum" -> FunctionBoostMode.Sum; + case "avg" -> FunctionBoostMode.Avg; + case "max" -> FunctionBoostMode.Max; + case "min" -> FunctionBoostMode.Min; + case "replace" -> FunctionBoostMode.Replace; + default -> FunctionBoostMode.Multiply; }; } - private os.org.opensearch.client.opensearch.core.search.Highlight buildHighlightingIfNeededV2( - String query, AssetTypeConfiguration assetConfig) { + private Highlight buildHighlightingIfNeededV2(String query, AssetTypeConfiguration assetConfig) { if (query == null || query.trim().isEmpty()) { return null; } @@ -715,8 +673,7 @@ private os.org.opensearch.client.opensearch.core.search.Highlight buildHighlight return null; } - private OpenSearchRequestBuilder createSearchSourceBuilderV2( - os.org.opensearch.client.opensearch._types.query_dsl.Query query, int from, int size) { + private OpenSearchRequestBuilder createSearchSourceBuilderV2(Query query, int from, int size) { int maxHits = searchSettings.getGlobalSettings().getMaxResultHits(); OpenSearchRequestBuilder builder = new OpenSearchRequestBuilder(); builder.query(query); @@ -779,8 +736,7 @@ private OpenSearchRequestBuilder addAggregationV2(OpenSearchRequestBuilder searc return searchRequestBuilder; } - public os.org.opensearch.client.opensearch.core.search.Highlight buildHighlightsV2( - List fields) { + public Highlight buildHighlightsV2(List fields) { OpenSearchHighlightBuilder hb = new OpenSearchHighlightBuilder(); hb.preTags(PRE_TAG); hb.postTags(POST_TAG); @@ -843,10 +799,8 @@ public OpenSearchRequestBuilder buildCommonSearchBuilderV2(String query, int fro query, defaultConfig.getAssetType()); - os.org.opensearch.client.opensearch._types.query_dsl.Query baseQuery = - buildQueryWithMatchTypesV2(query, defaultConfig); - os.org.opensearch.client.opensearch._types.query_dsl.Query finalQuery = - applyGlobalBoostsV2(baseQuery); + Query baseQuery = buildQueryWithMatchTypesV2(query, defaultConfig); + Query finalQuery = applyGlobalBoostsV2(baseQuery); OpenSearchRequestBuilder searchRequestBuilder = createCommonSearchSourceBuilderV2(finalQuery, from, size); @@ -859,39 +813,28 @@ public OpenSearchRequestBuilder buildCommonSearchBuilderV2(String query, int fro public OpenSearchRequestBuilder buildEntitySpecificAggregateSearchBuilderV2( String query, int from, int size) { AssetTypeConfiguration compositeConfig = buildCompositeAssetConfig(searchSettings); - os.org.opensearch.client.opensearch._types.query_dsl.Query baseQuery = - buildQueryWithMatchTypesV2(query, compositeConfig); + Query baseQuery = buildQueryWithMatchTypesV2(query, compositeConfig); - List functions = - collectAllBoostFunctionsV2(); - os.org.opensearch.client.opensearch._types.query_dsl.Query finalQuery = - applyBoostFunctionsV2(baseQuery, functions); + List functions = collectAllBoostFunctionsV2(); + Query finalQuery = applyBoostFunctionsV2(baseQuery, functions); OpenSearchRequestBuilder searchRequestBuilder = searchBuilderV2(finalQuery, null, from, size); return addAggregationV2(searchRequestBuilder); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query applyGlobalBoostsV2( - os.org.opensearch.client.opensearch._types.query_dsl.Query baseQuery) { - List functions = - collectGlobalBoostFunctionsV2(); + private Query applyGlobalBoostsV2(Query baseQuery) { + List functions = collectGlobalBoostFunctionsV2(); if (functions.isEmpty()) { return baseQuery; } return OpenSearchQueryBuilder.functionScoreQuery( - baseQuery, - functions, - os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode.Sum, - os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode.Sum, - FUNCTION_BOOST_FACTOR); + baseQuery, functions, FunctionScoreMode.Sum, FunctionBoostMode.Sum, FUNCTION_BOOST_FACTOR); } - private List - collectGlobalBoostFunctionsV2() { - List functions = - new ArrayList<>(); + private List collectGlobalBoostFunctionsV2() { + List functions = new ArrayList<>(); if (searchSettings.getGlobalSettings().getTermBoosts() != null) { searchSettings.getGlobalSettings().getTermBoosts().stream() @@ -909,7 +852,7 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query applyGlobalBo } private OpenSearchRequestBuilder createCommonSearchSourceBuilderV2( - os.org.opensearch.client.opensearch._types.query_dsl.Query query, int from, int size) { + Query query, int from, int size) { return createSearchSourceBuilderV2(query, from, size); } @@ -920,12 +863,10 @@ private void addHighlightsIfConfiguredV2(OpenSearchRequestBuilder searchRequestB } } - private List - collectAllBoostFunctionsV2() { + private List collectAllBoostFunctionsV2() { // Add global boosts - List functions = - new ArrayList<>(collectGlobalBoostFunctionsV2()); + List functions = new ArrayList<>(collectGlobalBoostFunctionsV2()); // Add entity-specific boosts addEntitySpecificBoostsV2(functions); @@ -933,8 +874,7 @@ private void addHighlightsIfConfiguredV2(OpenSearchRequestBuilder searchRequestB return functions; } - private void addEntitySpecificBoostsV2( - List functions) { + private void addEntitySpecificBoostsV2(List functions) { List dataAssetTypes = List.of( "table", @@ -964,9 +904,7 @@ private AssetTypeConfiguration findAssetTypeConfig(String assetType) { } private void addAssetTypeBoostsV2( - List functions, - String assetType, - AssetTypeConfiguration assetConfig) { + List functions, String assetType, AssetTypeConfiguration assetConfig) { if (assetConfig.getTermBoosts() != null) { assetConfig.getTermBoosts().stream() @@ -981,9 +919,8 @@ private void addAssetTypeBoostsV2( } } - private os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore - buildEntitySpecificTermBoostV2(String assetType, TermBoost tb) { - os.org.opensearch.client.opensearch._types.query_dsl.Query filter = + private FunctionScore buildEntitySpecificTermBoostV2(String assetType, TermBoost tb) { + Query filter = OpenSearchQueryBuilder.boolQuery() .must(OpenSearchQueryBuilder.termQuery("entityType", assetType)) .must(OpenSearchQueryBuilder.termQuery(tb.getField(), tb.getValue())) @@ -992,29 +929,26 @@ private void addAssetTypeBoostsV2( return OpenSearchQueryBuilder.weightFunction(filter, tb.getBoost()); } - private os.org.opensearch.client.opensearch._types.query_dsl.FunctionScore - buildEntitySpecificFieldValueBoostV2(String assetType, FieldValueBoost fvb) { + private FunctionScore buildEntitySpecificFieldValueBoostV2( + String assetType, FieldValueBoost fvb) { OpenSearchQueryBuilder.BoolQueryBuilder conditionBuilder = OpenSearchQueryBuilder.boolQuery() .must(OpenSearchQueryBuilder.termQuery("entityType", assetType)); if (fvb.getCondition() != null && fvb.getCondition().getRange() != null) { - os.org.opensearch.client.opensearch._types.query_dsl.Query rangeQuery = - buildRangeQueryV2(fvb); + Query rangeQuery = buildRangeQueryV2(fvb); conditionBuilder.must(rangeQuery); } - os.org.opensearch.client.opensearch._types.query_dsl.Query condition = conditionBuilder.build(); + Query condition = conditionBuilder.build(); - os.org.opensearch.client.opensearch._types.query_dsl.FieldValueFactorModifier modifier = - toFieldValueFactorModifierV2(fvb.getModifier()); + FieldValueFactorModifier modifier = toFieldValueFactorModifierV2(fvb.getModifier()); return OpenSearchQueryBuilder.fieldValueFactorFunction( condition, fvb.getField(), fvb.getFactor(), fvb.getMissing(), modifier); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query buildRangeQueryV2( - FieldValueBoost fvb) { + private Query buildRangeQueryV2(FieldValueBoost fvb) { var range = fvb.getCondition().getRange(); String field = fvb.getField(); @@ -1026,45 +960,38 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query buildRangeQue return OpenSearchQueryBuilder.rangeQuery(field, gte, lte, gt, lt); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query applyBoostFunctionsV2( - os.org.opensearch.client.opensearch._types.query_dsl.Query baseQuery, - List functions) { + private Query applyBoostFunctionsV2(Query baseQuery, List functions) { if (functions.isEmpty()) { return baseQuery; } return OpenSearchQueryBuilder.functionScoreQuery( - baseQuery, - functions, - os.org.opensearch.client.opensearch._types.query_dsl.FunctionScoreMode.Sum, - os.org.opensearch.client.opensearch._types.query_dsl.FunctionBoostMode.Sum, - FUNCTION_BOOST_FACTOR); + baseQuery, functions, FunctionScoreMode.Sum, FunctionBoostMode.Sum, FUNCTION_BOOST_FACTOR); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query buildComplexSyntaxQueryV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildComplexSyntaxQueryV2(String query, AssetTypeConfiguration assetConfig) { Map fuzzyFields = new HashMap<>(); Map nonFuzzyFields = new HashMap<>(); classifyFields(assetConfig, fuzzyFields, nonFuzzyFields); - os.org.opensearch.client.opensearch._types.query_dsl.Query fuzzyQuery = + Query fuzzyQuery = OpenSearchQueryBuilder.queryStringQuery( query, fuzzyFields, - os.org.opensearch.client.opensearch._types.query_dsl.Operator.And, + Operator.And, "1", 10, 3, DEFAULT_TIE_BREAKER, - os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType.MostFields); + TextQueryType.MostFields); - os.org.opensearch.client.opensearch._types.query_dsl.Query nonFuzzyQuery = + Query nonFuzzyQuery = OpenSearchQueryBuilder.multiMatchQuery( query, nonFuzzyFields, - os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType.MostFields, - os.org.opensearch.client.opensearch._types.query_dsl.Operator.And, + TextQueryType.MostFields, + Operator.And, String.valueOf(DEFAULT_TIE_BREAKER), "0"); @@ -1076,8 +1003,12 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query buildComplexS .build(); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query buildSimpleQueryV2( - String query, AssetTypeConfiguration assetConfig) { + private Query buildSimpleQueryV2(String query, AssetTypeConfiguration assetConfig) { + RankingConfiguration ranking = SearchRankingHelper.resolveRanking(searchSettings, assetConfig); + if (ranking != null) { + return buildRankedSimpleQueryV2(query, assetConfig, ranking); + } + OpenSearchQueryBuilder.BoolQueryBuilder combinedQuery = OpenSearchQueryBuilder.boolQuery(); MatchTypeMultipliers multipliers = getMatchTypeMultipliers(assetConfig); Map> fieldsByMatchType = groupFieldsByMatchType(assetConfig); @@ -1095,6 +1026,132 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query buildSimpleQu return OpenSearchQueryBuilder.boolQuery().must(combinedQuery.build()).build(); } + private Query buildRankedSimpleQueryV2( + String query, AssetTypeConfiguration assetConfig, RankingConfiguration ranking) { + List stageQueries = new ArrayList<>(); + String significantQuery = SearchRankingHelper.significantQueryText(query, ranking); + String exactSignificantQuery = + SearchRankingHelper.significantQueryTextPreservingCase(query, ranking); + + for (RankingStage stage : listOrEmpty(ranking.getStages())) { + Query stageQuery = + buildRankingStageQueryV2(query, significantQuery, exactSignificantQuery, stage); + if (stageQuery != null) { + stageQueries.add(stageQuery); + } + } + + if (stageQueries.isEmpty()) { + return buildLegacySimpleQueryV2(query, assetConfig); + } + + OpenSearchQueryBuilder.BoolQueryBuilder combinedQuery = OpenSearchQueryBuilder.boolQuery(); + combinedQuery.should( + stageQueries.size() == 1 + ? stageQueries.getFirst() + : OpenSearchQueryBuilder.disMaxQuery( + stageQueries, SearchRankingHelper.disMaxTieBreaker(ranking))); + addCustomPropertyMatchQueriesV2(combinedQuery, query, assetConfig); + combinedQuery.minimumShouldMatch(1); + return OpenSearchQueryBuilder.boolQuery().must(combinedQuery.build()).build(); + } + + private Query buildLegacySimpleQueryV2(String query, AssetTypeConfiguration assetConfig) { + OpenSearchQueryBuilder.BoolQueryBuilder combinedQuery = OpenSearchQueryBuilder.boolQuery(); + MatchTypeMultipliers multipliers = getMatchTypeMultipliers(assetConfig); + Map> fieldsByMatchType = groupFieldsByMatchType(assetConfig); + + addExactMatchQueriesV2( + combinedQuery, query, fieldsByMatchType.get(MATCH_TYPE_EXACT), multipliers.exactMatch); + addPhraseMatchQueriesV2( + combinedQuery, query, fieldsByMatchType.get(MATCH_TYPE_PHRASE), multipliers.phraseMatch); + addFuzzyMatchQueriesV2( + combinedQuery, query, fieldsByMatchType.get(MATCH_TYPE_FUZZY), multipliers.fuzzyMatch); + addStandardMatchQueriesV2(combinedQuery, query, fieldsByMatchType.get(MATCH_TYPE_STANDARD)); + addCustomPropertyMatchQueriesV2(combinedQuery, query, assetConfig); + + combinedQuery.minimumShouldMatch(1); + return OpenSearchQueryBuilder.boolQuery().must(combinedQuery.build()).build(); + } + + private Query buildRankingStageQueryV2( + String originalQuery, + String significantQuery, + String exactSignificantQuery, + RankingStage stage) { + if (stage.getFields() == null || stage.getFields().isEmpty()) { + return null; + } + + RankingStage.MatchType matchType = + stage.getMatchType() == null ? RankingStage.MatchType.STANDARD : stage.getMatchType(); + return switch (matchType) { + case EXACT -> buildExactRankingStageQueryV2(exactSignificantQuery, stage); + case PHRASE -> buildPhraseRankingStageQueryV2(originalQuery, stage); + case FUZZY -> buildTextRankingStageQueryV2( + significantQuery, stage, getFuzziness(significantQuery)); + case TOKEN_COVERAGE, STANDARD -> buildTextRankingStageQueryV2(significantQuery, stage, "0"); + }; + } + + private Query buildExactRankingStageQueryV2(String query, RankingStage stage) { + List exactTexts = SearchRankingHelper.exactMatchTexts(query); + if (exactTexts.isEmpty()) { + return null; + } + + OpenSearchQueryBuilder.BoolQueryBuilder exactQuery = OpenSearchQueryBuilder.boolQuery(); + float weight = SearchRankingHelper.stageWeight(stage); + for (String field : stage.getFields()) { + for (int index = 0; index < exactTexts.size(); index++) { + exactQuery.should( + OpenSearchQueryBuilder.termQuery( + field, + exactTexts.get(index), + weight, + rankingQueryName(stage, field, String.valueOf(index)))); + } + } + exactQuery.minimumShouldMatch(1); + return exactQuery.build(); + } + + private Query buildPhraseRankingStageQueryV2(String query, RankingStage stage) { + OpenSearchQueryBuilder.BoolQueryBuilder phraseQuery = OpenSearchQueryBuilder.boolQuery(); + float weight = SearchRankingHelper.stageWeight(stage); + for (String field : stage.getFields()) { + phraseQuery.should( + OpenSearchQueryBuilder.matchPhraseQuery( + field, query, weight, rankingQueryName(stage, field))); + } + phraseQuery.minimumShouldMatch(1); + return phraseQuery.build(); + } + + private Query buildTextRankingStageQueryV2(String query, RankingStage stage, String fuzziness) { + Map fields = new LinkedHashMap<>(); + stage.getFields().forEach(field -> fields.put(field, DEFAULT_BOOST)); + return OpenSearchQueryBuilder.multiMatchQuery( + query, + fields, + TextQueryType.BestFields, + Operator.Or, + String.valueOf(DEFAULT_TIE_BREAKER), + fuzziness, + SearchRankingHelper.minimumShouldMatch(stage), + SearchRankingHelper.stageWeight(stage), + rankingQueryName(stage, "text"), + SearchRankingHelper.stageSearchAnalyzer(stage)); + } + + private String rankingQueryName(RankingStage stage, String field) { + return RANKING_QUERY_PREFIX + stage.getName() + ":" + field; + } + + private String rankingQueryName(RankingStage stage, String field, String suffix) { + return rankingQueryName(stage, field) + ":" + suffix; + } + /** * Adds a nested {@code customPropertiesTyped} clause for each admin-configured {@code * extension.} search field. The raw {@code extension} field is {@code enabled:false} so an @@ -1110,9 +1167,8 @@ private void addCustomPropertyMatchQueriesV2( } } - private os.org.opensearch.client.opensearch._types.query_dsl.Query customPropertyNestedQueryV2( - String query, CustomPropertySearchFields.Spec spec) { - os.org.opensearch.client.opensearch._types.query_dsl.Query inner = + private Query customPropertyNestedQueryV2(String query, CustomPropertySearchFields.Spec spec) { + Query inner = OpenSearchQueryBuilder.boolQuery() .must(customPropertyTermV2(CustomPropertySearchFields.NAME_FIELD, spec.propertyName())) .must(customPropertyValueQueryV2(query, spec)) @@ -1121,12 +1177,11 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query customPropert CustomPropertySearchFields.CUSTOM_PROPERTIES_TYPED, inner); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query customPropertyValueQueryV2( - String query, CustomPropertySearchFields.Spec spec) { - os.org.opensearch.client.opensearch._types.query_dsl.Query result; + private Query customPropertyValueQueryV2(String query, CustomPropertySearchFields.Spec spec) { + Query result; if (spec.exact()) { result = - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( + Query.of( q -> q.term( t -> @@ -1135,7 +1190,7 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query customPropert .boost(spec.boost()))); } else { result = - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( + Query.of( q -> q.match( m -> @@ -1146,10 +1201,8 @@ private os.org.opensearch.client.opensearch._types.query_dsl.Query customPropert return result; } - private static os.org.opensearch.client.opensearch._types.query_dsl.Query customPropertyTermV2( - String field, String value) { - return os.org.opensearch.client.opensearch._types.query_dsl.Query.of( - q -> q.term(t -> t.field(field).value(FieldValue.of(value)))); + private static Query customPropertyTermV2(String field, String value) { + return Query.of(q -> q.term(t -> t.field(field).value(FieldValue.of(value)))); } private void addExactMatchQueriesV2( @@ -1162,7 +1215,7 @@ private void addExactMatchQueriesV2( fields.forEach( (field, boost) -> exactMatchQuery.should( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( + Query.of( q -> q.term( t -> @@ -1185,7 +1238,7 @@ private void addPhraseMatchQueriesV2( fields.forEach( (field, boost) -> phraseMatchQuery.should( - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( + Query.of( q -> q.matchPhrase( m -> m.field(field).query(query).boost(boost * multiplier))))); @@ -1214,18 +1267,15 @@ private void addFuzzyMatchQueriesV2( String fuzziness = getFuzziness(query); int maxExpansions = getMaxExpansions(query); - os.org.opensearch.client.opensearch._types.query_dsl.Query fuzzyQuery = - os.org.opensearch.client.opensearch._types.query_dsl.Query.of( + Query fuzzyQuery = + Query.of( q -> q.multiMatch( m -> m.query(query) .fields(fieldList) - .type( - os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType - .MostFields) - .operator( - os.org.opensearch.client.opensearch._types.query_dsl.Operator.Or) + .type(TextQueryType.MostFields) + .operator(Operator.Or) .fuzziness(fuzziness) .maxExpansions(maxExpansions) .prefixLength(1) @@ -1252,37 +1302,33 @@ private void addStandardMatchQueriesV2( .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); if (!fuzzyFields.isEmpty()) { - os.org.opensearch.client.opensearch._types.query_dsl.Query fuzzyQueryBuilder = - createStandardFuzzyQueryV2(query, fuzzyFields); + Query fuzzyQueryBuilder = createStandardFuzzyQueryV2(query, fuzzyFields); combinedQuery.should(fuzzyQueryBuilder); } if (!nonFuzzyFields.isEmpty()) { - os.org.opensearch.client.opensearch._types.query_dsl.Query nonFuzzyQueryBuilder = - createStandardNonFuzzyQueryV2(query, nonFuzzyFields); + Query nonFuzzyQueryBuilder = createStandardNonFuzzyQueryV2(query, nonFuzzyFields); combinedQuery.should(nonFuzzyQueryBuilder); } } } - private os.org.opensearch.client.opensearch._types.query_dsl.Query createStandardFuzzyQueryV2( - String query, Map fields) { + private Query createStandardFuzzyQueryV2(String query, Map fields) { return OpenSearchQueryBuilder.multiMatchQuery( query, fields, - os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType.MostFields, - os.org.opensearch.client.opensearch._types.query_dsl.Operator.Or, + TextQueryType.MostFields, + Operator.Or, String.valueOf(DEFAULT_TIE_BREAKER), getFuzziness(query)); } - private os.org.opensearch.client.opensearch._types.query_dsl.Query createStandardNonFuzzyQueryV2( - String query, Map fields) { + private Query createStandardNonFuzzyQueryV2(String query, Map fields) { return OpenSearchQueryBuilder.multiMatchQuery( query, fields, - os.org.opensearch.client.opensearch._types.query_dsl.TextQueryType.MostFields, - os.org.opensearch.client.opensearch._types.query_dsl.Operator.And, + TextQueryType.MostFields, + Operator.And, String.valueOf(DEFAULT_TIE_BREAKER), "0"); } diff --git a/openmetadata-service/src/main/resources/json/data/settings/searchSettings.json b/openmetadata-service/src/main/resources/json/data/settings/searchSettings.json index 268cd95d2e91..107ac37d26d9 100644 --- a/openmetadata-service/src/main/resources/json/data/settings/searchSettings.json +++ b/openmetadata-service/src/main/resources/json/data/settings/searchSettings.json @@ -2373,6 +2373,132 @@ ], "highlightFields": [], "aggregations": [], + "ranking": { + "enabled": true, + "algorithm": "nameFirstLexicalThenSignals", + "stages": [ + { + "name": "exactName", + "purpose": "Exact identity match on name, displayName, or fullyQualifiedName.", + "fields": [ + "displayName.keyword", + "name.keyword", + "fullyQualifiedName" + ], + "matchType": "exact", + "weight": 100.0 + }, + { + "name": "phraseName", + "purpose": "Exact phrase identity match on analyzed name fields.", + "fields": [ + "displayName", + "name", + "displayName.compound", + "name.compound", + "fullyQualifiedName" + ], + "matchType": "phrase", + "weight": 70.0 + }, + { + "name": "closeName", + "purpose": "Close identity match after removing weak query words such as 'in' or 'of'.", + "fields": [ + "displayName", + "name", + "displayName.compound", + "name.compound", + "fullyQualifiedName" + ], + "matchType": "tokenCoverage", + "weight": 40.0, + "minimumShouldMatch": "2<70%" + }, + { + "name": "fuzzyName", + "purpose": "Typo-tolerant identity fallback for short name searches.", + "fields": [ + "displayName", + "name", + "displayName.compound", + "name.compound", + "fullyQualifiedName" + ], + "matchType": "fuzzy", + "weight": 24.0, + "minimumShouldMatch": "2<70%" + }, + { + "name": "partialName", + "purpose": "Substring and prefix matches via name and displayName edge n-grams so partial-name queries still surface the entity.", + "fields": [ + "displayName.ngram", + "name.ngram" + ], + "matchType": "standard", + "weight": 16.0 + }, + { + "name": "structuralContext", + "purpose": "Secondary asset structure such as columns, fields, parent names, and FQN parts.", + "fields": [ + "fqnParts" + ], + "matchType": "standard", + "weight": 12.0 + }, + { + "name": "descriptionContext", + "purpose": "Broad descriptive text match used after identity and structural matches.", + "fields": [ + "description" + ], + "matchType": "standard", + "weight": 4.0 + } + ], + "stopWords": [], + "stopWordsByLanguage": { + "en": [ + "a", + "an", + "and", + "are", + "as", + "at", + "by", + "for", + "from", + "in", + "into", + "is", + "of", + "on", + "or", + "the", + "to", + "with" + ], + "ru": [], + "zh": [], + "jp": [], + "ja": [] + }, + "disMaxTieBreaker": 0.05, + "signals": { + "purpose": "Use Tier, Usage, and Votes only to break ties between similarly relevant results.", + "boostMode": "sum", + "scoreMode": "sum", + "maxBoost": 2.0, + "fields": [ + "tier.tagFQN", + "usageSummary.weeklyStats.count", + "usageSummary.weeklyStats.percentileRank", + "totalVotes" + ] + } + }, "matchTypeBoostMultipliers": { "exactMatchMultiplier": 2.0, "phraseMatchMultiplier": 1.5, diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/system/SearchSettingsHandlerTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/system/SearchSettingsHandlerTest.java index f4c78dee5642..6ce241f1eeeb 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/system/SearchSettingsHandlerTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/system/SearchSettingsHandlerTest.java @@ -19,6 +19,9 @@ import org.openmetadata.schema.api.search.Field; import org.openmetadata.schema.api.search.FieldBoost; import org.openmetadata.schema.api.search.GlobalSettings; +import org.openmetadata.schema.api.search.RankingConfiguration; +import org.openmetadata.schema.api.search.RankingSignals; +import org.openmetadata.schema.api.search.RankingStage; import org.openmetadata.schema.api.search.SearchSettings; import org.openmetadata.schema.utils.JsonUtils; import org.openmetadata.service.exception.SystemSettingsException; @@ -237,6 +240,28 @@ void testMergeAlwaysOverwritesAllowedFieldsFromDefaults() { "Allowed fields should come from defaults, not from existing/incoming settings"); } + @Test + void testRankingSignalsMaxBoostMustBePositive() { + AssetTypeConfiguration config = createAssetConfig("table", "name", 10.0); + config.setRanking( + new RankingConfiguration() + .withEnabled(true) + .withStages( + List.of( + new RankingStage() + .withName("exactName") + .withFields(List.of("name")) + .withWeight(1.0))) + .withSignals(new RankingSignals().withMaxBoost(0.0))); + + SystemSettingsException exception = + assertThrows( + SystemSettingsException.class, + () -> searchSettingsHandler.validateAssetTypeConfiguration(config)); + + assertTrue(exception.getMessage().contains("maxBoost must be positive")); + } + @Test void testMergeWithMultipleNewAndExistingAssetTypes() { SearchSettings defaults = createBaseSettings(5000); diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/search/SearchRankingHelperTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/search/SearchRankingHelperTest.java new file mode 100644 index 000000000000..846dc93a7d16 --- /dev/null +++ b/openmetadata-service/src/test/java/org/openmetadata/service/search/SearchRankingHelperTest.java @@ -0,0 +1,212 @@ +package org.openmetadata.service.search; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import java.util.List; +import org.junit.jupiter.api.Test; +import org.openmetadata.schema.api.search.AssetTypeConfiguration; +import org.openmetadata.schema.api.search.FieldBoost; +import org.openmetadata.schema.api.search.RankingConfiguration; +import org.openmetadata.schema.api.search.RankingStage; +import org.openmetadata.schema.api.search.SearchSettings; +import org.openmetadata.schema.api.search.StopWordsByLanguage; + +class SearchRankingHelperTest { + + @Test + void exactMatchTextsBuildsSeparatorVariantsAfterStopwordRemoval() { + RankingConfiguration ranking = + new RankingConfiguration() + .withStopWordsByLanguage( + new StopWordsByLanguage().withAdditionalProperty("en", List.of("in"))); + + String significantQuery = + SearchRankingHelper.significantQueryText("Provider Address in Texas", ranking); + + assertEquals("provider address texas", significantQuery); + assertEquals( + List.of( + "provider address texas", + "provider_address_texas", + "provider-address-texas", + "provider.address.texas", + "provideraddresstexas"), + SearchRankingHelper.exactMatchTexts(significantQuery)); + } + + @Test + void significantQueryTextPreservesUnderscoreAndDottedIdentifiers() { + RankingConfiguration ranking = + new RankingConfiguration() + .withStopWordsByLanguage( + new StopWordsByLanguage().withAdditionalProperty("en", List.of("in"))); + + // Identifier queries must stay intact so they still match the keyword fqnParts parts and the + // om_analyzer compound tokens. Splitting "sample_data" into "sample data" made the ranked + // query miss every asset whose FQN carries the service/database identifier. + assertEquals("sample_data", SearchRankingHelper.significantQueryText("sample_data", ranking)); + assertEquals( + "sample_data.ecommerce", + SearchRankingHelper.significantQueryText("sample_data.ecommerce", ranking)); + + // Stop-word removal still applies, but only on whitespace boundaries. + assertEquals( + "provider_address texas", + SearchRankingHelper.significantQueryText("provider_address in texas", ranking)); + } + + @Test + void exactMatchTextsPreserveCaseAndIncludeLowercaseVariants() { + RankingConfiguration ranking = + new RankingConfiguration() + .withStopWordsByLanguage( + new StopWordsByLanguage().withAdditionalProperty("en", List.of("in"))); + + String significantQuery = + SearchRankingHelper.significantQueryTextPreservingCase("Table 2 in Warehouse", ranking); + + assertEquals("Table 2 Warehouse", significantQuery); + assertEquals( + List.of( + "Table 2 Warehouse", + "Table_2_Warehouse", + "Table-2-Warehouse", + "Table.2.Warehouse", + "Table2Warehouse", + "table 2 warehouse", + "table_2_warehouse", + "table-2-warehouse", + "table.2.warehouse", + "table2warehouse"), + SearchRankingHelper.exactMatchTexts(significantQuery)); + } + + @Test + void significantQueryTextPreservingCaseDeduplicatesMixedCaseTokens() { + String significantQuery = + SearchRankingHelper.significantQueryTextPreservingCase( + "Warehouse warehouse", new RankingConfiguration()); + + assertEquals("Warehouse", significantQuery); + assertEquals( + List.of("Warehouse", "warehouse"), SearchRankingHelper.exactMatchTexts(significantQuery)); + } + + @Test + void resolveRankingHandlesDefaultRankingWithoutStages() { + SearchSettings settings = + new SearchSettings() + .withDefaultConfiguration( + new AssetTypeConfiguration() + .withRanking(new RankingConfiguration().withEnabled(true))); + + RankingConfiguration resolved = + SearchRankingHelper.resolveRanking( + settings, + new AssetTypeConfiguration() + .withSearchFields(List.of(new FieldBoost().withField("name")))); + + assertNotNull(resolved); + assertEquals(List.of(), resolved.getStages()); + } + + @Test + void resolveRankingDerivesFuzzyNameStageFromPrimaryNameFields() { + SearchSettings settings = + new SearchSettings() + .withDefaultConfiguration( + new AssetTypeConfiguration() + .withRanking( + new RankingConfiguration() + .withEnabled(true) + .withStages( + List.of( + new RankingStage() + .withName("closeName") + .withFields(List.of("name")) + .withMatchType(RankingStage.MatchType.TOKEN_COVERAGE), + new RankingStage() + .withName("fuzzyName") + .withFields(List.of("name")) + .withMatchType(RankingStage.MatchType.FUZZY))))); + + RankingConfiguration resolved = + SearchRankingHelper.resolveRanking( + settings, + new AssetTypeConfiguration() + .withSearchFields( + List.of( + new FieldBoost().withField("description"), + new FieldBoost().withField("displayName"), + new FieldBoost().withField("name")))); + + RankingStage fuzzyName = + resolved.getStages().stream() + .filter(stage -> "fuzzyName".equals(stage.getName())) + .findFirst() + .orElseThrow(); + + assertEquals(RankingStage.MatchType.FUZZY, fuzzyName.getMatchType()); + assertEquals(List.of("displayName", "name"), fuzzyName.getFields()); + } + + @Test + void resolveRankingDerivesPartialNameStageFromNgramFields() { + SearchSettings settings = + new SearchSettings() + .withDefaultConfiguration( + new AssetTypeConfiguration() + .withRanking( + new RankingConfiguration() + .withEnabled(true) + .withStages( + List.of( + new RankingStage() + .withName("partialName") + .withFields(List.of("name.ngram")) + .withMatchType(RankingStage.MatchType.STANDARD))))); + + RankingConfiguration resolved = + SearchRankingHelper.resolveRanking( + settings, + new AssetTypeConfiguration() + .withSearchFields( + List.of( + new FieldBoost().withField("name"), + new FieldBoost().withField("name.ngram"), + new FieldBoost().withField("displayName.ngram"), + new FieldBoost().withField("description")))); + + RankingStage partialName = + resolved.getStages().stream() + .filter(stage -> "partialName".equals(stage.getName())) + .findFirst() + .orElseThrow(); + + // The partial-name stage must keep the n-gram fields that every other stage drops; without + // them substring queries like "ord" silently stop matching "orders_fact". + assertEquals(List.of("name.ngram", "displayName.ngram"), partialName.getFields()); + } + + @Test + void stageSearchAnalyzerUsesPlainAnalyzerOnlyForNgramStages() { + // n-gram-only stage: query with a plain analyzer so a long token cannot re-n-gram into + // hundreds of clauses and trip OpenSearch's maxClauseCount. + assertEquals( + "standard", + SearchRankingHelper.stageSearchAnalyzer( + new RankingStage().withFields(List.of("name.ngram", "displayName.ngram")))); + + // Non-n-gram stages keep the field's own analyzer. + assertNull( + SearchRankingHelper.stageSearchAnalyzer( + new RankingStage().withFields(List.of("name", "displayName")))); + + // A mixed stage must not force the plain analyzer onto the non-n-gram fields. + assertNull( + SearchRankingHelper.stageSearchAnalyzer( + new RankingStage().withFields(List.of("name", "name.ngram")))); + } +} diff --git a/openmetadata-spec/src/main/resources/json/schema/configuration/searchSettings.json b/openmetadata-spec/src/main/resources/json/schema/configuration/searchSettings.json index bc9cd6393270..498f19808c50 100644 --- a/openmetadata-spec/src/main/resources/json/schema/configuration/searchSettings.json +++ b/openmetadata-spec/src/main/resources/json/schema/configuration/searchSettings.json @@ -218,6 +218,10 @@ "items": { "$ref": "#/definitions/fieldValueBoost" }, "description": "List of numeric field-based boosts that apply only to this asset." }, + "ranking": { + "$ref": "#/definitions/rankingConfiguration", + "description": "High-level ranking algorithm for this asset. Defines lexical ranking stages first, then bounded metadata signals." + }, "scoreMode": { "type": "string", "enum": ["multiply", "sum", "avg", "first", "max", "min"], @@ -259,6 +263,135 @@ "required": ["assetType"], "additionalProperties": false }, + "rankingConfiguration": { + "type": "object", + "javaType": "org.openmetadata.schema.api.search.RankingConfiguration", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether to use staged ranking for this asset. When disabled, legacy searchFields scoring is used.", + "default": true + }, + "algorithm": { + "type": "string", + "description": "Human-readable ranking algorithm identifier.", + "default": "nameFirstLexicalThenSignals" + }, + "stages": { + "type": "array", + "description": "Ordered lexical ranking stages. Earlier stages should represent stronger relevance signals.", + "items": { + "$ref": "#/definitions/rankingStage" + } + }, + "stopWords": { + "type": "array", + "description": "Language-neutral query words ignored by token-coverage ranking stages. These are unioned with stopWordsByLanguage.", + "items": { + "type": "string" + }, + "default": [] + }, + "stopWordsByLanguage": { + "type": "object", + "description": "Language-keyed query words ignored by token-coverage ranking stages. Keys should match search index mapping languages such as en, ru, zh, jp, or ja. Values are whole query tokens only; language analyzers still perform the actual index/query tokenization.", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "en": ["a", "an", "and", "are", "as", "at", "by", "for", "from", "in", "into", "is", "of", "on", "or", "the", "to", "with"] + } + }, + "disMaxTieBreaker": { + "type": "number", + "description": "DisMax tie breaker used between ranking stages. Keep low so broad context matches do not overpower stronger name stages.", + "default": 0.05 + }, + "signals": { + "$ref": "#/definitions/rankingSignals", + "description": "Bounded metadata signals used after lexical relevance." + } + }, + "additionalProperties": false + }, + "rankingStage": { + "type": "object", + "javaType": "org.openmetadata.schema.api.search.RankingStage", + "properties": { + "name": { + "type": "string", + "description": "Stable stage name used in ranking debug output." + }, + "purpose": { + "type": "string", + "description": "Human-readable explanation of what this ranking stage is intended to do." + }, + "fields": { + "type": "array", + "description": "Fields queried by this stage.", + "items": { + "type": "string" + } + }, + "matchType": { + "type": "string", + "enum": ["exact", "phrase", "tokenCoverage", "standard", "fuzzy"], + "description": "Query strategy for this ranking stage.", + "default": "standard" + }, + "weight": { + "type": "number", + "description": "Stage-level score band. Higher stages should use materially higher weights than later stages.", + "default": 1.0 + }, + "minimumShouldMatch": { + "type": "string", + "description": "Minimum significant-token coverage for tokenCoverage or fuzzy stages.", + "default": "2<70%" + } + }, + "required": ["name", "fields"], + "additionalProperties": false + }, + "rankingSignals": { + "type": "object", + "javaType": "org.openmetadata.schema.api.search.RankingSignals", + "properties": { + "purpose": { + "type": "string", + "description": "Human-readable explanation of how metadata signals should affect ranking." + }, + "fields": { + "type": "array", + "description": "Metadata fields expected to contribute to signal scoring.", + "items": { + "type": "string" + } + }, + "scoreMode": { + "type": "string", + "enum": ["multiply", "sum", "avg", "first", "max", "min"], + "description": "How to combine metadata signal functions.", + "default": "sum" + }, + "boostMode": { + "type": "string", + "enum": ["multiply", "replace", "sum", "avg", "max", "min"], + "description": "How metadata signals combine with the lexical score.", + "default": "sum" + }, + "maxBoost": { + "type": "number", + "description": "Maximum signal score added to lexical relevance. Keeps Tier and Usage as tie-breakers.", + "exclusiveMinimum": 0.0, + "default": 2.0 + } + }, + "additionalProperties": false + }, "fieldBoost": { "type": "object", "properties": { @@ -563,4 +696,4 @@ } }, "additionalProperties": false -} \ No newline at end of file +} diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts index c18016be4d76..f12e9ce6ee1d 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts @@ -105,7 +105,10 @@ import { } from '../../utils/entity'; import { getEntityFqn } from '../../utils/entityPanel'; import { navigateToExploreAndSelectEntity } from '../../utils/explore'; -import { setSliderValue } from '../../utils/searchSettingUtils'; +import { + openMatchingFieldsPanel, + setSliderValue, +} from '../../utils/searchSettingUtils'; import { settingClick, SettingOptionsType, @@ -3378,6 +3381,8 @@ ALL_ENTITIES.forEach(({ key, makeInstance }) => { await waitForAllLoadersToDisappear(page); + await openMatchingFieldsPanel(page); + const customPropertyField = page.getByTestId( `field-configuration-panel-extension.${dashboardSearchPropertyName}` ); @@ -3505,6 +3510,8 @@ ALL_ENTITIES.forEach(({ key, makeInstance }) => { await waitForAllLoadersToDisappear(page); + await openMatchingFieldsPanel(page); + const customPropertyField = page.getByTestId( `field-configuration-panel-extension.${pipelineSearchPropertyName}` ); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchSettings.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchSettings.spec.ts index cfd463a5ae68..a2c73608e8ef 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchSettings.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchSettings.spec.ts @@ -25,6 +25,7 @@ import { import { waitForAllLoadersToDisappear } from '../../utils/entity'; import { mockEntitySearchSettings, + openMatchingFieldsPanel, restoreDefaultSearchSettings, setSliderValue, } from '../../utils/searchSettingUtils'; @@ -141,6 +142,8 @@ test.describe('Search Settings', () => { page.getByTestId('entity-search-settings-header') ).toBeVisible(); + await openMatchingFieldsPanel(page); + const fieldContainers = page.getByTestId('field-container-header'); const firstFieldContainer = fieldContainers.first(); await firstFieldContainer.click(); @@ -291,6 +294,8 @@ test.describe('Search Settings', () => { await waitForAllLoadersToDisappear(page); + await openMatchingFieldsPanel(page); + const descriptionField = page.getByTestId( `field-configuration-panel-description` ); @@ -393,6 +398,8 @@ test.describe('Search Settings', () => { (f: { field: string }) => f.field === 'name.ngram' )?.boost ?? 0; + await openMatchingFieldsPanel(page); + // Expand the name.ngram field configuration panel. const ngramPanel = page.getByTestId( 'field-configuration-panel-name.ngram' @@ -481,6 +488,8 @@ test.describe('Search Settings', () => { /settings\/preferences\/search-settings\/column$/ ); + await openMatchingFieldsPanel(page); + const fieldContainers = page.getByTestId('field-container-header'); const firstFieldContainer = fieldContainers.first(); await firstFieldContainer.click(); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Search/SearchRelevance.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Search/SearchRelevance.spec.ts new file mode 100644 index 000000000000..b58e1c9a4147 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Search/SearchRelevance.spec.ts @@ -0,0 +1,651 @@ +/* + * Copyright 2026 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import test, { + expect, + type APIRequestContext, + type Page, + type Response, +} from '@playwright/test'; +import { SidebarItem } from '../../constant/sidebar'; +import { getApiContext, redirectToHomePage } from '../../utils/common'; +import { sidebarClick } from '../../utils/sidebar'; + +const RELEVANCE_QUERY = 'provider address texas'; +const STOPWORD_RELEVANCE_QUERY = 'provider address in texas'; +const CUSTOMER_QUERY = 'customer'; +const CUSTOMERS_QUERY = 'customers'; +const CUSTOMER_PROFILE_QUERY = 'customer profile'; +const CUSTOMER_PROFILE_STATUS_QUERY = 'customer profile status'; +const CUSTOMER_PROFILES_QUERY = 'customer profiles'; +const CLEAR_NAME_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.provider_address'; +const EXACT_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.provider_address_texas'; +const STRUCTURAL_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.provider_directory'; +const STRUCTURAL_ONLY_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.service_job_registry'; +const TIER_USAGE_DESCRIPTION_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.regional_directory_tier1_usage'; +const WEAK_TIER_USAGE_DESCRIPTION_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.work'; +const CUSTOMER_TABLE_FQN = 'sample_data.ecommerce_db.shopify.customer'; +const CUSTOMERS_TABLE_FQN = 'sample_data.ecommerce_db.shopify.customers'; +const CUSTOMER_PROFILE_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.customer_profile'; +const CUSTOMER_PROFILES_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.customer_profiles'; +const CUSTOMER_STRUCTURAL_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.identity_resolution_registry'; +const CUSTOMER_WEAK_TIER_USAGE_TABLE_FQN = + 'sample_data.ecommerce_db.shopify.support_case_rollup_tier1_usage'; + +interface SearchFixture { + fqn: string; + index: string; +} + +interface RankedFixture { + key: string; + fqn: string; +} + +const RELEVANCE_FIXTURES: ReadonlyArray = [ + { + fqn: EXACT_TABLE_FQN, + index: 'table', + }, + { + fqn: 'sample_kafka.provider_address_texas_events', + index: 'topic', + }, + { + fqn: 'sample_superset.provider_address_texas_dashboard', + index: 'dashboard', + }, + { + fqn: 'sample_airflow.provider_address_texas_pipeline', + index: 'pipeline', + }, + { + fqn: 'mlflow_svc.provider_address_texas_model', + index: 'mlmodel', + }, + { + fqn: 's3_storage_sample.departments.provider_address_texas_exports', + index: 'container', + }, + { + fqn: 'elasticsearch_sample.provider_address_texas_index', + index: 'searchIndex', + }, + { + fqn: 'sample_api_service.pet.provider_address_texas_endpoint', + index: 'apiEndpoint', + }, +]; + +const CUSTOMER_RELEVANCE_FIXTURES: ReadonlyArray = [ + { + fqn: CUSTOMER_PROFILES_TABLE_FQN, + index: 'table', + }, + { + fqn: 'sample_kafka.customer_profiles_events', + index: 'topic', + }, + { + fqn: 'sample_superset.customer_profiles_dashboard', + index: 'dashboard', + }, + { + fqn: 'sample_airflow.customer_profiles_pipeline', + index: 'pipeline', + }, + { + fqn: 'mlflow_svc.customer_profiles_model', + index: 'mlmodel', + }, + { + fqn: 's3_storage_sample.departments.customer_profiles_exports', + index: 'container', + }, + { + fqn: 'elasticsearch_sample.customer_profiles_index', + index: 'searchIndex', + }, + { + fqn: 'sample_api_service.pet.customer_profiles_endpoint', + index: 'apiEndpoint', + }, +]; + +interface SearchHitSource { + fullyQualifiedName?: string; + name?: string; +} + +interface SearchHit { + _score?: number; + _source?: SearchHitSource; + matched_queries?: string[]; +} + +interface SearchResponse { + hits?: { + hits?: SearchHit[]; + }; +} + +interface SearchPreviewRequest { + explain?: boolean; +} + +const isSearchPreviewResponse = (response: Response, explain?: boolean) => { + if ( + !response.url().includes('/api/v1/search/preview') || + response.status() !== 200 + ) { + return false; + } + + const postData = response.request().postData(); + + if (!postData) { + return false; + } + + const payload = JSON.parse(postData) as SearchPreviewRequest; + + return explain === undefined || Boolean(payload.explain) === explain; +}; + +const getSearchHits = async ( + apiContext: APIRequestContext, + index: string, + query: string, + options?: { explain?: boolean; size?: number } +) => { + const params: Record = { + deleted: false, + from: 0, + index, + q: query, + size: options?.size ?? 20, + sort_field: '_score', + sort_order: 'desc', + }; + + if (options?.explain !== undefined) { + params.explain = options.explain; + } + + const response = await apiContext.get('/api/v1/search/query', { + params, + }); + + if (!response.ok()) { + throw new Error( + `Search API failed with ${response.status()}: ${await response.text()}` + ); + } + + const payload = (await response.json()) as SearchResponse; + + return payload.hits?.hits ?? []; +}; + +const fqnOf = (hit: SearchHit) => hit._source?.fullyQualifiedName ?? ''; + +const findRank = (fqns: string[], fqn: string) => + fqns.findIndex((value) => value === fqn); + +const compareTableFixtureRanks = async ( + apiContext: APIRequestContext, + query: string, + fixtures: ReadonlyArray, + weakFixtureFqn: string +): Promise> => { + const hits = await getSearchHits(apiContext, 'table', query, { size: 100 }); + const fqns = hits.map(fqnOf); + const weakFixtureRank = findRank(fqns, weakFixtureFqn); + const rankComparison: Record = {}; + + for (const fixture of fixtures) { + const fixtureRank = findRank(fqns, fixture.fqn); + + rankComparison[fixture.key] = + fixtureRank >= 0 && weakFixtureRank >= 0 && fixtureRank < weakFixtureRank; + } + + return rankComparison; +}; + +const searchTableFixtures = async ( + apiContext: APIRequestContext, + query = RELEVANCE_QUERY +) => { + const hits = await getSearchHits(apiContext, 'table', query, { size: 50 }); + const fqns = hits.map(fqnOf); + const clearNameRank = findRank(fqns, CLEAR_NAME_TABLE_FQN); + const exactRank = findRank(fqns, EXACT_TABLE_FQN); + const structuralRank = findRank(fqns, STRUCTURAL_TABLE_FQN); + const structuralOnlyRank = findRank(fqns, STRUCTURAL_ONLY_TABLE_FQN); + const descriptionRank = findRank(fqns, TIER_USAGE_DESCRIPTION_TABLE_FQN); + const weakDescriptionRank = findRank( + fqns, + WEAK_TIER_USAGE_DESCRIPTION_TABLE_FQN + ); + + return { + exactBeforeDescription: + exactRank >= 0 && descriptionRank >= 0 && exactRank < descriptionRank, + exactBeforeWeakDescription: + exactRank >= 0 && + weakDescriptionRank >= 0 && + exactRank < weakDescriptionRank, + exactBeforeStructural: + exactRank >= 0 && structuralRank >= 0 && exactRank < structuralRank, + clearNameBeforeWeakDescription: + clearNameRank >= 0 && + weakDescriptionRank >= 0 && + clearNameRank < weakDescriptionRank, + structuralBeforeDescription: + structuralRank >= 0 && + descriptionRank >= 0 && + structuralRank < descriptionRank, + structuralBeforeWeakDescription: + structuralRank >= 0 && + weakDescriptionRank >= 0 && + structuralRank < weakDescriptionRank, + structuralOnlyBeforeWeakDescription: + structuralOnlyRank >= 0 && + weakDescriptionRank >= 0 && + structuralOnlyRank < weakDescriptionRank, + }; +}; + +const searchFixture = async ( + apiContext: APIRequestContext, + fixture: SearchFixture, + query = RELEVANCE_QUERY +) => { + const hits = await getSearchHits(apiContext, fixture.index, query); + + return hits.some((hit) => fqnOf(hit) === fixture.fqn); +}; + +const searchForExactTableWithRankingDetails = async (page: Page) => { + await sidebarClick(page, SidebarItem.EXPLORE); + + await page.getByRole('button', { name: 'Tools' }).click(); + await page.getByRole('menuitemradio', { name: 'Ranking Details' }).click(); + + await page.getByTestId('global-search-selector').click(); + await page.getByTestId('global-search-select-option-Table').click(); + + const searchResponse = page.waitForResponse( + (response) => + response.url().includes('/api/v1/search/query') && + response.url().includes('index=table') && + response.url().includes('q=provider_address_texas') && + response.url().includes('explain=true') && + response.status() === 200 + ); + + const searchBox = page + .getByTestId('navbar-search-container') + .getByTestId('searchBox'); + + await searchBox.fill('provider_address_texas'); + await searchBox.press('Enter'); + await searchResponse; + + await page.getByTestId('search-container').getByTestId('loader').waitFor({ + state: 'detached', + }); + await page.getByTestId('search-results').waitFor({ + state: 'visible', + }); +}; + +const openTableSearchSettings = async (page: Page) => { + await page.goto('/settings/preferences/search-settings/tables'); + await expect(page.getByTestId('entity-search-settings-header')).toBeVisible(); +}; + +test.describe( + 'Search relevance sample data', + { tag: ['@search-nightly'] }, + () => { + test.use({ storageState: 'playwright/.auth/admin.json' }); + + test.beforeEach(async ({ page }) => { + await redirectToHomePage(page); + }); + + test('ranks name and structural table matches before tier and usage description matches', async ({ + page, + }) => { + const { apiContext, afterAction } = await getApiContext(page); + + try { + await expect + .poll(() => searchTableFixtures(apiContext), { + intervals: [2_000, 5_000], + timeout: 90_000, + }) + .toEqual({ + clearNameBeforeWeakDescription: true, + exactBeforeDescription: true, + exactBeforeWeakDescription: true, + exactBeforeStructural: true, + structuralBeforeDescription: true, + structuralBeforeWeakDescription: true, + structuralOnlyBeforeWeakDescription: true, + }); + } finally { + await afterAction(); + } + }); + + test('ranks clear provider address intent above weak high-signal description matches with stopwords', async ({ + page, + }) => { + const { apiContext, afterAction } = await getApiContext(page); + + try { + await expect + .poll( + () => searchTableFixtures(apiContext, STOPWORD_RELEVANCE_QUERY), + { + intervals: [2_000, 5_000], + timeout: 90_000, + } + ) + .toEqual({ + clearNameBeforeWeakDescription: true, + exactBeforeDescription: true, + exactBeforeWeakDescription: true, + exactBeforeStructural: true, + structuralBeforeDescription: true, + structuralBeforeWeakDescription: true, + structuralOnlyBeforeWeakDescription: true, + }); + } finally { + await afterAction(); + } + }); + + test('ranks customer and customers identity matches before high-signal description matches', async ({ + page, + }) => { + const { apiContext, afterAction } = await getApiContext(page); + const singularPluralFixtures: ReadonlyArray = [ + { + key: 'customerBeforeWeakDescription', + fqn: CUSTOMER_TABLE_FQN, + }, + { + key: 'customersBeforeWeakDescription', + fqn: CUSTOMERS_TABLE_FQN, + }, + ]; + + try { + await expect + .poll( + () => + compareTableFixtureRanks( + apiContext, + CUSTOMER_QUERY, + singularPluralFixtures, + CUSTOMER_WEAK_TIER_USAGE_TABLE_FQN + ), + { + intervals: [2_000, 5_000], + timeout: 90_000, + } + ) + .toEqual({ + customerBeforeWeakDescription: true, + customersBeforeWeakDescription: true, + }); + + await expect + .poll( + () => + compareTableFixtureRanks( + apiContext, + CUSTOMERS_QUERY, + singularPluralFixtures, + CUSTOMER_WEAK_TIER_USAGE_TABLE_FQN + ), + { + intervals: [2_000, 5_000], + timeout: 90_000, + } + ) + .toEqual({ + customerBeforeWeakDescription: true, + customersBeforeWeakDescription: true, + }); + } finally { + await afterAction(); + } + }); + + test('ranks customer profile name and column matches before high-signal description matches', async ({ + page, + }) => { + const { apiContext, afterAction } = await getApiContext(page); + const customerProfileFixtures: ReadonlyArray = [ + { + key: 'customerProfileBeforeWeakDescription', + fqn: CUSTOMER_PROFILE_TABLE_FQN, + }, + { + key: 'customerProfilesBeforeWeakDescription', + fqn: CUSTOMER_PROFILES_TABLE_FQN, + }, + { + key: 'structuralBeforeWeakDescription', + fqn: CUSTOMER_STRUCTURAL_TABLE_FQN, + }, + ]; + + try { + await expect + .poll( + () => + compareTableFixtureRanks( + apiContext, + CUSTOMER_PROFILE_QUERY, + customerProfileFixtures, + CUSTOMER_WEAK_TIER_USAGE_TABLE_FQN + ), + { + intervals: [2_000, 5_000], + timeout: 90_000, + } + ) + .toEqual({ + customerProfileBeforeWeakDescription: true, + customerProfilesBeforeWeakDescription: true, + structuralBeforeWeakDescription: true, + }); + + await expect + .poll( + () => + compareTableFixtureRanks( + apiContext, + CUSTOMER_PROFILE_STATUS_QUERY, + customerProfileFixtures, + CUSTOMER_WEAK_TIER_USAGE_TABLE_FQN + ), + { + intervals: [2_000, 5_000], + timeout: 90_000, + } + ) + .toEqual({ + customerProfileBeforeWeakDescription: true, + customerProfilesBeforeWeakDescription: true, + structuralBeforeWeakDescription: true, + }); + } finally { + await afterAction(); + } + }); + + test('finds provider address texas fixtures across searchable asset indexes', async ({ + page, + }) => { + const { apiContext, afterAction } = await getApiContext(page); + + try { + for (const fixture of RELEVANCE_FIXTURES) { + await test.step(`Find ${fixture.fqn}`, async () => { + await expect + .poll(() => searchFixture(apiContext, fixture), { + intervals: [2_000, 5_000], + timeout: 90_000, + }) + .toBe(true); + }); + } + } finally { + await afterAction(); + } + }); + + test('finds customer profiles fixtures across searchable asset indexes', async ({ + page, + }) => { + const { apiContext, afterAction } = await getApiContext(page); + + try { + for (const fixture of CUSTOMER_RELEVANCE_FIXTURES) { + await test.step(`Find ${fixture.fqn}`, async () => { + await expect + .poll( + () => + searchFixture(apiContext, fixture, CUSTOMER_PROFILES_QUERY), + { + intervals: [2_000, 5_000], + timeout: 90_000, + } + ) + .toBe(true); + }); + } + } finally { + await afterAction(); + } + }); + + test('shows readable ranking details for exact table matches', async ({ + page, + }) => { + await searchForExactTableWithRankingDetails(page); + + const exactTableCard = page.getByTestId( + `table-data-card_${EXACT_TABLE_FQN}` + ); + + await expect(exactTableCard).toBeVisible(); + await expect(exactTableCard.getByTestId('ranking-details')).toContainText( + /Exact name|Close name/ + ); + }); + + test('shows configurable ranking stages in table search settings', async ({ + page, + }) => { + await openTableSearchSettings(page); + + await expect(page.getByTestId('ranking-settings')).toBeVisible(); + await expect(page.getByTestId('ranking-stage-exactName')).toContainText( + 'Exact Name' + ); + await expect(page.getByTestId('ranking-stage-closeName')).toContainText( + 'Close Name' + ); + await expect(page.getByTestId('ranking-signals')).toContainText( + /Tier|usage|votes/i + ); + }); + + test('toggles ranking details in search settings preview', async ({ + page, + }) => { + await openTableSearchSettings(page); + + const previewResponse = page.waitForResponse((response) => + isSearchPreviewResponse(response, false) + ); + + await page.getByTestId('searchbar').fill(STOPWORD_RELEVANCE_QUERY); + await previewResponse; + await expect(page.getByTestId('ranking-details')).toHaveCount(0); + + const rankingDetailsResponse = page.waitForResponse((response) => + isSearchPreviewResponse(response, true) + ); + + await page.getByTestId('ranking-details-switch').click(); + await rankingDetailsResponse; + await expect(page.getByTestId('ranking-details').first()).toBeVisible(); + await expect(page.getByTestId('ranking-details').first()).toContainText( + /Exact name|Close name|Structural context|Score/i + ); + }); + + test('returns ranking stage matched queries without explain', async ({ + page, + }) => { + const { apiContext, afterAction } = await getApiContext(page); + + try { + await expect + .poll( + async () => { + const hits = await getSearchHits( + apiContext, + 'table', + 'provider_address_texas' + ); + const exactTable = hits.find( + (hit) => fqnOf(hit) === EXACT_TABLE_FQN + ); + + return ( + exactTable?.matched_queries?.some((queryName) => + queryName.startsWith('ranking:exactName:') + ) ?? false + ); + }, + { + intervals: [2_000, 5_000], + timeout: 90_000, + } + ) + .toBe(true); + } finally { + await afterAction(); + } + }); + } +); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/searchSettingUtils.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/searchSettingUtils.ts index a947051472b2..115c1699c222 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/searchSettingUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/searchSettingUtils.ts @@ -110,6 +110,28 @@ export async function setSliderValue( await page.mouse.up(); } +// The entity search settings page opens with the "Ranking Details" accordion +// panel expanded by default, so the "Matching Fields" panel (and its field +// configuration rows) is collapsed and not mounted. Expand it before +// interacting with any field-configuration control. +export const openMatchingFieldsPanel = async (page: Page) => { + const firstFieldHeader = page.getByTestId('field-container-header').first(); + + const isMatchingFieldsPanelOpen = await firstFieldHeader + .isVisible() + .catch(() => false); + + if (!isMatchingFieldsPanelOpen) { + await page + .locator('.ant-collapse-header') + .filter({ hasText: 'Matching Fields' }) + .getByText('Matching Fields') + .click(); + + await firstFieldHeader.waitFor({ state: 'visible' }); + } +}; + export const restoreDefaultSearchSettings = async (page: Page) => { const { apiContext } = await getApiContext(page); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExplorePage.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExplorePage.interface.ts index 06577d3593c6..169243f654c9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExplorePage.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExplorePage.interface.ts @@ -91,6 +91,8 @@ export interface ExploreProps { tabItems: ItemType[]; searchResults?: SearchResponse; + showRankingDetails?: boolean; + onChangeShowRankingDetails?: (showRankingDetails: boolean) => void; onChangeAdvancedSearchQuickFilters: ( queryFilter: QueryFilterInterface | undefined diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.interface.ts index 711e81af9aa8..9857c11b74b1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.interface.ts @@ -11,6 +11,7 @@ * limitations under the License. */ +import { SearchExplanation } from '../../../interface/search.interface'; import { SearchedDataProps } from '../../SearchedData/SearchedData.interface'; export interface ExploreSearchCardProps { @@ -34,6 +35,8 @@ export interface ExploreSearchCardProps { actionPopoverContent?: React.ReactNode; onCheckboxChange?: (checked: boolean) => void; score?: number; + scoreExplanation?: SearchExplanation; + matchedQueries?: string[]; highlight?: SearchedDataProps['data'][number]['highlight']; classNameForBreadcrumb?: string; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.test.tsx index cdb03fdcf440..d30ddece035a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.test.tsx @@ -228,6 +228,77 @@ describe('ExploreSearchCard - Card container', () => { expect(card).toHaveClass('explore-search-card'); expect(card).toHaveClass('highlight-card'); }); + + it('renders human-readable ranking explanations from matched query names and score explanation', () => { + renderCard( + { fullyQualifiedName: 'svc.db.schema.users' }, + { + matchedQueries: [ + 'ranking:closeName:text', + 'ranking:descriptionContext:text', + ], + score: 42.125, + scoreExplanation: { + description: 'sum of:', + value: 42.125, + details: [ + { + description: 'avgdl, average length of field', + value: 509.8754, + }, + { + description: + 'ConstantScore(displayName.keyword:provider_address_texas)^30.000002', + value: 60, + }, + { + description: + 'weight(displayName:provider_address_texas in 123) [PerFieldSimilarity], result of:', + value: 40, + }, + { + description: 'max of:', + value: 2.125, + details: [ + { + description: 'weight(description:texas in 123)', + value: 2.125, + }, + ], + }, + ], + }, + } + ); + + expect(screen.getByTestId('ranking-details')).toHaveTextContent( + 'label.ranking-detail-plural' + ); + expect(screen.getByTestId('ranking-stage-closeName')).toHaveTextContent( + 'label.close-name' + ); + expect(screen.getByTestId('ranking-stage-closeName')).toHaveTextContent( + 'message.search-ranking-close-name-explanation' + ); + expect( + screen.getByTestId('ranking-stage-descriptionContext') + ).toHaveTextContent('label.description-context'); + expect(screen.getByTestId('ranking-details')).toHaveTextContent( + 'message.search-ranking-signals-explanation' + ); + expect(screen.getByTestId('ranking-score')).toHaveTextContent( + 'label.score' + ); + expect(screen.getByTestId('ranking-score-explanation')).toHaveTextContent( + 'label.reason' + ); + expect( + screen.getAllByTestId('ranking-score-contributor')[0] + ).toHaveTextContent('displayName: provider_address_texas'); + expect( + screen.getByTestId('ranking-score-explanation') + ).not.toHaveTextContent('avgdl'); + }); }); describe('ExploreSearchCard - Entity type tags', () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx index fbfdfc1adb86..e54043055f4e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx @@ -51,6 +51,61 @@ import TagsV1 from '../../Tag/TagsV1/TagsV1.component'; import './explore-search-card.less'; import { ExploreSearchCardProps } from './ExploreSearchCard.interface'; +const RANKING_STAGE_LABEL_KEYS: Record = { + exactName: 'label.exact-name', + closeName: 'label.close-name', + structuralContext: 'label.structural-context', + descriptionContext: 'label.description-context', +}; + +const RANKING_STAGE_DESCRIPTION_KEYS: Record = { + exactName: 'message.search-ranking-exact-name-explanation', + closeName: 'message.search-ranking-close-name-explanation', + structuralContext: 'message.search-ranking-structural-context-explanation', + descriptionContext: 'message.search-ranking-description-context-explanation', +}; + +const MAX_RANKING_REASONS = 4; +const IGNORED_EXPLANATION_FIELDS = new Set(['deleted']); + +const formatScoreValue = (value: number) => value.toFixed(value >= 10 ? 2 : 4); + +const formatExplanationFieldMatch = (fieldValue: string) => { + const fieldMatch = fieldValue.match(/^([^:]+):(.+?)(?: in \d+)?$/); + + if (!fieldMatch?.[1] || !fieldMatch?.[2]) { + return; + } + + const field = fieldMatch[1].replace(/\.keyword$/, ''); + + return IGNORED_EXPLANATION_FIELDS.has(field) + ? undefined + : `${field}: ${fieldMatch[2]}`; +}; + +const getReadableExplanation = (description: string) => { + const normalizedDescription = description.replace(/\s+/g, ' ').trim(); + const weightMatch = normalizedDescription.match(/^weight\(([^)]+)\)/i); + if (weightMatch?.[1]) { + return formatExplanationFieldMatch(weightMatch[1]); + } + + const exactMatch = normalizedDescription.match(/^ConstantScore\(([^)]+)\)/i); + if (exactMatch?.[1]) { + return formatExplanationFieldMatch(exactMatch[1]); + } + + const signalMatch = normalizedDescription.match( + /^field value function: .*doc\['([^']+)'\]/i + ); + if (signalMatch?.[1]) { + return signalMatch[1]; + } + + return; +}; + const ExploreSearchCard: React.FC = forwardRef< HTMLDivElement, ExploreSearchCardProps @@ -71,6 +126,8 @@ const ExploreSearchCard: React.FC = forwardRef< checked = false, onCheckboxChange, score, + scoreExplanation, + matchedQueries, highlight, classNameForBreadcrumb, }, @@ -87,6 +144,68 @@ const ExploreSearchCard: React.FC = forwardRef< : _source; }, [_source, highlight]); + const rankingStages = useMemo(() => { + const stageNames = new Set(); + matchedQueries + ?.filter((queryName) => queryName.startsWith('ranking:')) + .forEach((queryName) => { + const stageName = queryName.split(':')[1]; + if (stageName) { + stageNames.add(stageName); + } + }); + + return [...stageNames].map((stageName) => ({ + description: t( + RANKING_STAGE_DESCRIPTION_KEYS[stageName] ?? + 'message.search-ranking-generic-stage-explanation' + ), + label: t(RANKING_STAGE_LABEL_KEYS[stageName] ?? stageName), + name: stageName, + })); + }, [matchedQueries, t]); + + const scoreReasons = useMemo(() => { + const reasons: { description: string; value: number }[] = []; + const visitExplanation = ( + explanation: typeof scoreExplanation, + depth = 0 + ) => { + if (!explanation || depth > 8) { + return; + } + + const description = getReadableExplanation(explanation.description); + + if (explanation.value > 0 && description) { + reasons.push({ + description, + value: explanation.value, + }); + } + + explanation.details?.forEach((detail) => + visitExplanation(detail, depth + 1) + ); + }; + + visitExplanation(scoreExplanation); + + const seenDescriptions = new Set(); + + return reasons + .sort((left, right) => right.value - left.value) + .filter(({ description }) => { + if (seenDescriptions.has(description)) { + return false; + } + seenDescriptions.add(description); + + return true; + }) + .slice(0, MAX_RANKING_REASONS); + }, [scoreExplanation]); + // Hover/focus on an entity card warms the React Query cache so the click that follows // hits an already-populated slot. Dispatched on entityType because each detail page reads // a slot keyed on its own {@code ['', fqn, fields]} convention; entity types that @@ -319,7 +438,7 @@ const ExploreSearchCard: React.FC = forwardRef< )} items={breadcrumbItems} /> - {score && ( + {score !== undefined && (

@@ -437,6 +556,66 @@ const ExploreSearchCard: React.FC = forwardRef< ))}
) : null} + {rankingStages.length > 0 || score !== undefined ? ( +
+
+ + {t('label.ranking-detail-plural')} + + {score !== undefined && ( + + {t('label.score')}: {formatScoreValue(score)} + + )} +
+ {rankingStages.length > 0 ? ( +
+ {rankingStages.map(({ description, label, name }) => ( +
+ + {label} + + + {description} + +
+ ))} +
+ ) : null} + {scoreReasons.length > 0 ? ( +
+ + {t('label.reason')} + + {scoreReasons.map(({ description, value }) => ( +
+ + {formatScoreValue(value)} + + + {description} + +
+ ))} +
+ ) : null} + + {t('message.search-ranking-signals-explanation')} + +
+ ) : null} {actionPopoverContent && ( {actionPopoverContent} )} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/explore-search-card.less b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/explore-search-card.less index 2cad3a0ca389..8bbfcc612868 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/explore-search-card.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/explore-search-card.less @@ -121,3 +121,61 @@ color: @primary-heading-color; } } + +.ranking-details-container { + background-color: @white; + border: 1px solid @border-color-4; + border-radius: 8px; + display: flex; + flex-direction: column; + gap: 6px; + margin-top: 8px; + padding: 8px 12px; +} + +.ranking-details-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; +} + +.ranking-details-title { + color: @text-color; + font-size: 12px; + font-weight: 600; + line-height: 18px; +} + +.ranking-details-score { + color: @text-grey-muted; + font-size: 12px; + line-height: 18px; +} + +.ranking-stage-list { + display: flex; + flex-direction: column; + gap: 4px; +} + +.ranking-stage-item { + display: grid; + grid-template-columns: minmax(88px, max-content) minmax(0, 1fr); + column-gap: 8px; + row-gap: 2px; + align-items: baseline; +} + +.ranking-score-explanation { + display: flex; + flex-direction: column; + gap: 4px; +} + +.ranking-score-contributor { + display: grid; + grid-template-columns: 56px minmax(0, 1fr); + gap: 8px; + align-items: baseline; +} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx index 96bb6d99400b..a9d0a344db5f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreV1.component.tsx @@ -26,6 +26,7 @@ import { ChevronDown, Download01, FilterFunnel01, + InfoCircle, Trash01, } from '@untitledui/icons'; import { Card, Col, Menu, Modal, Radio, Row, Skeleton } from 'antd'; @@ -105,6 +106,8 @@ const ExploreV1: React.FC = ({ activeTabKey, tabItems = [], searchResults, + showRankingDetails = false, + onChangeShowRankingDetails, onChangeAdvancedSearchQuickFilters, searchIndex, sortOrder, @@ -788,6 +791,18 @@ const ExploreV1: React.FC = ({ label={t('label.advanced-search')} onPress={() => toggleModal(true)} /> + + + onChangeShowRankingDetails?.(!showRankingDetails) + }> + + {t('label.ranking-detail-plural')} + + + @@ -854,6 +869,7 @@ const ExploreV1: React.FC = ({ isFilterSelected={hasActiveFilters} isSummaryPanelVisible={showSummaryPanel} selectedEntityId={entityDetails?.id || ''} + showRankingDetails={showRankingDetails} showResultCount={hasActiveFilters} totalValue={totalValue} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/exploreV1.less b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/exploreV1.less index b92ea3200818..7cc28ecf7be4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/exploreV1.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/exploreV1.less @@ -39,9 +39,9 @@ } .explore-page-right-panel { - flex: 1 1 400px; - max-width: 800px; - min-width: 400px; + flex: 0 0 clamp(360px, 26vw, 440px); + max-width: 440px; + min-width: 360px; overflow: auto; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.test.tsx index 8f94e2142129..d2f47965c8c8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.test.tsx @@ -10,7 +10,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { act, render, screen, waitFor } from '@testing-library/react'; +import { + act, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/react'; import { MemoryRouter, useParams } from 'react-router-dom'; import { BoostMode, @@ -127,7 +133,9 @@ describe('EntitySearchSettings', () => { screen.getByTestId('entity-search-settings-header') ).toBeInTheDocument(); expect(screen.getByTestId('search-preview')).toBeInTheDocument(); - expect(screen.getByTestId('field-configurations')).toBeInTheDocument(); + expect(screen.getByText('label.ranking-detail-plural')).toBeInTheDocument(); + expect(screen.getByText('message.no-data-available')).toBeInTheDocument(); + expect(screen.getByTestId('add-field-btn')).toBeInTheDocument(); }); it('Should not override preview config with undefined searchFields before entity config loads', async () => { @@ -246,4 +254,125 @@ describe('EntitySearchSettings', () => { expect(entityConfig).not.toHaveProperty('allowedFields'); expect(entityConfig).not.toHaveProperty('assetTypeConfigurations'); }); + + it('Should omit cleared ranking stage weight while saving', async () => { + const configWithRanking = { + ...mockSearchConfig, + assetTypeConfigurations: [ + { + ...mockSearchConfig.assetTypeConfigurations[0], + ranking: { + enabled: true, + stages: [ + { + name: 'exactName', + fields: ['name.keyword'], + weight: 100, + }, + ], + }, + }, + ], + }; + + mockUseApplicationStore.mockReturnValue({ + appPreferences: { searchConfig: configWithRanking }, + setAppPreferences: mockSetAppPreferences, + }); + + (updateSettingsConfig as jest.Mock).mockImplementation((settings) => + Promise.resolve({ data: settings }) + ); + + await act(async () => { + render( + + + + ); + }); + + fireEvent.change(screen.getByRole('spinbutton'), { + target: { value: '' }, + }); + + const { handleSaveChanges } = getLastSearchPreviewProps(); + + await act(async () => { + await handleSaveChanges(); + }); + + await waitFor(() => { + const settings = (updateSettingsConfig as jest.Mock).mock.calls[0][0]; + const entityConfig = settings.config_value.assetTypeConfigurations.find( + (config: { assetType: string }) => config.assetType === 'table' + ); + + expect(entityConfig.ranking.stages[0]).not.toHaveProperty('weight'); + }); + }); + + it('Should update the selected unnamed ranking stage while saving', async () => { + const configWithRanking = { + ...mockSearchConfig, + assetTypeConfigurations: [ + { + ...mockSearchConfig.assetTypeConfigurations[0], + ranking: { + enabled: true, + stages: [ + { + fields: ['name.keyword'], + weight: 100, + }, + { + fields: ['description'], + weight: 40, + }, + ], + }, + }, + ], + }; + + mockUseApplicationStore.mockReturnValue({ + appPreferences: { searchConfig: configWithRanking }, + setAppPreferences: mockSetAppPreferences, + }); + + (updateSettingsConfig as jest.Mock).mockImplementation((settings) => + Promise.resolve({ data: settings }) + ); + + await act(async () => { + render( + + + + ); + }); + + expect(screen.getByTestId('ranking-stage-unnamed-0')).toBeInTheDocument(); + expect(screen.getByTestId('ranking-stage-unnamed-1')).toBeInTheDocument(); + + fireEvent.change(screen.getAllByRole('spinbutton')[1], { + target: { value: '' }, + }); + + const { handleSaveChanges } = getLastSearchPreviewProps(); + + await act(async () => { + await handleSaveChanges(); + }); + + await waitFor(() => { + const settings = (updateSettingsConfig as jest.Mock).mock.calls[0][0]; + const entityConfig = settings.config_value.assetTypeConfigurations.find( + (config: { assetType: string }) => config.assetType === 'table' + ); + + expect(entityConfig.ranking.stages[0].weight).toBe(100); + expect(entityConfig.ranking.stages[1]).not.toHaveProperty('weight'); + }); + }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx b/openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx index 26905bb03596..5e47b8a1bdd6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx @@ -11,9 +11,18 @@ * limitations under the License. */ import Icon from '@ant-design/icons/lib/components/Icon'; -import { Col, Collapse, Row, Select, Typography } from 'antd'; +import { + Col, + Collapse, + InputNumber, + Row, + Select, + Switch, + Tag, + Typography, +} from 'antd'; import { AxiosError } from 'axios'; -import { isEmpty, startCase } from 'lodash'; +import { isEmpty, omit, startCase } from 'lodash'; import type { MenuInfo } from 'rc-menu/lib/interface'; import { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -31,16 +40,15 @@ import { BoostMode, FieldBoost, FieldValueBoost, + RankingConfiguration, + RankingStage, ScoreMode, + SearchFieldMatchType as MatchType, SearchSettings, TermBoost, } from '../../../generated/configuration/searchSettings'; import { CustomProperty } from '../../../generated/entity/type'; -import { - MatchType, - Settings, - SettingType, -} from '../../../generated/settings/settings'; +import { Settings, SettingType } from '../../../generated/settings/settings'; import { useAuth } from '../../../hooks/authHooks'; import { useApplicationStore } from '../../../hooks/useApplicationStore'; import { EntitySearchSettingsState } from '../../../pages/SearchSettingsPage/searchSettings.interface'; @@ -53,6 +61,7 @@ import { import { getSettingPageEntityBreadCrumb } from '../../../utils/GlobalSettingsUtils'; import { boostModeOptions, + getEffectiveRankingConfiguration, getEntitySearchConfig, getSearchSettingCategories, scoreModeOptions, @@ -106,7 +115,7 @@ const EntitySearchSettings = () => { const [customProperties, setCustomProperties] = useState( [] ); - const [activeKey, setActiveKey] = useState('1'); + const [activeKey, setActiveKey] = useState('ranking'); const [lastAddedSearchField, setLastAddedSearchField] = useState< string | null >(null); @@ -117,6 +126,12 @@ const EntitySearchSettings = () => { return getEntitySearchConfig(searchConfig, entityType); }, [searchConfig, entityType]); + const rankingConfiguration = useMemo( + () => + getEffectiveRankingConfiguration(searchConfig, getEntityConfiguration), + [searchConfig, getEntityConfiguration] + ); + const entityData = useMemo(() => { const settingCategories = getSearchSettingCategories( permissions, @@ -308,6 +323,7 @@ const EntitySearchSettings = () => { fieldValueBoosts: searchSettings.fieldValueBoosts, scoreMode: searchSettings.scoreMode, boostMode: searchSettings.boostMode, + ranking: searchSettings.ranking, }; updateSearchConfig(updates); @@ -332,6 +348,72 @@ const EntitySearchSettings = () => { } }; + const updateRankingSettings = ( + update: (ranking: RankingConfiguration) => RankingConfiguration + ) => { + setSearchSettings((prev) => ({ + ...prev, + ranking: update(prev.ranking ?? {}), + isUpdated: true, + })); + }; + + const handleRankingEnabledChange = (enabled: boolean) => { + updateRankingSettings((ranking) => ({ + ...ranking, + enabled, + })); + }; + + const handleRankingStageWeightChange = ( + stageIndex: number, + weight: number | null + ) => { + updateRankingSettings((ranking) => ({ + ...ranking, + stages: (ranking.stages ?? []).map((stage, index) => + index === stageIndex + ? weight === null + ? omit(stage, 'weight') + : { ...stage, weight } + : stage + ), + })); + }; + + const handleRankingSignalBoostModeChange = (boostMode: BoostMode) => { + updateRankingSettings((ranking) => ({ + ...ranking, + signals: { + ...(ranking.signals ?? {}), + boostMode, + }, + })); + }; + + const handleRankingSignalScoreModeChange = (scoreMode: ScoreMode) => { + updateRankingSettings((ranking) => ({ + ...ranking, + signals: { + ...(ranking.signals ?? {}), + scoreMode, + }, + })); + }; + + const handleRankingSignalMaxBoostChange = (maxBoost: number | null) => { + updateRankingSettings((ranking) => ({ + ...ranking, + signals: + maxBoost === null + ? omit(ranking.signals ?? {}, 'maxBoost') + : { + ...(ranking.signals ?? {}), + maxBoost, + }, + })); + }; + const handleFieldWeightChange = (fieldName: string, value: number) => { setSearchSettings((prev) => { const updatedFields = prev.searchFields?.map((field: FieldBoost) => @@ -557,10 +639,11 @@ const EntitySearchSettings = () => { highlightFields: getEntityConfiguration?.highlightFields, fieldValueBoosts: getEntityConfiguration?.fieldValueBoosts, termBoosts: getEntityConfiguration?.termBoosts, + ranking: rankingConfiguration, isUpdated: false, }); } - }, [getEntityConfiguration]); + }, [getEntityConfiguration, rankingConfiguration]); // Update preview config whenever searchSettings change useEffect(() => { @@ -582,6 +665,7 @@ const EntitySearchSettings = () => { fieldValueBoosts: searchSettings.fieldValueBoosts, scoreMode: searchSettings.scoreMode, boostMode: searchSettings.boostMode, + ranking: searchSettings.ranking, } : config ), @@ -596,6 +680,185 @@ const EntitySearchSettings = () => { } }, [searchSettings, searchConfig, entityType]); + const renderRankingFields = (fields: string[] = []) => ( +
+ {fields.map((field) => ( + + {field} + + ))} +
+ ); + + const renderRankingStage = (stage: RankingStage, stageIndex: number) => { + const stageName = stage.name ?? ''; + const stageKey = `${stageName || 'unnamed'}-${stageIndex}`; + const stageTestId = stageName + ? `ranking-stage-${stageName}` + : `ranking-stage-unnamed-${stageIndex}`; + const matchType = stage.matchType + ? `${startCase(stage.matchType)}${ + stage.minimumShouldMatch ? ` (${stage.minimumShouldMatch})` : '' + }` + : t('label.no-data'); + + return ( +
+ +
+ + {stageName ? startCase(stageName) : t('label.no-data')} + + + + + {t('label.weight')} + + + handleRankingStageWeightChange( + stageIndex, + typeof value === 'number' ? value : null + ) + } + /> + + + {stage.purpose && ( + + {stage.purpose} + + )} + + + + {t('label.match-type')} + + + {matchType} + + + + + {t('label.field-plural')} + + {renderRankingFields(stage.fields)} + + + + ); + }; + + const renderRankingSettings = () => { + const ranking = searchSettings.ranking; + + if (!ranking) { + return ( + + {t('message.no-data-available')} + + ); + } + + const signals = ranking.signals; + + return ( +
+
+ +
+ + {t('label.algorithm')} + + + {ranking.algorithm + ? startCase(ranking.algorithm) + : t('label.no-data')} + + + + + {t('label.enabled')} + + + + + + + {(ranking.stages ?? []).map(renderRankingStage)} + + {signals && ( +
+ {signals.purpose && ( + + {signals.purpose} + + )} + + {t('message.search-ranking-signals-explanation')} + + +
+ + {t('label.boost-mode')} + + + + + + {t('label.max')} + + + handleRankingSignalMaxBoostChange( + typeof value === 'number' ? value : null + ) + } + /> + + + + {t('label.field-plural')} + + {renderRankingFields(signals.fields)} + + + + )} + + ); + }; + return ( { bordered={false} className="w-full entity-collapse-container" onChange={handleCollapseChange}> + + {t('label.ranking-detail-plural')} + + } + key="ranking"> +
+ {renderRankingSettings()} +
+
([]); const [searchValue, setSearchValue] = useState(''); + const [showRankingDetails, setShowRankingDetails] = useState(false); const { currentPage, pageSize, @@ -83,6 +85,7 @@ const SearchPreview = ({ index: entityType as SearchIndex, query: searchTerm, queryFilter: '', + explain: showRankingDetails, searchSettings: searchConfig, }); @@ -98,7 +101,14 @@ const SearchPreview = ({ } } }, - [currentPage, pageSize, searchConfig, entityType, handlePagingChange] + [ + currentPage, + pageSize, + searchConfig, + entityType, + handlePagingChange, + showRankingDetails, + ] ); const renderSearchResults = () => { @@ -112,20 +122,31 @@ const SearchPreview = ({ return ( <> - {data.map(({ _score, _source, _id = '', highlight }) => ( - - ))} + {data.map( + ({ + _score, + _source, + _id = '', + highlight, + _explanation, + matched_queries, + }) => ( + + ) + )} {showPagination && ( 0) { fetchAssets({ searchTerm: searchValue, page: currentPage }); } - }, [searchConfig, currentPage]); + }, [searchConfig, currentPage, showRankingDetails]); return (
@@ -182,6 +203,16 @@ const SearchPreview = ({
+ + {t('label.ranking-detail-plural')} + +
(); - - const isColumn = useMemo( - () => testCase?.entityLink.includes('::columns::'), - [testCase] - ); - - const isComputeRowCountFieldVisible = useMemo(() => { - return selectedDefinition?.supportsRowLevelPassedFailed ?? false; - }, [selectedDefinition]); - - const dimensionColumnOptions = useMemo(() => { - const selectedColumn = getColumnNameFromEntityLink(testCase?.entityLink); - - return table?.columns?.reduce((acc, col) => { - if (col.name === selectedColumn) { - return acc; - } - - acc.push({ - label: getEntityName(col), - value: col.name, - }); - - return acc; - }, [] as { label: string; value: string }[]); - }, [table?.columns, testCase]); - - const formFields: FieldProp[] = [ - { - name: 'computePassedFailedRowCount', - label: t('label.compute-row-count'), - type: FieldTypes.SWITCH, - helperText: t('message.compute-row-count-helper-text'), - required: false, - props: { - 'data-testid': 'compute-passed-failed-row-count', - }, - id: 'root/computePassedFailedRowCount', - formItemLayout: FormItemLayout.HORIZONTAL, - }, - ]; - - const paramsField = useMemo(() => { - if (selectedDefinition?.parameterDefinition) { - return ; - } - - return <>; - }, [selectedDefinition, table]); - - const { tags, glossaryTerms } = useMemo(() => { - if (!testCase?.tags) { - return { tags: [], glossaryTerms: [], tierTag: null }; - } - - // First extract tier tag - const tierTag = getTierTags(testCase.tags); - // Filter out tier tags before processing - const tagsWithoutTier = getTagsWithoutTier(testCase.tags); - const filteredTags = getFilterTags(tagsWithoutTier); - - return { - tags: filteredTags.Classification, - glossaryTerms: filteredTags.Glossary, - tierTag, - }; - }, [testCase?.tags]); - - const handleFormSubmit: FormProps['onFinish'] = async (value) => { - const jsonPatch = createUpdatedTestCasePatch({ - testCase, - value, - createTestCaseObject: testCaseClassBase.getCreateTestCaseObject( - value, - selectedDefinition - ), - showOnlyParameter, - isComputeRowCountFieldVisible, - }); - - if (jsonPatch.length) { - try { - setIsLoadingOnSave(true); - const updateRes = await updateTestCaseById( - testCase.id ?? '', - jsonPatch - ); - onUpdate?.(updateRes); - showSuccessToast( - t('server.update-entity-success', { entity: t('label.test-case') }) - ); - onCancel(); - form.resetFields(); - } catch (error) { - showErrorToast(error as AxiosError); - } finally { - setIsLoadingOnSave(false); - } - } - }; - - const getParamsValue = (selectedDefinition: TestDefinition) => { - return testCase?.parameterValues?.reduce((acc, curr) => { - const param = selectedDefinition?.parameterDefinition?.find( - (definition) => definition.name === curr.name - ); - - if ( - param?.dataType === TestDataType.Array && - isValidJSONString(curr.value) - ) { - const value = JSON.parse(curr.value || '[]'); - - return { - ...acc, - [curr.name || '']: isArray(value) - ? value.map((val) => ({ - value: val, - })) - : value, - }; - } - - if (param?.dataType === TestDataType.Boolean) { - return { - ...acc, - [curr.name || '']: curr.value === 'true', - }; - } - - return { - ...acc, - [curr.name || '']: curr.value, - }; - }, {}); - }; - - const fetchTableDetails = async (tableFqn: string) => { - if (!tableFqn) { - return; - } - try { - const response = await getTableDetailsByFQN(tableFqn, { - fields: [ - TabSpecificField.TAGS, - TabSpecificField.OWNERS, - TabSpecificField.DOMAINS, - TabSpecificField.TESTSUITE, - TabSpecificField.COLUMNS, - ], - }); - setTable(response); - } catch (error) { - showErrorToast(error as AxiosError); - } - }; - - const fetchTestDefinitionById = async () => { - try { - setIsLoading(true); - - const testCaseDetails = await getTestCaseByFqn( - testCase?.fullyQualifiedName ?? '', - { fields: [TabSpecificField.TEST_DEFINITION] } - ); - const definition = await getTestDefinitionById( - testCaseDetails.testDefinition.id || '' - ); - - await fetchTableDetails(tableFqn); - - const formValue = pick(testCase, [ - 'name', - 'displayName', - 'description', - 'computePassedFailedRowCount', - 'useDynamicAssertion', - 'dimensionColumns', - 'topDimensions', - ]); - - form.setFieldsValue({ - testDefinition: getEntityName(testCaseDetails?.testDefinition), - params: getParamsValue(definition), - table: getNameFromFQN(tableFqn), - column: getColumnNameFromEntityLink(testCase?.entityLink), - tags: tags, - glossaryTerms: glossaryTerms, - ...formValue, - }); - setSelectedDefinition(definition); - } catch (error) { - showErrorToast(error as AxiosError); - } finally { - setIsLoading(false); - } - }; - - const formField: FieldProp[] = useMemo( - () => [ - { - name: 'description', - required: false, - label: t('label.description'), - id: 'root/description', - type: FieldTypes.DESCRIPTION, - props: { - 'data-testid': 'description', - initialValue: testCase?.description ?? '', - style: { - margin: 0, - }, - }, - }, - { - name: 'tags', - required: false, - label: t('label.tag-plural'), - id: 'root/tags', - type: FieldTypes.TAG_SUGGESTION, - props: { - selectProps: { - 'data-testid': 'tags-selector', - }, - initialValue: tags, - }, - }, - { - name: 'glossaryTerms', - required: false, - label: t('label.glossary-term-plural'), - id: 'root/glossaryTerms', - type: FieldTypes.TAG_SUGGESTION, - props: { - selectProps: { - 'data-testid': 'glossary-terms-selector', - }, - initialValue: glossaryTerms, - open: false, - hasNoActionButtons: true, - isTreeSelect: true, - tagType: TagSource.Glossary, - placeholder: t('label.select-field', { - field: t('label.glossary-term-plural'), - }), - }, - }, - ], - [testCase?.description, tags, glossaryTerms] - ); - - useEffect(() => { - if (testCase) { - fetchTestDefinitionById(); - - const isContainsColumnName = testCase.parameterValues?.find( - (value) => value.name === 'columnName' || value.name === 'column' - ); - - if (isContainsColumnName) { - fetchTableDetails(tableFqn); - } - } - }, [testCase]); - - return ( - { - form.resetFields(); - onCancel(); - }} - cancelText={t('label.cancel')} - closable={false} - confirmLoading={isLoadingOnSave} - maskClosable={false} - okText={t('label.save')} - open={visible} - title={`${t('label.edit')} ${testCase?.name}`} - width={720} - onCancel={onCancel} - onOk={() => form.submit()}> - - {isLoading ? ( - - ) : ( - - {!showOnlyParameter && ( - <> - - - - {isColumn && ( - - - - )} - - - - - - - - - - - - )} - - {isColumn && ( - -
(); - const [errorMessage, setErrorMessage] = useState(''); - const [activeField, setActiveField] = useState(''); - - // ============================================= - // COMPUTED VALUES - // ============================================= - const tableFqn = useMemo( - () => getEntityFQN(testCase?.entityLink ?? ''), - [testCase] - ); - - const isColumn = useMemo( - () => testCase?.entityLink.includes('::columns::'), - [testCase] - ); - - const isComputeRowCountFieldVisible = useMemo(() => { - return selectedDefinition?.supportsRowLevelPassedFailed ?? false; - }, [selectedDefinition]); - - const scrollToError = useMemo(() => createScrollToErrorHandler(), []); - - const { tags, glossaryTerms } = useMemo(() => { - if (!testCase?.tags) { - return { tags: [], glossaryTerms: [], tierTag: null }; - } - - // First extract tier tag - const tierTag = getTierTags(testCase.tags); - // Filter out tier tags before processing - const tagsWithoutTier = getTagsWithoutTier(testCase.tags); - const filteredTags = getFilterTags(tagsWithoutTier); - - return { - tags: filteredTags.Classification, - glossaryTerms: filteredTags.Glossary, - tierTag, - }; - }, [testCase?.tags]); - - const handleActiveField = useCallback( - (id: string) => { - // Only update if id matches pattern root/{any string} - if (/^root\/.+/.test(id)) { - setActiveField((pre) => { - if (pre !== id) { - return id; - } - - return pre; - }); - } - }, - [setActiveField] - ); - - const paramsField = useMemo(() => { - if (selectedDefinition?.parameterDefinition) { - return ( -
handleActiveField(`root/${selectedDefinition.name}`)}> - -
- ); - } - - return <>; - }, [selectedDefinition, table, handleActiveField]); - - const dimensionColumnOptions = useMemo(() => { - const selectedColumn = getColumnNameFromEntityLink(testCase?.entityLink); - - return table?.columns?.reduce((acc, col) => { - if (col.name === selectedColumn) { - return acc; - } - - acc.push({ - label: getEntityName(col), - value: col.name, - }); - - return acc; - }, [] as { label: string; value: string }[]); - }, [table?.columns]); - - // ============================================= - // FORM FIELDS - // ============================================= - const computeRowCountField: FieldProp[] = useMemo( - () => [ - { - name: 'computePassedFailedRowCount', - label: t('label.compute-row-count'), - type: FieldTypes.SWITCH, - helperText: t('message.compute-row-count-helper-text'), - required: false, - props: { - 'data-testid': 'compute-passed-failed-row-count', - id: 'root/computePassedFailedRowCount', - }, - id: 'computePassedFailedRowCount', - formItemLayout: FormItemLayout.HORIZONTAL, - newLook: true, - }, - ], - [t] - ); - - const formFields: FieldProp[] = useMemo( - () => [ - { - name: 'description', - required: false, - label: t('label.description'), - id: 'root/description', - type: FieldTypes.DESCRIPTION, - props: { - 'data-testid': 'description', - initialValue: testCase?.description ?? '', - style: { - margin: 0, - }, - }, - }, - { - name: 'tags', - required: false, - label: t('label.tag-plural'), - id: 'tags', - type: FieldTypes.TAG_SUGGESTION, - props: { - selectProps: { - 'data-testid': 'tags-selector', - getPopupContainer, - id: 'root/tags', - }, - newLook: true, - initialValue: tags, - }, - }, - { - name: 'glossaryTerms', - required: false, - label: t('label.glossary-term-plural'), - id: 'glossaryTerms', - type: FieldTypes.TAG_SUGGESTION, - props: { - selectProps: { - 'data-testid': 'glossary-terms-selector', - getPopupContainer, - id: 'root/glossaryTerms', - }, - newLook: true, - initialValue: glossaryTerms, - open: false, - hasNoActionButtons: true, - isTreeSelect: true, - tagType: TagSource.Glossary, - placeholder: t('label.select-field', { - field: t('label.glossary-term-plural'), - }), - }, - }, - ], - [testCase?.description, tags, glossaryTerms, t] - ); - - // ============================================= - // HANDLERS - // ============================================= - - const handleFieldFocus = useCallback( - (event: FocusEvent) => { - if (event.target.id) { - handleActiveField(event.target.id); - } - }, - [handleActiveField] - ); - - const handleFormSubmit: FormProps['onFinish'] = async (value) => { - setErrorMessage(''); - const jsonPatch = createUpdatedTestCasePatch({ - testCase, - value, - createTestCaseObject: testCaseClassBase.getCreateTestCaseObject( - value, - selectedDefinition - ), - showOnlyParameter, - isComputeRowCountFieldVisible, - }); - - if (jsonPatch.length) { - try { - setIsLoadingOnSave(true); - const updateRes = await updateTestCaseById( - testCase.id ?? '', - jsonPatch - ); - onUpdate?.(updateRes); - showSuccessToast( - t('server.update-entity-success', { entity: t('label.test-case') }) - ); - onCancel(); - form.resetFields(); - } catch (error) { - const errorMsg = - (error as AxiosError<{ message: string }>)?.response?.data?.message || - t('server.update-entity-error', { - entity: t('label.test-case'), - }); - setErrorMessage(errorMsg); - } finally { - setIsLoadingOnSave(false); - } - } - }; - - const getParamsValue = (selectedDefinition: TestDefinition) => { - return testCase?.parameterValues?.reduce((acc, curr) => { - const param = selectedDefinition?.parameterDefinition?.find( - (definition) => definition.name === curr.name - ); - - if ( - param?.dataType === TestDataType.Array && - isValidJSONString(curr.value) - ) { - const value = JSON.parse(curr.value || '[]'); - - return { - ...acc, - [curr.name || '']: isArray(value) - ? value.map((val) => ({ - value: val, - })) - : value, - }; - } - - if (param?.dataType === TestDataType.Boolean) { - return { - ...acc, - [curr.name || '']: curr.value === 'true', - }; - } - - return { - ...acc, - [curr.name || '']: curr.value, - }; - }, {}); - }; - - const fetchTableDetails = async (tableFqn: string) => { - if (!tableFqn) { - return; - } - try { - const response = await getTableDetailsByFQN(tableFqn, { - fields: [ - TabSpecificField.TAGS, - TabSpecificField.OWNERS, - TabSpecificField.DOMAINS, - TabSpecificField.TESTSUITE, - TabSpecificField.COLUMNS, - ], - }); - setTable({ ...response, entityType: EntityType.TABLE }); - } catch (error) { - // Handle error silently - } - }; - - const fetchTestDefinitionById = async () => { - try { - setIsLoading(true); - - const definition = await getTestDefinitionById( - testCase.testDefinition.id || '' - ); - - await fetchTableDetails(tableFqn); - - const formValue = pick(testCase, [ - 'name', - 'displayName', - 'description', - 'computePassedFailedRowCount', - 'useDynamicAssertion', - 'dimensionColumns', - 'topDimensions', - ]); - - form.setFieldsValue({ - testDefinition: getEntityName(testCase?.testDefinition), - params: getParamsValue(definition), - table: getNameFromFQN(tableFqn), - column: getColumnNameFromEntityLink(testCase?.entityLink), - tags: tags, - glossaryTerms: glossaryTerms, - ...formValue, - }); - setSelectedDefinition(definition); - } catch (error) { - showErrorToast(error as AxiosError); - } finally { - setIsLoading(false); - } - }; - - // ============================================= - // EFFECTS - // ============================================= - useEffect(() => { - if (testCase && open) { - fetchTestDefinitionById(); - } - }, [testCase, open]); - - // ============================================= - // RENDER - // ============================================= - const renderActionButtons = useMemo( - () => ( - - - - - ), - [isLoadingOnSave] - ); - - const formContent = ( - - {isLoading ? ( - - ) : ( -
- {/* Floating Error Alert - always visible at top */} - {errorMessage && ( -
- -
- )} - - - {!showOnlyParameter && ( - - - - - {isColumn && ( - - - - )} - {isColumn && ( - - - - - {generateFormFields( - testCaseClassBase.createFormAdditionalFields( - selectedDefinition?.supportsDynamicAssertion ?? false - ) - )} - - { - return !isEqual( - prevValues['useDynamicAssertion'], - currentValues['useDynamicAssertion'] - ); - }}> - {({ getFieldValue }) => - getFieldValue('useDynamicAssertion') ? null : paramsField - } - - - {isComputeRowCountFieldVisible && - generateFormFields(computeRowCountField)} - - {!showOnlyParameter && ( - - - - - - - - - - {generateFormFields(formFields)} - - )} - -
- )} -
- ); - - const drawerFooter = ( -
{renderActionButtons}
- ); - - return ( - - {t('label.edit-entity', { - entity: getEntityName(testCase), - })} - - } - width="75%" - {...drawerProps} - extra={ - + + ); + }; + + return render(); +}; + +describe('ParameterFields', () => { + it('renders a text input for a String parameter with its label', () => { + const definition = { + name: 'columnValuesToBeNotNull', + parameterDefinition: [ + { + name: 'minValue', + displayName: 'Min Value', + dataType: TestDataType.String, + }, + ], + } as TestDefinition; + + renderWithForm(definition); + + expect(screen.getByText('Min Value')).toBeInTheDocument(); + expect( + screen.getByPlaceholderText('message.enter-a-field') + ).toBeInTheDocument(); + }); + + it('falls back to a text input for parameter types without dedicated handling', () => { + const definition = { + name: 'tableDataToBeFresh', + parameterDefinition: [ + { + name: 'maxAge', + displayName: 'Max Age', + dataType: TestDataType.Timestamp, + }, + ], + } as TestDefinition; + + renderWithForm(definition); + + expect(screen.getByText('Max Age')).toBeInTheDocument(); + expect(screen.getByTestId('parameter-maxAge')).toBeInTheDocument(); + }); + + it('binds the sql expression editor to the form value', async () => { + const definition = { + name: 'tableCustomSQLQuery', + parameterDefinition: [ + { + name: 'sqlExpression', + displayName: 'SQL Expression', + dataType: TestDataType.String, + required: true, + }, + ], + } as TestDefinition; + + const handleSubmit = jest.fn(); + renderWithForm(definition, undefined, handleSubmit); + + expect(screen.getByTestId('parameter-sqlExpression')).toBeInTheDocument(); + + // Required + empty: submit must be blocked with the field error. + fireEvent.click(screen.getByText('submit')); + await waitFor(() => { + expect( + screen.getByText('message.field-text-is-required') + ).toBeInTheDocument(); + }); + + expect(handleSubmit).not.toHaveBeenCalled(); + }); + + it('renders a select offering the option values for an option parameter', () => { + const definition = { + name: 'columnValueLengthsToBeBetween', + parameterDefinition: [ + { + name: 'matchEnum', + displayName: 'Match Enum', + dataType: TestDataType.String, + optionValues: ['ANY', 'ALL'], + }, + ], + } as TestDefinition; + + renderWithForm(definition); + + expect(screen.getByText('Match Enum')).toBeInTheDocument(); + + const options = screen + .getAllByRole('option', { hidden: true }) + .map((option) => option.textContent); + + expect(options).toContain('ANY'); + expect(options).toContain('ALL'); + }); + + it('renders a switch with the label for a Boolean parameter', () => { + const definition = { + name: 'tableColumnCountToEqual', + parameterDefinition: [ + { + name: 'caseSensitive', + displayName: 'Case Sensitive', + dataType: TestDataType.Boolean, + }, + ], + } as TestDefinition; + + renderWithForm(definition); + + expect(screen.getByText('Case Sensitive')).toBeInTheDocument(); + expect( + screen.getByRole('switch', { name: 'Case Sensitive' }) + ).toBeInTheDocument(); + }); + + it('surfaces the validation message when a value violates a GreaterThanOrEquals rule', async () => { + const definition = { + name: 'columnValuesToBeBetween', + parameterDefinition: [ + { + name: 'minValue', + displayName: 'Min Value', + dataType: TestDataType.Number, + }, + { + name: 'maxValue', + displayName: 'Max Value', + dataType: TestDataType.Number, + validationRule: { + parameterField: 'minValue', + rule: Rule.GreaterThanOrEquals, + }, + }, + ], + } as TestDefinition; + + renderWithForm(definition); + + const minInput = screen.getByRole('spinbutton', { name: 'Min Value' }); + const maxInput = screen.getByRole('spinbutton', { name: 'Max Value' }); + + await act(async () => { + fireEvent.change(minInput, { target: { value: '10' } }); + fireEvent.change(maxInput, { target: { value: '5' } }); + }); + + await act(async () => { + fireEvent.click(screen.getByText('submit')); + }); + + await waitFor(() => { + expect( + screen.getByText('message.maximum-value-error') + ).toBeInTheDocument(); + }); + }); + + it('renders one row by default for an Array parameter', () => { + const definition = { + name: 'columnValuesToBeInSet', + parameterDefinition: [ + { + name: 'allowedValues', + displayName: 'Allowed Values', + dataType: TestDataType.Array, + }, + ], + } as TestDefinition; + + renderWithForm(definition); + + expect(screen.getByText('Allowed Values')).toBeInTheDocument(); + expect(screen.getAllByRole('textbox')).toHaveLength(1); + }); + + it('appends a new row when the add button is clicked for an Array parameter', async () => { + const definition = { + name: 'columnValuesToBeInSet', + parameterDefinition: [ + { + name: 'allowedValues', + displayName: 'Allowed Values', + dataType: TestDataType.Array, + }, + ], + } as TestDefinition; + + renderWithForm(definition); + + expect(screen.getAllByRole('textbox')).toHaveLength(1); + + await act(async () => { + fireEvent.click(screen.getByTestId('add-allowedValues')); + }); + + expect(screen.getAllByRole('textbox')).toHaveLength(2); + }); + + it('removes a row when its remove button is clicked for an Array parameter', async () => { + const definition = { + name: 'columnValuesToBeInSet', + parameterDefinition: [ + { + name: 'allowedValues', + displayName: 'Allowed Values', + dataType: TestDataType.Array, + }, + ], + } as TestDefinition; + + renderWithForm(definition); + + await act(async () => { + fireEvent.click(screen.getByTestId('add-allowedValues')); + }); + + expect(screen.getAllByRole('textbox')).toHaveLength(2); + + await act(async () => { + fireEvent.click(screen.getByTestId('remove-allowedValues-0')); + }); + + expect(screen.getAllByRole('textbox')).toHaveLength(1); + }); + + it('serializes Array param values as array of {value} objects on submit', async () => { + const capturedValues: FormValues[] = []; + + const definition = { + name: 'columnValuesToBeInSet', + parameterDefinition: [ + { + name: 'allowedValues', + displayName: 'Allowed Values', + dataType: TestDataType.Array, + }, + ], + } as TestDefinition; + + renderWithForm(definition, undefined, (values) => + capturedValues.push(values) + ); + + await act(async () => { + fireEvent.click(screen.getByTestId('add-allowedValues')); + }); + + const inputs = screen.getAllByRole('textbox'); + + await act(async () => { + fireEvent.change(inputs[0], { target: { value: 'x' } }); + fireEvent.change(inputs[1], { target: { value: 'y' } }); + }); + + await act(async () => { + fireEvent.click(screen.getByText('submit')); + }); + + await waitFor(() => { + expect(capturedValues).toHaveLength(1); + }); + + expect(capturedValues[0].params?.allowedValues).toEqual([ + { value: 'x' }, + { value: 'y' }, + ]); + }); + + it('renders one row by default for a Set parameter', () => { + const definition = { + name: 'columnValuesToBeInSet', + parameterDefinition: [ + { + name: 'forbiddenValues', + displayName: 'Forbidden Values', + dataType: TestDataType.Set, + }, + ], + } as TestDefinition; + + renderWithForm(definition); + + expect(screen.getByText('Forbidden Values')).toBeInTheDocument(); + expect(screen.getAllByRole('textbox')).toHaveLength(1); + }); + + it('surfaces the test definition doc in the field doc popover on focus', async () => { + const definition = { + name: 'tableColumnCountToBeBetween', + parameterDefinition: [ + { + name: 'min', + displayName: 'Min', + dataType: TestDataType.String, + description: 'The per-parameter description (should be overridden).', + }, + ], + } as TestDefinition; + + renderWithForm( + definition, + undefined, + undefined, + 'Selected test definition doc' + ); + + fireEvent.focus(screen.getByTestId('parameter-min')); + + // The parameter popover shows the selected test definition's doc (matching + // the classic drawer), not the individual parameter description. + expect(await screen.findByTestId('field-doc-content')).toHaveTextContent( + 'Selected test definition doc' + ); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/ParameterFields.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/ParameterFields.tsx new file mode 100644 index 000000000000..127c1a76e488 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/ParameterFields.tsx @@ -0,0 +1,430 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + Button, + FieldProp, + FieldTypes, + FormField, + FormItemLabel, + FormItemLayout, + FormSelectItem, + getField, + HelperTextType, + HintText, + useFieldDoc, +} from '@openmetadata/ui-core-components'; +import { Plus, Trash01 } from '@untitledui/icons'; +import { isUndefined } from 'lodash'; +import { lazy, useEffect, useRef } from 'react'; +import { RegisterOptions, useFieldArray, UseFormReturn } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; +import { SUPPORTED_PARTITION_TYPE_FOR_DATE_TIME } from '../../../../constants/profiler.constant'; +import { TABLE_DIFF } from '../../../../constants/TestSuite.constant'; +import { CSMode } from '../../../../enums/codemirror.enum'; +import { Table } from '../../../../generated/entity/data/table'; +import { + Rule, + TestCaseParameterDefinition, + TestDataType, + TestDefinition, +} from '../../../../generated/tests/testDefinition'; +import { getEntityName } from '../../../../utils/EntityNameUtils'; +import { isSelectParam } from '../../../../utils/ParameterForm/ParameterFieldsUtils'; +import { + validateEquals, + validateGreaterThanOrEquals, + validateLessThanOrEquals, + validateNotEquals, +} from '../../../../utils/ParameterForm/ParameterFormUtils'; +import withSuspenseFallback from '../../../AppRouter/withSuspenseFallback'; +import TableDiffFields from './TableDiffFields'; +import { FormValues } from './TestCaseFormV1.interface'; + +const CodeEditor = withSuspenseFallback( + lazy(() => import('../../../Database/SchemaEditor/CodeEditor')) +); + +interface ParamArrayFieldProps { + form: UseFormReturn; + data: TestCaseParameterDefinition; + // The selected test definition's doc, shown in the Form Hint popover on + // focus so the AI modal matches the classic drawer's documentation panel. + testDefinitionDoc?: string; +} + +const ParamArrayField: React.FC = ({ + form, + data, + testDefinitionDoc, +}) => { + const { t } = useTranslation(); + const fieldName = `params.${data.name}` as const; + const label = getEntityName(data); + + const { fields, append, remove } = useFieldArray({ + control: form.control, + name: fieldName as never, + }); + + const hasSeededRef = useRef(false); + useEffect(() => { + if (!hasSeededRef.current && fields.length === 0) { + hasSeededRef.current = true; + append({ value: undefined } as never); + } + }, [fields.length, append]); + + const rowRequired = data.required + ? t('message.field-text-is-required', { fieldText: label }) + : undefined; + + return ( +
+
+ +
+ {fields.map((field, index) => ( +
+
+ {getField({ + name: `params.${data.name}.${index}.value`, + label: '', + type: FieldTypes.TEXT, + // Only the group label shows the required asterisk; per-row fields + // must not repeat it. Validation is still enforced via `rules`. + required: false, + rules: rowRequired ? { required: rowRequired } : undefined, + // Surface the selected test definition's doc in the Form Hint + // popover on focus, matching the classic drawer's doc panel. + doc: testDefinitionDoc ?? data.description, + placeholder: t('message.enter-a-field', { field: label }), + id: `testCaseFormV1_params_${data.name}_${index}_value`, + props: { + 'data-testid': `parameter-${data.name}-${index}`, + }, + } as FieldProp)} +
+
+ ))} +
+ ); +}; + +interface SqlExpressionFieldProps { + form: UseFormReturn; + data: TestCaseParameterDefinition; + testDefinitionDoc?: string; +} + +const SqlExpressionField: React.FC = ({ + form, + data, + testDefinitionDoc, +}) => { + const { t } = useTranslation(); + const label = getEntityName(data); + const fieldDoc = useFieldDoc({ + name: `params.${data.name}`, + label, + doc: testDefinitionDoc ?? data.description, + }); + + return ( + + {({ field, fieldState }) => ( +
+ + + {fieldState.error && ( + {fieldState.error.message} + )} +
+ )} +
+ ); +}; + +const NUMERIC_DATA_TYPES = [ + TestDataType.Number, + TestDataType.Int, + TestDataType.Decimal, + TestDataType.Double, + TestDataType.Float, +]; + +const RULE_VALIDATORS: Record< + Rule, + (fieldValue: number, value: number) => Promise +> = { + [Rule.GreaterThanOrEquals]: validateGreaterThanOrEquals, + [Rule.LessThanOrEquals]: validateLessThanOrEquals, + [Rule.Equals]: validateEquals, + [Rule.NotEquals]: validateNotEquals, +}; + +export interface ParameterFieldsProps { + form: UseFormReturn; + definition: TestDefinition; + table?: Table; + // Doc for the selected test definition (from TestCaseForm.md), shown in the + // Form Hint popover when any parameter field is focused so the AI modal + // matches the classic drawer's documentation panel. + testDefinitionDoc?: string; +} + +const toSelectOptions = (values: string[]): FormSelectItem[] => + values.map((value) => ({ id: value, label: value })); + +const ParameterFields: React.FC = ({ + form, + definition, + table, + testDefinitionDoc, +}) => { + const { t } = useTranslation(); + + const buildRules = ( + data: TestCaseParameterDefinition, + label: string + ): RegisterOptions | undefined => { + const rules: RegisterOptions = {}; + + if (data.required) { + rules.required = t('message.field-text-is-required', { + fieldText: label, + }); + } + + if (data.validationRule?.parameterField && data.validationRule.rule) { + const { parameterField, rule } = data.validationRule; + const dependentPath = `params.${parameterField}` as const; + + rules.validate = async (value) => { + const fieldValue = Number(form.getValues(dependentPath as never)); + const currentValue = Number(value); + const validator = RULE_VALIDATORS[rule]; + + if (!fieldValue || !currentValue || !validator) { + return true; + } + + return validator(fieldValue, currentValue) + .then(() => true) + .catch((error: Error) => error.message); + }; + rules.deps = [dependentPath]; + } + + return Object.keys(rules).length > 0 ? rules : undefined; + }; + + const getColumnOptions = ( + data: TestCaseParameterDefinition + ): FormSelectItem[] => { + const isPartitionColumn = + definition.name === 'tableRowInsertedCountToBeBetween' && + data.name === 'columnName'; + + const columns = (table?.columns ?? []).filter((column) => + isPartitionColumn + ? SUPPORTED_PARTITION_TYPE_FOR_DATE_TIME.includes(column.dataType) + : true + ); + + return columns.map((column) => ({ + id: column.name, + label: getEntityName(column), + })); + }; + + const getStringFieldProp = ( + data: TestCaseParameterDefinition, + baseField: FieldProp, + label: string + ): FieldProp => { + // `table` must be loaded to source column options for either select + // variant; `isSelectParam` mirrors the name-matching rules shared with + // `buildEditParams` (see ParameterFieldsUtils) — keep both in sync. + const isColumnField = + !isUndefined(table) && isSelectParam(definition, data); + + if (isColumnField) { + return { + ...baseField, + type: FieldTypes.SELECT, + placeholder: t('message.select-column-name'), + props: { ...baseField.props, options: getColumnOptions(data) }, + }; + } + + return { + ...baseField, + type: FieldTypes.TEXT, + placeholder: t('message.enter-a-field', { field: label }), + }; + }; + + const getFieldProp = ( + data: TestCaseParameterDefinition + ): FieldProp | null => { + const label = getEntityName(data); + const baseField: FieldProp = { + name: `params.${data.name}`, + label, + type: FieldTypes.TEXT, + required: data.required, + rules: buildRules(data, label), + helperText: data.description, + helperTextType: HelperTextType.TOOLTIP, + // Form Hint popover shows the selected test definition's doc (matching + // the classic drawer's doc panel); the tooltip keeps the per-param text. + doc: testDefinitionDoc ?? data.description, + // Legacy antd form-item id kept as the stable E2E selector. + id: `testCaseFormV1_params_${data.name}`, + props: { 'data-testid': `parameter-${data.name}` }, + }; + + if (data.optionValues?.length) { + return { + ...baseField, + type: FieldTypes.SELECT, + placeholder: t('label.please-select-entity', { entity: label }), + props: { + ...baseField.props, + options: toSelectOptions(data.optionValues as string[]), + }, + }; + } + + if (data.dataType === TestDataType.String) { + return getStringFieldProp(data, baseField, label); + } + + if (data.dataType && NUMERIC_DATA_TYPES.includes(data.dataType)) { + return { + ...baseField, + type: FieldTypes.NUMBER, + placeholder: t('message.enter-a-field', { field: label }), + }; + } + + if (data.dataType === TestDataType.Boolean) { + return { + ...baseField, + type: FieldTypes.SWITCH, + formItemLayout: FormItemLayout.HORIZONTAL, + }; + } + + // Match the legacy form: any parameter type without dedicated handling + // (TIMESTAMP, DATE, TIME, BYTES, ...) still gets a plain text input. + return { + ...baseField, + type: FieldTypes.TEXT, + placeholder: t('message.enter-a-field', { field: label }), + }; + }; + + const isArrayOrSet = (data: TestCaseParameterDefinition): boolean => + data.dataType === TestDataType.Array || data.dataType === TestDataType.Set; + + if (definition.fullyQualifiedName === TABLE_DIFF) { + return ( + + ); + } + + return ( + <> + {definition.parameterDefinition?.map((data) => { + // Enum params (optionValues) render as a single select even when the + // schema types them ARRAY, matching the legacy precedence. + if (isArrayOrSet(data) && !data.optionValues?.length) { + return ( +
+ +
+ ); + } + + if (data.name === 'sqlExpression') { + return ( +
+ +
+ ); + } + + const fieldProp = getFieldProp(data); + + return fieldProp ? ( +
{getField(fieldProp)}
+ ) : null; + })} + + ); +}; + +export default ParameterFields; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TableDiffFields.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TableDiffFields.test.tsx new file mode 100644 index 000000000000..39de0a19fb67 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TableDiffFields.test.tsx @@ -0,0 +1,353 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { HookForm } from '@openmetadata/ui-core-components'; +import { act, render, screen, waitFor } from '@testing-library/react'; +import { useForm, UseFormReturn } from 'react-hook-form'; +import { Table } from '../../../../generated/entity/data/table'; +import { + TestDataType, + TestDefinition, +} from '../../../../generated/tests/testDefinition'; +import { searchQuery } from '../../../../rest/searchAPI'; +import TableDiffFields, { + restoreParamName, + sanitizeParamName, +} from './TableDiffFields'; +import { FormValues } from './TestCaseFormV1.interface'; + +jest.mock('@untitledui/icons', () => ({ + Trash01: () => , +})); + +const capturedFieldOptions: Record< + string, + Array<{ id: string; isDisabled?: boolean }> +> = {}; + +jest.mock('@openmetadata/ui-core-components', () => { + const actual = jest.requireActual('@openmetadata/ui-core-components'); + + return { + ...actual, + getField: (config: { + name?: string; + props?: { options?: Array<{ id: string; isDisabled?: boolean }> }; + }) => { + if (config.name && config.props?.options) { + capturedFieldOptions[config.name] = config.props.options; + } + + return actual.getField(config); + }, + }; +}); + +jest.mock('../../../../rest/searchAPI', () => ({ + searchQuery: jest.fn(), +})); + +const mockSearchQuery = searchQuery as jest.MockedFunction; + +const TABLE2_FQN = 'service.db.schema.orders'; + +const SEARCH_RESPONSE = { + hits: { + hits: [ + { + _source: { + name: 'orders', + fullyQualifiedName: TABLE2_FQN, + columns: [ + { name: 'order_id', dataType: 'BIGINT' }, + { name: 'amount', dataType: 'DECIMAL' }, + ], + }, + }, + ], + }, +}; + +const TABLE_DIFF_DEFINITION = { + name: 'tableDiff', + fullyQualifiedName: 'tableDiff', + parameterDefinition: [ + { name: 'table2', displayName: 'Table 2', dataType: TestDataType.String }, + { + name: 'keyColumns', + displayName: 'Key Columns', + dataType: TestDataType.Array, + }, + { + name: 'table2.keyColumns', + displayName: 'Table 2 Key Columns', + dataType: TestDataType.Array, + }, + { + name: 'useColumns', + displayName: 'Use Columns', + dataType: TestDataType.Array, + }, + ], +} as TestDefinition; + +const MAIN_TABLE = { + columns: [ + { name: 'id', dataType: 'BIGINT' }, + { name: 'name', dataType: 'VARCHAR' }, + ], +} as Table; + +let formRef: UseFormReturn | undefined; + +const renderFields = (table?: Table) => { + const Wrapper = () => { + const form = useForm(); + formRef = form; + + return ( + + + + ); + }; + + return render(); +}; + +const isColumnSelectDisabled = (testId: string): boolean => + screen.getByTestId(testId).getAttribute('data-disabled') === 'true'; + +describe('TableDiffFields', () => { + beforeEach(() => { + formRef = undefined; + mockSearchQuery.mockResolvedValue(SEARCH_RESPONSE as never); + Object.keys(capturedFieldOptions).forEach( + (key) => delete capturedFieldOptions[key] + ); + }); + + it('renders generic inputs for the remaining tableDiff parameters', async () => { + const extendedDefinition = { + ...TABLE_DIFF_DEFINITION, + parameterDefinition: [ + ...(TABLE_DIFF_DEFINITION.parameterDefinition ?? []), + { + name: 'where', + displayName: 'SQL Where Clause', + dataType: TestDataType.String, + }, + { + name: 'threshold', + displayName: 'Threshold', + dataType: TestDataType.Int, + }, + { + name: 'caseSensitiveColumns', + displayName: 'Case sensitive columns', + dataType: TestDataType.Boolean, + }, + ], + } as TestDefinition; + + const Wrapper = () => { + const form = useForm(); + + return ( + + + + ); + }; + + render(); + + expect(await screen.findByTestId('parameter-where')).toBeInTheDocument(); + expect(screen.getByTestId('parameter-threshold')).toBeInTheDocument(); + expect( + screen.getByTestId('parameter-caseSensitiveColumns') + ).toBeInTheDocument(); + }); + + it('renders the table2 async select', async () => { + await act(async () => { + renderFields(MAIN_TABLE); + }); + + expect(await screen.findByTestId('table2')).toBeInTheDocument(); + }); + + it('keeps the table2.keyColumns select disabled until table2 is selected', async () => { + await act(async () => { + renderFields(MAIN_TABLE); + }); + + await screen.findByTestId('table2'); + + expect(isColumnSelectDisabled('parameter-table2.keyColumns-0')).toBe(true); + }); + + it('loads table2 columns and enables table2.keyColumns once table2 is selected', async () => { + await act(async () => { + renderFields(MAIN_TABLE); + }); + + await screen.findByTestId('table2'); + + await act(async () => { + formRef?.setValue( + 'params.table2' as never, + { + id: TABLE2_FQN, + label: TABLE2_FQN, + } as never + ); + }); + + await waitFor(() => { + expect(isColumnSelectDisabled('parameter-table2.keyColumns-0')).toBe( + false + ); + }); + + const options = screen + .getAllByRole('option', { hidden: true }) + .map((option) => option.textContent); + + expect(options).toContain('order_id'); + expect(options).toContain('amount'); + }); + + it('disables table2.keyColumns again when table2 is cleared', async () => { + await act(async () => { + renderFields(MAIN_TABLE); + }); + + await screen.findByTestId('table2'); + + await act(async () => { + formRef?.setValue( + 'params.table2' as never, + { + id: TABLE2_FQN, + label: TABLE2_FQN, + } as never + ); + }); + + await waitFor(() => { + expect(isColumnSelectDisabled('parameter-table2.keyColumns-0')).toBe( + false + ); + }); + + await act(async () => { + formRef?.setValue('params.table2' as never, null as never); + }); + + await waitFor(() => { + expect(isColumnSelectDisabled('parameter-table2.keyColumns-0')).toBe( + true + ); + }); + }); + + it('disables a column in useColumns once it is selected in keyColumns, and vice versa', async () => { + await act(async () => { + renderFields(MAIN_TABLE); + }); + + await screen.findByTestId('table2'); + + await act(async () => { + formRef?.setValue( + 'params.keyColumns' as never, + [{ value: 'id' }] as never + ); + }); + + await waitFor(() => { + const useColumnsOptions = + capturedFieldOptions['params.useColumns.0.value']; + + expect(useColumnsOptions).toBeDefined(); + + const idOption = useColumnsOptions?.find((opt) => opt.id === 'id'); + + expect(idOption?.isDisabled).toBe(true); + }); + + await act(async () => { + formRef?.setValue( + 'params.keyColumns' as never, + [{ value: undefined }] as never + ); + formRef?.setValue( + 'params.useColumns' as never, + [{ value: 'name' }] as never + ); + }); + + await waitFor(() => { + const keyColumnsOptions = + capturedFieldOptions['params.keyColumns.0.value']; + + expect(keyColumnsOptions).toBeDefined(); + + const nameOption = keyColumnsOptions?.find((opt) => opt.id === 'name'); + + expect(nameOption?.isDisabled).toBe(true); + }); + }); + + it('stores table2.keyColumns under a sanitized key that restores to the literal dotted name without colliding with params.table2', async () => { + await act(async () => { + renderFields(MAIN_TABLE); + }); + + await screen.findByTestId('table2'); + + const sanitizedKey = sanitizeParamName('table2.keyColumns'); + + await act(async () => { + formRef?.setValue( + 'params.table2' as never, + { + id: TABLE2_FQN, + label: TABLE2_FQN, + } as never + ); + }); + + await act(async () => { + formRef?.setValue( + `params.${sanitizedKey}` as never, + [{ value: 'order_id' }] as never + ); + }); + + const params = formRef?.getValues().params as Record; + + expect(params[sanitizedKey]).toEqual([{ value: 'order_id' }]); + expect(restoreParamName(sanitizedKey)).toBe('table2.keyColumns'); + expect(params.table2).toEqual({ id: TABLE2_FQN, label: TABLE2_FQN }); + expect(params['table2.keyColumns']).toBeUndefined(); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TableDiffFields.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TableDiffFields.tsx new file mode 100644 index 000000000000..cc2e881613fc --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TableDiffFields.tsx @@ -0,0 +1,474 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + Button, + FieldProp, + FieldTypes, + FormItemLabel, + FormItemLayout, + FormSelectItem, + getField, + HelperTextType, +} from '@openmetadata/ui-core-components'; +import { Plus, Trash01 } from '@untitledui/icons'; +import { debounce } from 'lodash'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { useFieldArray, UseFormReturn, useWatch } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; +import { WILD_CARD_CHAR } from '../../../../constants/char.constants'; +import { PAGE_SIZE_LARGE } from '../../../../constants/constants'; +import { SearchIndex } from '../../../../enums/search.enum'; +import { Column, Table } from '../../../../generated/entity/data/table'; +import { + TestCaseParameterDefinition, + TestDataType, + TestDefinition, +} from '../../../../generated/tests/testDefinition'; +import { + SearchHitBody, + TableSearchSource, +} from '../../../../interface/search.interface'; +import { searchQuery } from '../../../../rest/searchAPI'; +import { getEntityName } from '../../../../utils/EntityNameUtils'; +import { + restoreParamName, + sanitizeParamName, +} from '../../../../utils/ParameterForm/ParameterFieldsUtils'; +import { FormValues } from './TestCaseFormV1.interface'; + +export { restoreParamName, sanitizeParamName }; + +type TableHit = SearchHitBody< + SearchIndex.TABLE, + Pick< + TableSearchSource, + 'name' | 'displayName' | 'fullyQualifiedName' | 'columns' + > +>; + +export const TABLE2 = 'table2'; +export const TABLE2_KEY_COLUMNS = 'table2.keyColumns'; +export const KEY_COLUMNS = 'keyColumns'; +export const USE_COLUMNS = 'useColumns'; + +const NUMERIC_DATA_TYPES = [ + TestDataType.Number, + TestDataType.Int, + TestDataType.Decimal, + TestDataType.Double, + TestDataType.Float, +]; + +const paramFieldName = (name: string): string => + `params.${sanitizeParamName(name)}`; + +const getSelectedColumnNames = ( + rows: Array<{ value?: string | FormSelectItem }> | undefined +): Set => + new Set( + (rows ?? []) + .map((row) => + typeof row?.value === 'string' ? row.value : row?.value?.id + ) + .filter(Boolean) as string[] + ); + +interface ColumnArrayFieldProps { + form: UseFormReturn; + data: TestCaseParameterDefinition; + columns?: Column[]; + disabled?: boolean; + excludedColumns?: Set; +} + +const ColumnArrayField: React.FC = ({ + form, + data, + columns, + disabled, + excludedColumns, +}) => { + const { t } = useTranslation(); + const fieldName = paramFieldName(data.name ?? ''); + const label = getEntityName(data); + + const { fields, append, remove } = useFieldArray({ + control: form.control, + name: fieldName as never, + }); + + const rows = useWatch({ + control: form.control, + name: fieldName as never, + }) as Array<{ value?: string | FormSelectItem }> | undefined; + + const hasSeededRef = useRef(false); + useEffect(() => { + if (!hasSeededRef.current && fields.length === 0) { + hasSeededRef.current = true; + append({ value: undefined } as never); + } + }, [fields.length, append]); + + const selectedColumns = useMemo(() => getSelectedColumnNames(rows), [rows]); + + const options: FormSelectItem[] = useMemo(() => { + const base: FormSelectItem[] = (columns ?? []).map((column) => ({ + id: column.name, + label: getEntityName(column), + isDisabled: + selectedColumns.has(column.name) || + (excludedColumns?.has(column.name) ?? false), + })); + const knownIds = new Set(base.map((option) => option.id)); + + // Keep any already-selected value whose column metadata hasn't loaded yet + // (the second table's columns are fetched asynchronously in edit mode). + // Without this the react-aria Select receives a selectedKey absent from its + // options, drops the selection, and blanks the prefilled value. + (rows ?? []).forEach((row) => { + const selected = row?.value; + if ( + selected && + typeof selected !== 'string' && + selected.id && + !knownIds.has(selected.id) + ) { + knownIds.add(selected.id); + base.push({ id: selected.id, label: selected.label ?? selected.id }); + } + }); + + return base; + }, [columns, selectedColumns, excludedColumns, rows]); + + return ( +
+
+ +
+ {fields.map((field, index) => ( +
+
+ {getField({ + name: `${fieldName}.${index}.value`, + label: '', + type: FieldTypes.SELECT, + // Only the group label shows the required asterisk; per-row fields + // must not repeat it. Validation stays enforced via `rules`. + required: false, + rules: data.required + ? { + required: t('message.field-text-is-required', { + fieldText: label, + }), + } + : undefined, + placeholder: t('message.select-column-name'), + id: `testCaseFormV1_params_${data.name}_${index}_value`, + props: { + 'aria-label': label, + isDisabled: disabled, + options, + 'data-testid': `parameter-${data.name}-${index}`, + }, + } as FieldProp)} +
+
+ ))} +
+ ); +}; + +export interface TableDiffFieldsProps { + form: UseFormReturn; + definition: TestDefinition; + table?: Table; +} + +const TableDiffFields: React.FC = ({ + form, + definition, + table, +}) => { + const { t } = useTranslation(); + const [isOptionsLoading, setIsOptionsLoading] = useState(false); + const [tableList, setTableList] = useState([]); + const [table2Columns, setTable2Columns] = useState(); + + const table2Value = useWatch({ + control: form.control, + name: paramFieldName(TABLE2) as never, + }) as FormSelectItem | null | undefined; + + const table2Fqn = table2Value?.id; + + const tableOptions: FormSelectItem[] = useMemo( + () => + tableList.map((hit) => ({ + id: hit._source.fullyQualifiedName ?? '', + label: hit._source.fullyQualifiedName ?? '', + })), + [tableList] + ); + + const fetchTableData = useCallback(async (search = WILD_CARD_CHAR) => { + setIsOptionsLoading(true); + try { + const response = await searchQuery({ + query: `*${search}*`, + pageNumber: 1, + pageSize: PAGE_SIZE_LARGE, + searchIndex: SearchIndex.TABLE, + fetchSource: true, + includeFields: ['name', 'fullyQualifiedName', 'displayName', 'columns'], + }); + setTableList(response.hits.hits as TableHit[]); + } catch { + setTableList([]); + } finally { + setIsOptionsLoading(false); + } + }, []); + + const debounceFetchTableData = useMemo( + () => debounce(fetchTableData, 1000), + [fetchTableData] + ); + + useEffect(() => { + fetchTableData(); + }, [fetchTableData]); + + useEffect( + () => () => { + debounceFetchTableData.cancel(); + }, + [debounceFetchTableData] + ); + + const fetchedTable2ColumnsRef = useRef(); + useEffect(() => { + if (!table2Fqn) { + setTable2Columns(undefined); + + return; + } + + const selectedTable = tableList.find( + (hit) => hit._source.fullyQualifiedName === table2Fqn + ); + + if (selectedTable) { + setTable2Columns(selectedTable._source.columns); + + return; + } + + // Edit mode: `table2` is prefilled but absent from the wildcard search + // `tableList` (no targeted search ran), so its columns never populate and + // the second table's key-column selects render empty. Fetch that specific + // table by FQN so the prefilled key columns can display. + if (fetchedTable2ColumnsRef.current === table2Fqn) { + return; + } + fetchedTable2ColumnsRef.current = table2Fqn; + + let active = true; + searchQuery({ + query: `*${table2Fqn}*`, + pageNumber: 1, + pageSize: PAGE_SIZE_LARGE, + searchIndex: SearchIndex.TABLE, + fetchSource: true, + includeFields: ['name', 'fullyQualifiedName', 'displayName', 'columns'], + }) + .then((response) => { + const hit = (response.hits.hits as TableHit[]).find( + (item) => item._source.fullyQualifiedName === table2Fqn + ); + if (active && hit) { + setTable2Columns(hit._source.columns); + } + }) + .catch(() => undefined); + + return () => { + active = false; + }; + }, [table2Fqn, tableList]); + + const previousTable2FqnRef = useRef(table2Fqn); + useEffect(() => { + if (previousTable2FqnRef.current !== table2Fqn) { + // Only clear the second table's key columns on a genuine table -> table + // swap. During the edit-mode prefill `table2` can transition + // undefined -> (and briefly back) after mount; resetting on those + // would wipe the prefilled `table2.keyColumns`. Requiring both a previous + // and a current table restricts the reset to a real user switch. + const isTableSwap = + Boolean(previousTable2FqnRef.current) && Boolean(table2Fqn); + previousTable2FqnRef.current = table2Fqn; + if (isTableSwap) { + form.setValue( + paramFieldName(TABLE2_KEY_COLUMNS) as never, + [{ value: undefined }] as never + ); + } + } + }, [table2Fqn, form]); + + const keyColumnsRows = useWatch({ + control: form.control, + name: paramFieldName(KEY_COLUMNS) as never, + }) as Array<{ value?: string }> | undefined; + + const useColumnsRows = useWatch({ + control: form.control, + name: paramFieldName(USE_COLUMNS) as never, + }) as Array<{ value?: string }> | undefined; + + const crossListExcludedColumns = useMemo(() => { + const keySet = getSelectedColumnNames(keyColumnsRows); + const useSet = getSelectedColumnNames(useColumnsRows); + + return new Set([...keySet, ...useSet]); + }, [keyColumnsRows, useColumnsRows]); + + // Remaining tableDiff parameters (where, threshold, caseSensitiveColumns, + // ...) get generic inputs by data type, like the legacy form's default. + // Rendered in parameterDefinition order via renderParameter below. + + const getRemainingFieldProp = ( + data: TestCaseParameterDefinition + ): FieldProp => { + const label = getEntityName(data); + const baseField: FieldProp = { + name: paramFieldName(data.name ?? ''), + label, + type: FieldTypes.TEXT, + required: data.required, + id: `testCaseFormV1_params_${data.name}`, + rules: data.required + ? { + required: t('message.field-text-is-required', { + fieldText: label, + }), + } + : undefined, + helperText: data.description, + helperTextType: HelperTextType.TOOLTIP, + placeholder: t('message.enter-a-field', { field: label }), + props: { 'data-testid': `parameter-${data.name}` }, + }; + + if (data.dataType === TestDataType.Boolean) { + return { + ...baseField, + type: FieldTypes.SWITCH, + formItemLayout: FormItemLayout.HORIZONTAL, + }; + } + + if (data.dataType && NUMERIC_DATA_TYPES.includes(data.dataType)) { + return { ...baseField, type: FieldTypes.NUMBER }; + } + + return baseField; + }; + + const renderParameter = (data: TestCaseParameterDefinition) => { + switch (data.name) { + case TABLE2: + return getField({ + name: paramFieldName(TABLE2), + label: getEntityName(data), + type: FieldTypes.ASYNC_SELECT, + required: data.required, + helperText: data.description, + helperTextType: HelperTextType.TOOLTIP, + placeholder: t('label.table'), + id: `testCaseFormV1_params_${TABLE2}`, + props: { + 'data-testid': TABLE2, + isLoading: isOptionsLoading, + options: tableOptions, + onSearchChange: debounceFetchTableData, + }, + } as FieldProp); + case KEY_COLUMNS: + return ( + + ); + case TABLE2_KEY_COLUMNS: + return ( + + ); + case USE_COLUMNS: + return ( + + ); + default: + return getField(getRemainingFieldProp(data)); + } + }; + + return ( + <> + {(definition.parameterDefinition ?? []) + .filter((data) => data.name) + .map((data) => ( +
{renderParameter(data)}
+ ))} + + ); +}; + +export default TableDiffFields; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseForm.integration.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseForm.integration.test.tsx new file mode 100644 index 000000000000..0dd54de370a7 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseForm.integration.test.tsx @@ -0,0 +1,173 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + act, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/react'; +import { UseFormReturn } from 'react-hook-form'; +import { Table } from '../../../../generated/entity/data/table'; +import { createTestCase } from '../../../../rest/testAPI'; +import TestCaseFormDrawer from './TestCaseFormDrawer'; +import { + FormValues, + TestCaseFormBodyProps, + TestCaseFormContext, + TestLevel, +} from './TestCaseFormV1.interface'; + +const mockGetResourceLimit = jest.fn().mockResolvedValue(undefined); + +jest.mock('../../../../rest/testAPI', () => ({ + createTestCase: jest.fn(), +})); + +jest.mock('../../../../rest/ingestionPipelineAPI', () => ({ + addIngestionPipeline: jest.fn().mockResolvedValue({ id: 'pipeline-id' }), + deployIngestionPipelineById: jest.fn().mockResolvedValue({}), +})); + +jest.mock( + '../../../../context/AirflowStatusProvider/AirflowStatusProvider', + () => ({ + useAirflowStatus: jest.fn().mockReturnValue({ isAirflowAvailable: true }), + }) +); + +jest.mock('../../../../context/LimitsProvider/useLimitsStore', () => ({ + useLimitStore: jest.fn().mockReturnValue({ + config: {}, + getResourceLimit: (...args: unknown[]) => mockGetResourceLimit(...args), + }), +})); + +jest.mock('../../../../context/PermissionProvider/PermissionProvider', () => ({ + usePermissionProvider: () => ({ + permissions: { ingestionPipeline: { Create: false, EditAll: false } }, + }), +})); + +jest.mock('../../../../utils/ToastUtils', () => ({ + showSuccessToast: jest.fn(), + showErrorToast: jest.fn(), +})); + +jest.mock('../../../common/ServiceDocPanel/ServiceDocPanel', () => + jest.fn().mockImplementation(() =>
) +); + +// NOTE: transformTestCaseFormData is intentionally NOT mocked — this test +// exercises the real values -> payload transform so it guards the contract +// (testDefinition string, parameterValues [{name,value}]) end to end. + +const selectedDefinition = { + fullyQualifiedName: 'columnValuesToBeInSet', + name: 'columnValuesToBeInSet', + parameterDefinition: [{ name: 'allowedValues' }], +} as TestCaseFormContext['selectedDefinition']; + +const mockContext: TestCaseFormContext = { + selectedDefinition, + selectedTableData: { + id: 'table-id', + name: 'table', + fullyQualifiedName: 'service.db.schema.table', + columns: [], + } as Table, + selectedColumn: 'email', + selectedTestLevel: TestLevel.COLUMN, + generateName: () => 'generated_name', + canCreatePipeline: false, +}; + +let seedRealisticFormValues: (() => void) | undefined; +let emitContextFn: ((ctx: TestCaseFormContext) => void) | undefined; + +jest.mock('./TestCaseFormBody', () => + jest + .fn() + .mockImplementation(({ form, onContextChange }: TestCaseFormBodyProps) => { + const typedForm = form as UseFormReturn; + emitContextFn = onContextChange; + seedRealisticFormValues = () => { + // Real RHF select fields store FormSelectItem objects, not raw strings. + typedForm.setValue('testTypeId', { + id: 'columnValuesToBeInSet', + label: 'Column Values To Be In Set', + } as never); + typedForm.setValue('testName', 'my_email_test'); + typedForm.setValue('params', { + allowedValues: { id: 'admin@example.com', label: 'admin' }, + } as never); + }; + + return
; + }) +); + +const mockCreateTestCase = createTestCase as jest.Mock; + +const mockTable = { + id: 'table-id', + name: 'table', + fullyQualifiedName: 'service.db.schema.table', +} as Table; + +describe('TestCaseForm integration (real transform)', () => { + beforeEach(() => { + jest.clearAllMocks(); + seedRealisticFormValues = undefined; + emitContextFn = undefined; + mockCreateTestCase.mockResolvedValue({ + name: 'my_email_test', + id: 'created-id', + }); + }); + + it('submits a payload with a string testDefinition and well-formed parameterValues', async () => { + render(); + + await screen.findByTestId('test-case-form-body'); + + await act(async () => { + emitContextFn?.(mockContext); + seedRealisticFormValues?.(); + }); + + const submitBtn = await screen.findByTestId('create-btn'); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(mockCreateTestCase).toHaveBeenCalledTimes(1); + }); + + const payload = mockCreateTestCase.mock.calls[0][0]; + + expect(typeof payload.testDefinition).toBe('string'); + expect(payload.testDefinition).toBe('columnValuesToBeInSet'); + + expect(Array.isArray(payload.parameterValues)).toBe(true); + expect(payload.parameterValues).toEqual([ + { name: 'allowedValues', value: 'admin@example.com' }, + ]); + + const serialized = JSON.stringify(payload); + + expect(serialized).not.toContain('[object Object]'); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.test.tsx new file mode 100644 index 000000000000..6569b9926365 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.test.tsx @@ -0,0 +1,807 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { HookForm } from '@openmetadata/ui-core-components'; +import { + act, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/react'; +import { useForm, UseFormReturn } from 'react-hook-form'; +import { Table } from '../../../../generated/entity/data/table'; +import { TestDefinition } from '../../../../generated/tests/testDefinition'; +import { getIngestionPipelines } from '../../../../rest/ingestionPipelineAPI'; +import { searchQuery } from '../../../../rest/searchAPI'; +import { getTableDetailsByFQN } from '../../../../rest/tableAPI'; +import { + getListTestCaseBySearch, + getListTestDefinitions, +} from '../../../../rest/testAPI'; +import TestCaseFormBody from './TestCaseFormBody'; +import { FormValues, TestLevel } from './TestCaseFormV1.interface'; + +jest.mock('../../../common/RichTextEditor/RichTextEditor', () => ({ + __esModule: true, + default: jest + .fn() + .mockImplementation(() =>
), +})); + +jest.mock('../../../../rest/searchAPI', () => ({ + searchQuery: jest.fn(), +})); + +jest.mock('../../../../rest/tableAPI', () => ({ + getTableDetailsByFQN: jest.fn(), +})); + +jest.mock('../../../../rest/testAPI', () => ({ + getListTestDefinitions: jest.fn(), + getListTestCaseBySearch: jest.fn(), +})); + +jest.mock('../../../../rest/ingestionPipelineAPI', () => ({ + getIngestionPipelines: jest.fn(), +})); + +jest.mock('../../../../context/PermissionProvider/PermissionProvider', () => ({ + usePermissionProvider: () => ({ + permissions: { + ingestionPipeline: { + Create: true, + }, + }, + }), +})); + +jest.mock('../../../../context/LimitsProvider/useLimitsStore', () => ({ + useLimitStore: jest.fn().mockReturnValue({ + config: { + limits: { + config: { + featureLimits: [ + { + name: 'dataQuality', + pipelineSchedules: [ + { displayName: 'Daily', cron: '0 0 * * *' }, + { displayName: 'Weekly', cron: '0 0 * * 0' }, + ], + }, + ], + }, + }, + }, + }), +})); + +jest.mock( + '../../../Settings/Services/AddIngestion/Steps/ScheduleIntervalV1', + () => + jest.fn().mockImplementation(({ onChange }) => ( +
+ +
+ )) +); + +jest.mock('../../AddTestCaseList/AddTestCaseList.component', () => ({ + AddTestCaseList: jest.fn().mockImplementation(({ onChange }) => ( +
+ +
+ )), +})); + +const mockSearchQuery = searchQuery as jest.MockedFunction; +const mockGetTableDetailsByFQN = getTableDetailsByFQN as jest.MockedFunction< + typeof getTableDetailsByFQN +>; +const mockGetListTestDefinitions = + getListTestDefinitions as jest.MockedFunction; +const mockGetListTestCaseBySearch = + getListTestCaseBySearch as jest.MockedFunction< + typeof getListTestCaseBySearch + >; +const mockGetIngestionPipelines = getIngestionPipelines as jest.MockedFunction< + typeof getIngestionPipelines +>; + +const TEST_DEFINITION_FQN = 'columnValuesToBeBetween'; + +const TEST_DEFINITION = { + id: 'def-1', + name: 'columnValuesToBeBetween', + fullyQualifiedName: TEST_DEFINITION_FQN, + displayName: 'Column Values To Be Between', + description: 'Validate column values lie within a range', + parameterDefinition: [ + { + name: 'minValue', + displayName: 'Min', + dataType: 'INT', + required: true, + }, + ], +} as unknown as TestDefinition; + +const DYNAMIC_DEFINITION = { + ...TEST_DEFINITION, + supportsDynamicAssertion: true, +} as unknown as TestDefinition; + +const ROW_LEVEL_DEFINITION = { + ...TEST_DEFINITION, + supportsRowLevelPassedFailed: true, +} as unknown as TestDefinition; + +const TABLE_FQN = 'service.db.schema.customers'; + +const SEARCH_RESPONSE = { + hits: { + total: { value: 1 }, + hits: [ + { + _source: { + name: 'customers', + fullyQualifiedName: TABLE_FQN, + }, + }, + ], + }, +}; + +const SELECTED_TABLE = { + id: 'table-id', + name: 'customers', + fullyQualifiedName: TABLE_FQN, + columns: [ + { name: 'id', dataType: 'BIGINT' }, + { name: 'email', dataType: 'VARCHAR' }, + ], +} as Table; + +const SELECTED_TABLE_WITH_SUITE = { + ...SELECTED_TABLE, + testSuite: { + id: 'test-suite-id', + fullyQualifiedName: `${TABLE_FQN}.testSuite`, + }, +} as Table; + +let formRef: UseFormReturn | undefined; + +const renderBody = ( + props: Partial[0]> = {}, + defaultValues: Partial = { testLevel: TestLevel.TABLE } +) => { + const Wrapper = () => { + const form = useForm({ + defaultValues: defaultValues as FormValues, + }); + formRef = form; + + return ( + + + + ); + }; + + return render(); +}; + +describe('TestCaseFormBody', () => { + beforeEach(() => { + formRef = undefined; + mockSearchQuery.mockResolvedValue(SEARCH_RESPONSE as never); + mockGetTableDetailsByFQN.mockResolvedValue(SELECTED_TABLE as never); + mockGetListTestDefinitions.mockResolvedValue({ + data: [TEST_DEFINITION], + paging: { total: 1 }, + } as never); + mockGetListTestCaseBySearch.mockResolvedValue({ + data: [], + paging: { total: 0 }, + } as never); + mockGetIngestionPipelines.mockResolvedValue({ + data: [], + paging: { total: 0 }, + } as never); + }); + + it('renders the three test level cards', async () => { + await act(async () => { + renderBody(); + }); + + expect(screen.getByText('label.table-level')).toBeInTheDocument(); + expect(screen.getByText('label.column-level')).toBeInTheDocument(); + expect(screen.getByText('label.dimension-level')).toBeInTheDocument(); + }); + + it('renders the table async select', async () => { + await act(async () => { + renderBody(); + }); + + expect(await screen.findByTestId('selectedTable')).toBeInTheDocument(); + }); + + it('does not render the column select at table level', async () => { + await act(async () => { + renderBody(); + }); + + expect(screen.queryByTestId('selectedColumn')).not.toBeInTheDocument(); + }); + + it('reveals the column select when test level is column', async () => { + await act(async () => { + renderBody(); + }); + + await act(async () => { + formRef?.setValue('testLevel', TestLevel.COLUMN); + }); + + expect(await screen.findByTestId('selectedColumn')).toBeInTheDocument(); + }); + + it('disables column select and dimension columns select when no table is selected', async () => { + await act(async () => { + renderBody(); + }); + + await act(async () => { + formRef?.setValue('testLevel', TestLevel.COLUMN); + }); + + const columnSelect = await screen.findByTestId('selectedColumn'); + const columnButton = columnSelect.querySelector('button'); + + expect(columnButton).toBeDisabled(); + + await act(async () => { + formRef?.setValue('testLevel', TestLevel.COLUMN_DIMENSION); + }); + + const dimensionSelect = await screen.findByTestId('dimensionColumns'); + const dimensionInput = dimensionSelect.querySelector('input'); + + expect(dimensionInput).toBeDisabled(); + }); + + it('reveals dimension columns and top dimensions when test level is column-dimension', async () => { + await act(async () => { + renderBody(); + }); + + await act(async () => { + formRef?.setValue('testLevel', TestLevel.COLUMN_DIMENSION); + }); + + expect(await screen.findByTestId('dimensionColumns')).toBeInTheDocument(); + expect(await screen.findByTestId('topDimensions')).toBeInTheDocument(); + }); + + it('reveals dimension columns and top dimensions in edit mode for a plain column test so dimensions can be added later', async () => { + await act(async () => { + renderBody({ isEditMode: true }, { testLevel: TestLevel.COLUMN }); + }); + + expect(await screen.findByTestId('dimensionColumns')).toBeInTheDocument(); + expect(await screen.findByTestId('topDimensions')).toBeInTheDocument(); + }); + + it('does not reveal dimension columns for a plain column test in create mode', async () => { + await act(async () => { + renderBody(); + }); + + await act(async () => { + formRef?.setValue('testLevel', TestLevel.COLUMN); + }); + + expect(await screen.findByTestId('selectedColumn')).toBeInTheDocument(); + expect(screen.queryByTestId('dimensionColumns')).not.toBeInTheDocument(); + expect(screen.queryByTestId('topDimensions')).not.toBeInTheDocument(); + }); + + it('renders the inline error alert and dismisses it', async () => { + const onErrorDismiss = jest.fn(); + await act(async () => { + renderBody({ errorMessage: 'Something went wrong', onErrorDismiss }); + }); + + expect(screen.getByText('Something went wrong')).toBeInTheDocument(); + + fireEvent.click(screen.getByTestId('alert-close-button')); + + await waitFor(() => { + expect(onErrorDismiss).toHaveBeenCalled(); + }); + }); + + it('disables the table select and defaults the value when table prop is provided', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + const tableSelect = await screen.findByTestId('selectedTable'); + + expect(formRef?.getValues('selectedTable')).toBeDefined(); + + const input = tableSelect.querySelector('input'); + + expect(input).toBeDisabled(); + }); + + it('renders the parameter fields once a test type is selected', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + await act(async () => { + formRef?.setValue('testTypeId', { + id: TEST_DEFINITION_FQN, + label: 'Column Values To Be Between', + } as never); + }); + + expect(await screen.findByTestId('parameter-minValue')).toBeInTheDocument(); + }); + + it('hides the parameter fields when dynamic assertion is enabled', async () => { + mockGetListTestDefinitions.mockResolvedValue({ + data: [DYNAMIC_DEFINITION], + paging: { total: 1 }, + } as never); + + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + await act(async () => { + formRef?.setValue('testTypeId', { + id: TEST_DEFINITION_FQN, + label: 'Column Values To Be Between', + } as never); + }); + + expect( + await screen.findByTestId('use-dynamic-assertion') + ).toBeInTheDocument(); + expect(await screen.findByTestId('parameter-minValue')).toBeInTheDocument(); + + await act(async () => { + formRef?.setValue('useDynamicAssertion', true); + }); + + await waitFor(() => { + expect( + screen.queryByTestId('parameter-minValue') + ).not.toBeInTheDocument(); + }); + }); + + it('shows the compute-row-count switch only when the definition supports it', async () => { + mockGetListTestDefinitions.mockResolvedValue({ + data: [ROW_LEVEL_DEFINITION], + paging: { total: 1 }, + } as never); + + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + expect( + screen.queryByTestId('compute-passed-failed-row-count') + ).not.toBeInTheDocument(); + + await act(async () => { + formRef?.setValue('testTypeId', { + id: TEST_DEFINITION_FQN, + label: 'Column Values To Be Between', + } as never); + }); + + expect( + await screen.findByTestId('compute-passed-failed-row-count') + ).toBeInTheDocument(); + }); + + it('renders the test details fields (name, description, tags, glossary)', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + expect(await screen.findByTestId('test-case-name')).toBeInTheDocument(); + expect(await screen.findByTestId('description')).toBeInTheDocument(); + expect(await screen.findByTestId('tags-selector')).toBeInTheDocument(); + expect( + await screen.findByTestId('glossary-terms-selector') + ).toBeInTheDocument(); + }); + + it('auto-generates the test name when definition, table and level are set', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + await act(async () => { + formRef?.setValue('testTypeId', { + id: TEST_DEFINITION_FQN, + label: 'Column Values To Be Between', + } as never); + }); + + await waitFor(() => { + expect(formRef?.getValues('testName')).toBeTruthy(); + }); + + expect(formRef?.getValues('testName')).toContain('customers'); + }); + + it('does not override the test name once the user has edited it', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + const nameField = await screen.findByTestId('test-case-name'); + const nameInput = nameField.querySelector('input') as HTMLInputElement; + + await act(async () => { + fireEvent.change(nameInput, { target: { value: 'my_custom_name' } }); + }); + + await act(async () => { + formRef?.setValue('testTypeId', { + id: TEST_DEFINITION_FQN, + label: 'Column Values To Be Between', + } as never); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + expect(formRef?.getValues('testName')).toBe('my_custom_name'); + }); + + it('renders the scheduler section when a table is selected and a pipeline can be created', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + expect(await screen.findByTestId('pipeline-name')).toBeInTheDocument(); + expect( + await screen.findByTestId('schedule-interval-v1') + ).toBeInTheDocument(); + expect(await screen.findByTestId('enable-debug-log')).toBeInTheDocument(); + expect(await screen.findByTestId('raise-on-error')).toBeInTheDocument(); + }); + + it('does not render the scheduler section when a pipeline already exists', async () => { + mockGetIngestionPipelines.mockResolvedValue({ + data: [{ id: 'pipeline-1' }], + paging: { total: 1 }, + } as never); + + await act(async () => { + renderBody({ table: SELECTED_TABLE_WITH_SUITE }); + }); + + await waitFor(() => { + expect(mockGetIngestionPipelines).toHaveBeenCalled(); + }); + + expect(screen.queryByTestId('pipeline-name')).not.toBeInTheDocument(); + }); + + it('renders the select-all switch and AddTestCaseList when table has a test suite', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE_WITH_SUITE }); + }); + + expect( + await screen.findByTestId('select-all-test-cases') + ).toBeInTheDocument(); + expect(await screen.findByTestId('add-test-case-list')).toBeInTheDocument(); + + await act(async () => { + fireEvent.click(screen.getByTestId('add-test-case-btn')); + }); + + await waitFor(() => { + expect(formRef?.getValues('testCases')).toHaveLength(1); + }); + }); + + it('toggles the custom-query section at table level', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + expect(await screen.findByTestId('test-type')).toBeInTheDocument(); + + await act(async () => { + fireEvent.click(screen.getByTestId('custom-query')); + }); + + await waitFor(() => { + expect(screen.queryByTestId('test-type')).not.toBeInTheDocument(); + }); + + expect(formRef?.getValues('testTypeId')).toEqual({ + id: 'tableCustomSQLQuery', + label: 'tableCustomSQLQuery', + }); + + await act(async () => { + fireEvent.click(screen.getByTestId('test-type-btn')); + }); + + expect(await screen.findByTestId('test-type')).toBeInTheDocument(); + expect(formRef?.getValues('testTypeId')).toBeUndefined(); + }); + + it('invokes onContextChange with the current selection context', async () => { + const onContextChange = jest.fn(); + await act(async () => { + renderBody({ table: SELECTED_TABLE, onContextChange }); + }); + + await waitFor(() => { + expect(onContextChange).toHaveBeenCalled(); + }); + + const lastCall = + onContextChange.mock.calls[onContextChange.mock.calls.length - 1][0]; + + expect(lastCall.selectedTestLevel).toBe(TestLevel.TABLE); + expect(typeof lastCall.generateName).toBe('function'); + expect(lastCall.canCreatePipeline).toBe(true); + }); + + describe('isEditMode', () => { + it('does not render the test-level cards in edit mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, isEditMode: true }); + }); + + expect(screen.queryByText('label.table-level')).not.toBeInTheDocument(); + expect(screen.queryByText('label.column-level')).not.toBeInTheDocument(); + expect( + screen.queryByText('label.dimension-level') + ).not.toBeInTheDocument(); + }); + + it('disables the table select in edit mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, isEditMode: true }); + }); + + const tableSelect = await screen.findByTestId('selectedTable'); + const input = tableSelect.querySelector('input'); + + expect(input).toBeDisabled(); + }); + + it('disables the column select in edit mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, isEditMode: true }); + }); + + await act(async () => { + formRef?.setValue('testLevel', TestLevel.COLUMN); + }); + + const columnSelect = await screen.findByTestId('selectedColumn'); + const columnButton = columnSelect.querySelector('button'); + + expect(columnButton).toBeDisabled(); + }); + + it('disables the test type select in edit mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, isEditMode: true }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + const testTypeSelect = await screen.findByTestId('test-type'); + const testTypeInput = testTypeSelect.querySelector('input'); + + expect(testTypeInput).toBeDisabled(); + }); + + it('disables the name field in edit mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, isEditMode: true }); + }); + + const nameField = await screen.findByTestId('test-case-name'); + const nameInput = nameField.querySelector('input'); + + expect(nameInput).toBeDisabled(); + }); + + it('does not render the custom-query toggle in edit mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, isEditMode: true }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + expect(screen.queryByTestId('custom-query')).not.toBeInTheDocument(); + }); + + it('does not render the scheduler section in edit mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, isEditMode: true }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + expect(screen.queryByTestId('pipeline-name')).not.toBeInTheDocument(); + }); + + it('renders the display name field in edit mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, isEditMode: true }); + }); + + expect(await screen.findByTestId('display-name')).toBeInTheDocument(); + }); + + it('does not render the display name field in create mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE }); + }); + + expect(screen.queryByTestId('display-name')).not.toBeInTheDocument(); + }); + + it('does not auto-generate the test name in edit mode', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, isEditMode: true }); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + await act(async () => { + formRef?.setValue('testTypeId', { + id: TEST_DEFINITION_FQN, + label: 'Column Values To Be Between', + } as never); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + expect(formRef?.getValues('testName')).toBeFalsy(); + }); + + it('keeps the prefilled test type and column when the source fields already carry edit values', async () => { + await act(async () => { + renderBody( + { table: SELECTED_TABLE, isEditMode: true }, + { + testLevel: TestLevel.COLUMN, + selectedTable: TABLE_FQN, + selectedColumn: 'email', + testTypeId: { + id: TEST_DEFINITION_FQN, + label: 'Column Values To Be Between', + } as never, + } + ); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + expect(formRef?.getValues('selectedColumn')).toBe('email'); + expect(formRef?.getValues('testTypeId')).toEqual({ + id: TEST_DEFINITION_FQN, + label: 'Column Values To Be Between', + }); + }); + + it('keeps the prefilled dimension columns and top dimensions on a column-dimension edit', async () => { + await act(async () => { + renderBody( + { table: SELECTED_TABLE, isEditMode: true }, + { + testLevel: TestLevel.COLUMN_DIMENSION, + selectedTable: TABLE_FQN, + selectedColumn: 'email', + dimensionColumns: ['id'], + topDimensions: 5, + } + ); + }); + + await waitFor(() => { + expect(mockGetListTestDefinitions).toHaveBeenCalled(); + }); + + expect(formRef?.getValues('selectedColumn')).toBe('email'); + expect(formRef?.getValues('dimensionColumns')).toEqual(['id']); + expect(formRef?.getValues('topDimensions')).toBe(5); + }); + }); + + describe('showOnlyParameter', () => { + it('renders only the test-type card and hides other sections', async () => { + await act(async () => { + renderBody({ table: SELECTED_TABLE, showOnlyParameter: true }); + }); + + expect(screen.getByTestId('test-type-card')).toBeInTheDocument(); + expect(screen.queryByTestId('select-table-card')).not.toBeInTheDocument(); + expect(screen.queryByTestId('test-details-card')).not.toBeInTheDocument(); + expect(screen.queryByTestId('pipeline-name')).not.toBeInTheDocument(); + }); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.tsx new file mode 100644 index 000000000000..f74fb8a8a5c0 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.tsx @@ -0,0 +1,1213 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + Alert, + Button, + FieldProp, + FieldTypes, + FormField, + FormItemLabel, + FormItemLayout, + FormSelectItem, + getField, + HelperTextType, + useFieldDoc, + useFieldDocRegistry, +} from '@openmetadata/ui-core-components'; +import { Edit01 } from '@untitledui/icons'; +import classNames from 'classnames'; +import cryptoRandomString from 'crypto-random-string-with-promisify-polyfill'; +import { debounce, snakeCase } from 'lodash'; +import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { useWatch } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; +import { ReactComponent as DimensionIcon } from '../../../../assets/svg/data-observability/dimension.svg'; +import { ReactComponent as ColumnIcon } from '../../../../assets/svg/ic-column.svg'; +import { ReactComponent as TableIcon } from '../../../../assets/svg/ic-table-test.svg'; +import { + MAX_NAME_LENGTH, + PAGE_SIZE_LARGE, +} from '../../../../constants/constants'; +import { TEST_CASE_NAME_REGEX } from '../../../../constants/regex.constants'; +import { TEST_CASE_FORM } from '../../../../constants/service-guide.constant'; +import { useLimitStore } from '../../../../context/LimitsProvider/useLimitsStore'; +import { usePermissionProvider } from '../../../../context/PermissionProvider/PermissionProvider'; +import { ResourceEntity } from '../../../../context/PermissionProvider/PermissionProvider.interface'; +import { SearchIndex } from '../../../../enums/search.enum'; +import { PipelineType } from '../../../../generated/api/services/ingestionPipelines/createIngestionPipeline'; +import { TagSource } from '../../../../generated/entity/data/container'; +import { Table } from '../../../../generated/entity/data/table'; +import { + EntityType, + TestDefinition, + TestPlatform, +} from '../../../../generated/tests/testDefinition'; +import { TableSearchSource } from '../../../../interface/search.interface'; +import testCaseClassBase from '../../../../pages/IncidentManager/IncidentManagerDetailPage/TestCaseClassBase'; +import { getIngestionPipelines } from '../../../../rest/ingestionPipelineAPI'; +import { searchQuery } from '../../../../rest/searchAPI'; +import { getTableDetailsByFQN } from '../../../../rest/tableAPI'; +import { + getListTestCaseBySearch, + getListTestDefinitions, +} from '../../../../rest/testAPI'; +import { getScheduleOptionsFromSchedules } from '../../../../utils/CronExpressionUtils'; +import { + convertSearchSourceToTable, + getServiceTypeForTestDefinition, +} from '../../../../utils/DataQuality/DataQualityPureUtils'; +import { loadFormFieldDocs } from '../../../../utils/DataQuality/FormFieldDocs'; +import { getEntityName } from '../../../../utils/EntityNameUtils'; +import { ensureComboboxMenuOpen } from '../../../../utils/formPureUtils'; +import { unwrapSelectValues } from '../../../../utils/ParameterForm/ParameterFieldsUtils'; +import RichTextEditor from '../../../common/RichTextEditor/RichTextEditor'; +import SelectionCardGroup from '../../../common/SelectionCardGroup/SelectionCardGroup'; +import TagSuggestion from '../../../common/TagSuggestion/TagSuggestion'; +import ParameterFields from './ParameterFields'; +import { + TablesCache, + TestCaseFormBodyProps, + TestLevel, + TestLevelOption, +} from './TestCaseFormV1.interface'; +import TestCaseSchedulerSection from './TestCaseSchedulerSection'; + +const TABLE_CUSTOM_SQL_QUERY = 'tableCustomSQLQuery'; +const TABLES_CACHE_MAX_SIZE = 100; + +const fqnFromSelectItem = ( + value?: FormSelectItem | string | null +): string | undefined => { + let result: string | undefined; + if (typeof value === 'string') { + result = value; + } else if (value) { + result = value.id; + } + + return result; +}; + +const TestCaseFormBody: FC = ({ + form, + table, + testSuite, + errorMessage, + onErrorDismiss, + onActiveFieldChange, + onContextChange, + isEditMode = false, + showOnlyParameter = false, + editDefinition, +}: TestCaseFormBodyProps) => { + const { t } = useTranslation(); + const { config } = useLimitStore(); + const { permissions, getEntityPermissionByFqn } = usePermissionProvider(); + const { ingestionPipeline, testCase } = permissions; + + const [selectedTableData, setSelectedTableData] = useState
( + table + ); + const [tablesCache, setTablesCache] = useState(new Map()); + const [tableOptions, setTableOptions] = useState([]); + const [isTableLoading, setIsTableLoading] = useState(false); + + const [testDefinitions, setTestDefinitions] = useState([]); + // Seed from the drawer-resolved edit definition so the parameter section is + // present on the very first paint (the drawer only mounts this body once + // `editDefinition` is ready), rather than appearing a frame later when the + // effect below runs. + const [selectedTestDefinition, setSelectedTestDefinition] = useState< + TestDefinition | undefined + >(editDefinition); + const [selectedTestType, setSelectedTestType] = useState(); + const [currentColumnType, setCurrentColumnType] = useState(); + const [isCustomQuery, setIsCustomQuery] = useState(false); + + // Per-field "Form Hint" text is sourced from the same TestCaseForm.md that + // backs the classic documentation panel, so the popover and the doc panel + // stay in sync and we don't duplicate the copy as translation strings. + const [fieldDocs, setFieldDocs] = useState>({}); + useEffect(() => { + let cancelled = false; + loadFormFieldDocs(TEST_CASE_FORM).then((docs) => { + if (!cancelled) { + setFieldDocs(docs); + } + }); + + return () => { + cancelled = true; + }; + }, []); + + const [existingTestCases, setExistingTestCases] = useState([]); + const [canCreatePipeline, setCanCreatePipeline] = useState(false); + const [isCheckingPermissions, setIsCheckingPermissions] = useState(false); + const [isTestNameManuallyEdited, setIsTestNameManuallyEdited] = + useState(false); + + const testLevelFieldValue = useWatch({ + control: form.control, + name: 'testLevel', + }); + const selectedTableValue = useWatch({ + control: form.control, + name: 'selectedTable', + }); + const selectedColumnValue = useWatch({ + control: form.control, + name: 'selectedColumn', + }); + const testTypeValue = useWatch({ + control: form.control, + name: 'testTypeId', + }); + const useDynamicAssertionValue = useWatch({ + control: form.control, + name: 'useDynamicAssertion', + }); + const dimensionColumnsValue = useWatch({ + control: form.control, + name: 'dimensionColumns', + }); + + const selectedTableFqn = fqnFromSelectItem( + selectedTableValue as FormSelectItem | string | null + ); + const selectedColumn = fqnFromSelectItem( + selectedColumnValue as FormSelectItem | string | null + ); + const selectedTestTypeFqn = fqnFromSelectItem( + testTypeValue as FormSelectItem | string | null + ); + + const handleActiveField = useCallback( + (id: string) => { + onActiveFieldChange?.(id); + }, + [onActiveFieldChange] + ); + + // Legacy parity: without global testCase.Create, require EditAll/EditTests + // on the selected table and gate pipeline creation on the result. + const checkTablePermissions = useCallback( + async (tableFqn: string): Promise => { + if (testCase?.Create) { + return true; + } + setIsCheckingPermissions(true); + try { + const tablePermissions = await getEntityPermissionByFqn( + ResourceEntity.TABLE, + tableFqn + ); + const canCreate = + tablePermissions.EditAll || tablePermissions.EditTests; + setCanCreatePipeline(canCreate); + if (!canCreate) { + return t('message.no-permission-for-create-test-case-on-table'); + } + + return true; + } catch { + return true; + } finally { + setIsCheckingPermissions(false); + } + }, + [testCase?.Create, getEntityPermissionByFqn, t] + ); + + // Report the focused field to the doc panel. Rendered controls carry + // `root/` ids, so one capture handler covers every field the + // same way the legacy antd form's form-level onFocus did. + const handleFormFocusCapture = useCallback( + (event: React.FocusEvent) => { + const fieldId = (event.target as HTMLElement).closest?.( + '[id^="root/"]' + )?.id; + if (fieldId) { + handleActiveField(fieldId); + } + }, + [handleActiveField] + ); + + const testLevelOptions: TestLevelOption[] = useMemo( + () => [ + { + value: TestLevel.TABLE, + label: t('label.table-level'), + description: t('label.test-applied-on-entity', { + entity: t('label.table-lowercase'), + }), + icon: , + }, + { + value: TestLevel.COLUMN, + label: t('label.column-level'), + description: t('label.test-applied-on-entity', { + entity: t('label.column-lowercase'), + }), + icon: , + }, + { + value: TestLevel.COLUMN_DIMENSION, + label: t('label.dimension-level'), + description: t('label.column-with-dimension'), + icon: , + isBeta: true, + }, + ], + [t] + ); + + const selectedTestLevel = useMemo(() => { + let result = testLevelFieldValue; + if (testLevelFieldValue === TestLevel.COLUMN_DIMENSION) { + result = TestLevel.COLUMN; + } + + return result; + }, [testLevelFieldValue]); + + const hasTestSuite = Boolean( + testSuite?.id || selectedTableData?.testSuite?.id + ); + + const pipelineSchedules = config?.limits?.config.featureLimits.find( + (feature) => feature.name === 'dataQuality' + )?.pipelineSchedules; + + const schedulerOptions = useMemo(() => { + let result: string[] | undefined; + if (pipelineSchedules && pipelineSchedules.length > 0) { + result = getScheduleOptionsFromSchedules(pipelineSchedules); + } + + return result; + }, [pipelineSchedules]); + + const columnOptions: FormSelectItem[] = useMemo(() => { + const result: FormSelectItem[] = (selectedTableData?.columns ?? []).map( + (column) => ({ + id: column.name, + label: getEntityName(column), + }) + ); + + // In edit mode the drawer is often opened without a `table` prop (incident + // manager, data-quality page, result tab), so the table's columns are + // fetched asynchronously. Keep the prefilled column selectable before that + // fetch resolves; otherwise the react-aria Select receives a selectedKey + // absent from its options and blanks the field. + if ( + selectedColumn && + !result.some((option) => option.id === selectedColumn) + ) { + result.push({ id: selectedColumn, label: selectedColumn }); + } + + return result; + }, [selectedTableData, selectedColumn]); + + const dimensionColumnOptions: FormSelectItem[] = useMemo(() => { + const result = selectedColumn + ? columnOptions.filter((option) => option.id !== selectedColumn) + : [...columnOptions]; + + // Same async-prefill guard as `columnOptions`: preserve already-selected + // dimension columns whose metadata hasn't loaded yet so the multi-select + // does not drop them. + const knownIds = new Set(result.map((option) => option.id)); + (unwrapSelectValues(dimensionColumnsValue) ?? []).forEach((id) => { + if (id !== selectedColumn && !knownIds.has(id)) { + knownIds.add(id); + result.push({ id, label: id }); + } + }); + + return result; + }, [columnOptions, selectedColumn, dimensionColumnsValue]); + + const fetchTables = useCallback( + async (searchValue = '') => { + if (table) { + setTableOptions([ + { + id: table.fullyQualifiedName ?? table.name, + label: table.fullyQualifiedName ?? table.name, + }, + ]); + + return; + } + + setIsTableLoading(true); + try { + const response = await searchQuery({ + query: searchValue ? `*${searchValue}*` : '*', + pageNumber: 1, + pageSize: PAGE_SIZE_LARGE, + searchIndex: SearchIndex.TABLE, + fetchSource: true, + trackTotalHits: true, + }); + + setTablesCache((prev) => { + const newCache = new Map(prev); + response.hits.hits.forEach((hit) => { + const source = hit._source as TableSearchSource; + newCache.set(source.fullyQualifiedName ?? source.name, source); + while (newCache.size > TABLES_CACHE_MAX_SIZE) { + const oldestKey = newCache.keys().next().value; + if (oldestKey === undefined) { + break; + } + newCache.delete(oldestKey); + } + }); + + return newCache; + }); + + setTableOptions( + response.hits.hits.map((hit) => { + const source = hit._source as TableSearchSource; + + return { + id: source.fullyQualifiedName ?? source.name, + label: source.fullyQualifiedName ?? source.name, + }; + }) + ); + } catch { + setTableOptions([]); + } finally { + setIsTableLoading(false); + } + }, + [table] + ); + + // Legacy AsyncSelect fetched options on mount, so the table list (and the + // spec-observable search request) is ready before the field is focused. + useEffect(() => { + fetchTables(); + }, [fetchTables]); + + const debouncedFetchTables = useMemo( + () => debounce(fetchTables, 500), + [fetchTables] + ); + + useEffect( + () => () => { + debouncedFetchTables.cancel(); + }, + [debouncedFetchTables] + ); + + const fetchSelectedTableData = useCallback( + async (tableFqn: string) => { + if (table) { + setSelectedTableData(table); + + return; + } + + try { + const tableData = await getTableDetailsByFQN(tableFqn, { + fields: 'columns,testSuite', + }); + setSelectedTableData(tableData); + } catch { + setSelectedTableData(undefined); + } + }, + [table] + ); + + const fetchTestDefinitions = useCallback( + async (columnType?: string) => { + try { + const serviceType = getServiceTypeForTestDefinition( + selectedTableData ?? table + ); + + const { data } = await getListTestDefinitions({ + limit: PAGE_SIZE_LARGE, + entityType: + selectedTestLevel === TestLevel.COLUMN + ? EntityType.Column + : EntityType.Table, + testPlatform: TestPlatform.OpenMetadata, + supportedDataType: columnType, + supportedService: serviceType, + }); + setTestDefinitions(data); + } catch { + setTestDefinitions([]); + } + }, + [selectedTestLevel, selectedTableData, table] + ); + + useEffect(() => { + if (table?.fullyQualifiedName) { + form.setValue('selectedTable', { + id: table.fullyQualifiedName, + label: table.fullyQualifiedName, + } as never); + } + }, [table, form]); + + useEffect(() => { + if (selectedTableFqn) { + const cachedTableData = tablesCache.get(selectedTableFqn); + if (cachedTableData) { + setSelectedTableData(convertSearchSourceToTable(cachedTableData)); + } else { + fetchSelectedTableData(selectedTableFqn); + } + } else { + setSelectedTableData(table); + } + // Edit mode prefills selectedColumn/dimensionColumns/topDimensions via + // form.reset(buildEditDefaults(...)); the table field is disabled there, + // so this effect only fires from that prefill and must not wipe it. + if (!isEditMode) { + form.setValue('selectedColumn', undefined as never); + form.setValue('dimensionColumns', undefined); + form.setValue('topDimensions', undefined); + } + }, [ + selectedTableFqn, + table, + tablesCache, + fetchSelectedTableData, + form, + isEditMode, + ]); + + useEffect(() => { + // Edit mode prefills dimensionColumns/topDimensions via + // form.reset(buildEditDefaults(...)); the column field is disabled there, + // so this effect only fires from that prefill and must not wipe it. + if (!isEditMode) { + form.setValue('dimensionColumns', undefined); + form.setValue('topDimensions', undefined); + } + }, [selectedColumn, form, isEditMode]); + + useEffect(() => { + if (selectedTestLevel) { + fetchTestDefinitions(); + // Edit mode prefills testTypeId (and selectedColumn) via + // form.reset(buildEditDefaults(...)); testLevel is disabled there, so + // this effect only fires from that prefill and must not wipe it. + // Clearing the derived definition/type here also unmounts the params + // section whenever fetchTestDefinitions' identity changes (it depends on + // selectedTableData, which loads async on edit open) — making the params + // flicker. In edit mode these stay as prefilled and are re-derived by the + // [selectedTestTypeFqn, testDefinitions] effect. + if (!isEditMode) { + form.setValue('testTypeId', undefined as never); + if (selectedTestLevel === TestLevel.TABLE) { + form.setValue('selectedColumn', undefined as never); + } + setSelectedTestDefinition(undefined); + setSelectedTestType(undefined); + setIsCustomQuery(false); + } + } + }, [selectedTestLevel, fetchTestDefinitions, form, isEditMode]); + + useEffect(() => { + if ( + selectedColumn && + selectedTableData && + selectedTestLevel === TestLevel.COLUMN + ) { + const selectedColumnData = selectedTableData.columns?.find( + (column) => column.name === selectedColumn + ); + + if (selectedColumnData?.dataType !== currentColumnType) { + fetchTestDefinitions(selectedColumnData?.dataType); + setCurrentColumnType(selectedColumnData?.dataType); + } + } + }, [ + selectedColumn, + selectedTableData, + currentColumnType, + selectedTestLevel, + fetchTestDefinitions, + ]); + + // Edit mode: render the parameter section from the definition the drawer + // already resolved, so it appears immediately on open rather than waiting on + // the async test-definition list. + useEffect(() => { + if (isEditMode && editDefinition) { + setSelectedTestDefinition(editDefinition); + } + }, [isEditMode, editDefinition]); + + useEffect(() => { + setSelectedTestType(selectedTestTypeFqn); + const testDefinition = testDefinitions.find( + (definition) => definition.fullyQualifiedName === selectedTestTypeFqn + ); + // Only clear the resolved definition in add mode. In edit mode the type is + // fixed and already seeded from `editDefinition`; clearing it here whenever + // the async list momentarily lacks a match unmounts the parameter section + // and makes it flicker. + if (testDefinition) { + setSelectedTestDefinition(testDefinition); + } else if (!isEditMode) { + setSelectedTestDefinition(undefined); + } + }, [selectedTestTypeFqn, testDefinitions, isEditMode]); + + const testTypeOptions: FormSelectItem[] = useMemo( + () => + testDefinitions.map((testDef) => ({ + id: testDef.fullyQualifiedName ?? '', + label: getEntityName(testDef), + supportingText: testDef.description, + })), + [testDefinitions] + ); + + const handleCustomQueryToggle = useCallback(() => { + if (isCustomQuery) { + form.setValue('testTypeId', undefined as never); + setIsCustomQuery(false); + } else { + form.setValue('testTypeId', { + id: TABLE_CUSTOM_SQL_QUERY, + label: TABLE_CUSTOM_SQL_QUERY, + } as never); + setIsCustomQuery(true); + } + }, [isCustomQuery, form]); + + const generateDynamicTestName = useCallback(() => { + const testType = selectedTestDefinition?.name ?? ''; + let finalName = ''; + + if (testType) { + const randomString = cryptoRandomString({ + length: 4, + type: 'alphanumeric', + }); + + let dynamicName = ''; + if (selectedTestLevel === TestLevel.TABLE) { + const tableName = + selectedTableData?.name ?? selectedTableFqn ?? 'table'; + dynamicName = `${tableName}_${testType}_${randomString}`; + } else if (selectedTestLevel === TestLevel.COLUMN && selectedColumn) { + dynamicName = `${selectedColumn}_${testType}_${randomString}`; + } + + finalName = snakeCase(dynamicName); + if (finalName.length > MAX_NAME_LENGTH) { + finalName = snakeCase(`${testType}_${randomString}`); + } + } + + return finalName; + }, [ + selectedTableData, + selectedTableFqn, + selectedColumn, + selectedTestDefinition, + selectedTestLevel, + ]); + + const fetchExistingTestCases = useCallback(async () => { + const entityFqn = selectedTableData?.fullyQualifiedName ?? selectedTableFqn; + if (!hasTestSuite || !entityFqn) { + setExistingTestCases([]); + + return; + } + + try { + const { data } = await getListTestCaseBySearch({ + limit: PAGE_SIZE_LARGE, + entityLink: `<#E::table::${entityFqn}>`, + }); + setExistingTestCases(data.map((testCase) => testCase.name)); + } catch { + setExistingTestCases([]); + } + }, [selectedTableData, selectedTableFqn, hasTestSuite]); + + const checkExistingPipelines = useCallback(async (testSuiteFqn: string) => { + try { + const { paging } = await getIngestionPipelines({ + testSuite: testSuiteFqn, + pipelineType: [PipelineType.TestSuite], + arrQueryFields: ['id'], + limit: 0, + }); + setCanCreatePipeline(paging.total === 0); + } catch { + setCanCreatePipeline(true); + } + }, []); + + const isComputeRowCountFieldVisible = + selectedTestDefinition?.supportsRowLevelPassedFailed ?? false; + + const showParameterFields = + Boolean(selectedTestDefinition?.parameterDefinition) && + useDynamicAssertionValue !== true; + + useEffect(() => { + fetchExistingTestCases(); + }, [fetchExistingTestCases]); + + useEffect(() => { + if (!ingestionPipeline.Create || !selectedTableFqn) { + setCanCreatePipeline(false); + + return; + } + + const testSuiteFqn = + selectedTableData?.testSuite?.fullyQualifiedName ?? + testSuite?.fullyQualifiedName; + + if (testSuiteFqn) { + checkExistingPipelines(testSuiteFqn); + } else { + setCanCreatePipeline(true); + } + }, [ + selectedTableData?.testSuite?.fullyQualifiedName, + testSuite?.fullyQualifiedName, + selectedTableFqn, + checkExistingPipelines, + ingestionPipeline, + ]); + + useEffect(() => { + if ( + !isEditMode && + selectedTableFqn && + selectedTestDefinition && + selectedTestLevel && + !isTestNameManuallyEdited + ) { + const dynamicName = generateDynamicTestName(); + if (dynamicName) { + form.setValue('testName', dynamicName); + } + } + }, [ + isEditMode, + selectedTableFqn, + selectedColumn, + selectedTestDefinition, + selectedTestLevel, + generateDynamicTestName, + isTestNameManuallyEdited, + form, + ]); + + useEffect(() => { + onContextChange?.({ + selectedDefinition: selectedTestDefinition, + selectedTableData, + selectedColumn, + selectedTestLevel, + generateName: generateDynamicTestName, + canCreatePipeline, + isCheckingPermissions, + }); + }, [ + selectedTestDefinition, + selectedTableData, + selectedColumn, + selectedTestLevel, + generateDynamicTestName, + canCreatePipeline, + isCheckingPermissions, + onContextChange, + ]); + + const selectedTableField = { + name: 'selectedTable', + label: t('label.select-entity', { entity: t('label.table') }), + type: FieldTypes.ASYNC_SELECT, + required: true, + rules: { + required: t('label.please-select-entity', { entity: t('label.table') }), + validate: (value: unknown) => { + const fqn = fqnFromSelectItem(value as FormSelectItem | string | null); + if (!fqn || table) { + return true; + } + + return checkTablePermissions(fqn); + }, + }, + id: 'root/table', + doc: fieldDocs.table ?? t('message.doc-field-selected-table'), + placeholder: t('label.select-entity', { entity: t('label.table') }), + props: { + 'data-testid': 'selectedTable', + isDisabled: Boolean(table) || isEditMode, + isLoading: isTableLoading, + options: tableOptions, + onSearchChange: debouncedFetchTables, + onFocus: () => { + if (tableOptions.length === 0) { + fetchTables(); + } + handleActiveField('root/table'); + ensureComboboxMenuOpen( + () => document.getElementById('root/table') as HTMLInputElement + ); + }, + // Legacy antd validated on change: surface the table permission error + // (and gate the scheduler) at selection time, not first at submit. The + // doc panel switches to the selected table's entity summary, like the + // legacy option onclick did. + onItemInserted: () => { + form.trigger('selectedTable'); + handleActiveField('root/selected-entity'); + }, + // Clearing an unauthorized table must clear the stale permission error + // and switch the doc panel back to the generic table section. + onItemCleared: () => { + form.trigger('selectedTable'); + handleActiveField('root/table'); + }, + }, + } as FieldProp; + + const selectedColumnField: FieldProp = { + name: 'selectedColumn', + label: t('label.select-entity', { entity: t('label.column') }), + type: FieldTypes.SELECT, + required: true, + rules: { + required: t('label.please-select-entity', { entity: t('label.column') }), + }, + id: 'root/column', + doc: fieldDocs.column ?? t('message.doc-field-selected-column'), + placeholder: t('label.select-entity', { entity: t('label.column') }), + props: { + 'data-testid': 'selectedColumn', + isDisabled: !selectedTableFqn || isEditMode, + options: columnOptions, + }, + }; + + const dimensionColumnsField: FieldProp = { + name: 'dimensionColumns', + label: t('label.select-entity', { entity: t('label.dimension-plural') }), + type: FieldTypes.MULTI_SELECT, + id: 'root/dimensionColumns', + doc: fieldDocs.dimensionColumns ?? t('message.doc-field-dimension-columns'), + placeholder: t('label.select-entity', { + entity: t('label.dimension-plural'), + }), + props: { + 'data-testid': 'dimensionColumns', + isDisabled: !selectedTableFqn, + multiple: true, + options: dimensionColumnOptions, + }, + }; + + const topDimensionsField = { + name: 'topDimensions', + label: t('label.top-dimension-plural'), + type: FieldTypes.NUMBER, + id: 'root/topDimensions', + doc: fieldDocs.topDimensions ?? t('message.doc-field-top-dimensions'), + placeholder: '5', + props: { + 'data-testid': 'topDimensions', + min: 1, + max: 50, + }, + } as FieldProp; + + const testTypeField: FieldProp = { + name: 'testTypeId', + label: t('label.select-test-type'), + // AUTOCOMPLETE (searchable combobox) rather than a plain SELECT: the test + // definitions load async, and an already-open react-aria Select never + // refreshes its collection when `items` arrive late — leaving the dropdown + // permanently empty if opened too early. Autocomplete re-derives its list on + // every render (and filters as you type), so late options show up. + type: FieldTypes.AUTOCOMPLETE, + required: true, + rules: { + required: t('label.select-test-type'), + }, + id: selectedTestType ? `root/${selectedTestType}` : 'root/testType', + doc: + selectedTestDefinition?.description ?? + fieldDocs.testType ?? + t('message.doc-field-test-type'), + placeholder: t('label.select-test-type'), + props: { + 'data-testid': 'test-type', + isDisabled: isEditMode, + options: testTypeOptions, + onItemInserted: (key?: string | number | null) => + handleActiveField(key ? `root/${key}` : 'root/testType'), + }, + }; + + const dynamicAssertionField = { + name: 'useDynamicAssertion', + label: t('label.dynamic-assertion'), + type: FieldTypes.SWITCH, + required: false, + id: 'root/useDynamicAssertion', + formItemLayout: FormItemLayout.HORIZONTAL, + props: { + 'data-testid': 'use-dynamic-assertion', + }, + } as FieldProp; + + const computeRowCountField = { + name: 'computePassedFailedRowCount', + label: t('label.compute-row-count'), + type: FieldTypes.SWITCH, + required: false, + helperText: t('message.compute-row-count-helper-text'), + helperTextType: HelperTextType.TOOLTIP, + id: 'root/computePassedFailedRowCount', + formItemLayout: FormItemLayout.HORIZONTAL, + props: { + 'data-testid': 'compute-passed-failed-row-count', + }, + } as FieldProp; + + const additionalFields = testCaseClassBase.createFormAdditionalFields( + selectedTestDefinition?.supportsDynamicAssertion ?? false + ); + + const testNameField: FieldProp = { + name: 'testName', + label: t('label.name'), + type: FieldTypes.TEXT, + required: false, + id: 'root/name', + doc: fieldDocs.name ?? t('message.doc-field-test-case-name'), + placeholder: t('message.enter-test-case-name'), + rules: { + pattern: { + value: TEST_CASE_NAME_REGEX, + message: t('message.test-case-name-validation'), + }, + maxLength: { + value: MAX_NAME_LENGTH, + message: t('message.entity-maximum-size', { + entity: t('label.name'), + max: MAX_NAME_LENGTH, + }), + }, + validate: (value: string) => { + let result: string | boolean = true; + // Name is immutable in edit mode, so the uniqueness check must be + // skipped — the test case's own name would otherwise flag a false + // "already exists" error and silently block the update submit. + if (!isEditMode && value && existingTestCases.includes(value)) { + result = t('message.entity-already-exists', { + entity: t('label.name'), + }); + } + + return result; + }, + }, + props: { + 'data-testid': 'test-case-name', + isDisabled: isEditMode, + onChange: () => setIsTestNameManuallyEdited(true), + }, + }; + + const displayNameField: FieldProp = { + name: 'displayName', + label: t('label.display-name'), + type: FieldTypes.TEXT, + required: false, + id: 'root/displayName', + props: { + 'data-testid': 'display-name', + }, + }; + + const testLevelDoc = useFieldDoc({ + name: 'testLevel', + label: t('message.select-test-level'), + doc: fieldDocs.testLevel ?? t('message.doc-field-test-level'), + }); + + const tagsDoc = useFieldDoc({ + name: 'tags', + label: t('label.tag-plural'), + doc: fieldDocs.tags ?? t('message.doc-field-tags'), + }); + + const glossaryTermsDoc = useFieldDoc({ + name: 'glossaryTerms', + label: t('label.glossary-term-plural'), + doc: fieldDocs.glossaryTerms ?? t('message.doc-field-glossary-terms'), + }); + + const pipelineDoc = useFieldDoc({ + name: 'pipeline', + label: t('label.pipeline'), + doc: fieldDocs.createPipeline ?? t('message.doc-field-pipeline'), + }); + const descriptionDoc = useFieldDoc({ + name: 'description', + label: t('label.description'), + doc: fieldDocs.description ?? t('message.doc-field-description'), + }); + + // Seed the hint panel with the first field actually on screen so it isn't + // empty on open and never points at a field the current mode hides (edit + // hides the test-level card; params-only edit hides the table/column + // selectors). A field's doc registers even when the field is not rendered + // (the useFieldDoc hooks are called unconditionally), so query the DOM for + // the first rendered `data-field-doc` anchor rather than the registry. + // Focusing any field replaces it as usual. + const { setActive: setActiveFieldDoc, entries: fieldDocEntries } = + useFieldDocRegistry(); + const formBodyRef = useRef(null); + const hasSeededFieldDocRef = useRef(false); + useEffect(() => { + if (hasSeededFieldDocRef.current) { + return; + } + const firstFieldName = formBodyRef.current + ?.querySelector('[data-field-doc]') + ?.getAttribute('data-field-doc'); + if (firstFieldName) { + setActiveFieldDoc(firstFieldName); + hasSeededFieldDocRef.current = true; + } + }, [fieldDocEntries, setActiveFieldDoc]); + + return ( +
+ {errorMessage && ( +
+ + {errorMessage} + +
+ )} + + {!showOnlyParameter && ( +
+ {!isEditMode && ( +
+ + {({ field }) => ( + <> + + { + field.onChange(value); + handleActiveField('root/testLevel'); + }} + /> + + )} + +
+ )} + + {getField(selectedTableField)} + + {selectedTestLevel === TestLevel.COLUMN && + getField(selectedColumnField)} + + {(testLevelFieldValue === TestLevel.COLUMN_DIMENSION || + (isEditMode && selectedTestLevel === TestLevel.COLUMN)) && + getField(dimensionColumnsField)} + + {(testLevelFieldValue === TestLevel.COLUMN_DIMENSION || + (isEditMode && selectedTestLevel === TestLevel.COLUMN)) && + getField(topDimensionsField)} +
+ )} + +
+ {!isEditMode && selectedTestLevel === TestLevel.TABLE && ( +
+ {isCustomQuery && } + +
+ )} + + {!isCustomQuery && getField(testTypeField)} + + {additionalFields.length > 0 + ? additionalFields.map((field) => ( +
{getField(field)}
+ )) + : selectedTestDefinition?.supportsDynamicAssertion && + getField(dynamicAssertionField)} + + {showParameterFields && selectedTestDefinition && ( +
+ handleActiveField( + selectedTestType ? `root/${selectedTestType}` : 'root/testType' + ) + }> + +
+ )} + + {isComputeRowCountFieldVisible && getField(computeRowCountField)} +
+ + {!showOnlyParameter && ( +
+ {getField(testNameField)} + + {isEditMode && getField(displayNameField)} + + + {({ field }) => ( +
+ + handleActiveField('root/description')} + onTextChange={field.onChange} + /> +
+ )} +
+ + + {({ field }) => ( +
+ +
+ )} +
+ + + {({ field }) => ( +
+ +
+ )} +
+
+ )} + + {!showOnlyParameter && + !isEditMode && + selectedTableFqn && + canCreatePipeline && ( +
+ +
+ )} +
+ ); +}; + +export default TestCaseFormBody; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormDrawer.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormDrawer.test.tsx new file mode 100644 index 000000000000..cb8a78eca269 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormDrawer.test.tsx @@ -0,0 +1,1068 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + FieldProp, + FieldTypes, + getField, +} from '@openmetadata/ui-core-components'; +import { + act, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/react'; +import { applyPatch, type Operation } from 'fast-json-patch'; +import { useState } from 'react'; +import { Table } from '../../../../generated/entity/data/table'; +import { TestCase } from '../../../../generated/tests/testCase'; +import { + TestDataType, + TestDefinition, +} from '../../../../generated/tests/testDefinition'; +import { + addIngestionPipeline, + deployIngestionPipelineById, +} from '../../../../rest/ingestionPipelineAPI'; +import { + createTestCase, + getTestDefinitionById, + updateTestCaseById, +} from '../../../../rest/testAPI'; +import { createUpdatedTestCasePatch } from '../../../../utils/DataQuality/DataQualityPureUtils'; +import TestCaseFormDrawer from './TestCaseFormDrawer'; +import { + TestCaseFormContext, + TestCaseFormDrawerProps, + TestLevel, +} from './TestCaseFormV1.interface'; +import { buildEditDefaults } from './transformTestCaseFormData'; + +const mockGetResourceLimit = jest.fn().mockResolvedValue(undefined); + +// The real doc markdown Task 7 authored for the test-type field. The mocked +// TestCaseFormBody renders a real doc-bearing field via getField so the +// drawer's showFieldDocs/renderFieldDoc wiring is exercised end-to-end. +const TEST_TYPE_DOC = + 'The kind of validation to run. Choose a table- or column-level test; the parameters below adapt to your selection.'; + +jest.mock('../../../../rest/testAPI', () => ({ + createTestCase: jest.fn(), + getTestDefinitionById: jest.fn(), + updateTestCaseById: jest.fn(), +})); + +jest.mock('../../../../utils/DataQuality/DataQualityPureUtils', () => ({ + ...jest.requireActual('../../../../utils/DataQuality/DataQualityPureUtils'), + createUpdatedTestCasePatch: jest.fn(), +})); + +jest.mock('../../../../rest/ingestionPipelineAPI', () => ({ + addIngestionPipeline: jest.fn().mockResolvedValue({ id: 'pipeline-id' }), + deployIngestionPipelineById: jest.fn().mockResolvedValue({}), +})); + +jest.mock( + '../../../../context/AirflowStatusProvider/AirflowStatusProvider', + () => ({ + useAirflowStatus: jest.fn().mockReturnValue({ isAirflowAvailable: true }), + }) +); + +jest.mock('../../../../context/LimitsProvider/useLimitsStore', () => ({ + useLimitStore: jest.fn().mockReturnValue({ + config: {}, + getResourceLimit: (...args: unknown[]) => mockGetResourceLimit(...args), + }), +})); + +jest.mock('../../../../context/PermissionProvider/PermissionProvider', () => ({ + usePermissionProvider: () => ({ + permissions: { ingestionPipeline: { Create: true, EditAll: true } }, + }), +})); + +jest.mock('../../../../utils/ToastUtils', () => ({ + showSuccessToast: jest.fn(), + showErrorToast: jest.fn(), +})); + +jest.mock('./transformTestCaseFormData', () => ({ + // `normalizeFormValuesForPayload` is the shared normalizer `handleEditSubmit` + // (the code under test in the regression suite below) calls directly; it + // must stay real so the edit-submit patch reflects genuine normalization, + // not a stub. + ...jest.requireActual('./transformTestCaseFormData'), + transformTestCaseFormData: jest + .fn() + .mockReturnValue({ name: 'transformed-test-case' }), + buildTestSuitePipelinePayload: jest + .fn() + .mockReturnValue({ name: 'pipeline-payload' }), + buildEditDefaults: jest.fn().mockReturnValue({ + testName: 'existing-test-case', + displayName: 'Existing Test Case', + params: { value: '10' }, + }), +})); + +const mockContext: TestCaseFormContext = { + selectedDefinition: undefined, + selectedTableData: undefined, + selectedColumn: undefined, + selectedTestLevel: TestLevel.TABLE, + generateName: () => 'generated-name', + canCreatePipeline: false, +}; + +const mockContextWithPipeline: TestCaseFormContext = { + selectedDefinition: undefined, + selectedTableData: { + id: 'table-id', + name: 'table', + fullyQualifiedName: 'service.db.schema.table', + } as Table, + selectedColumn: undefined, + selectedTestLevel: TestLevel.TABLE, + generateName: () => 'generated-name', + canCreatePipeline: true, +}; + +let emitContextFn: ((ctx: TestCaseFormContext) => void) | undefined; +let emitActiveFieldFn: ((fieldId: string) => void) | undefined; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +let lastFormBodyProps: Record | undefined; + +jest.mock('./TestCaseFormBody', () => + jest.fn().mockImplementation( + ({ + form, + onContextChange, + onActiveFieldChange, + errorMessage, + isEditMode, + showOnlyParameter, + }: // eslint-disable-next-line @typescript-eslint/no-explicit-any + any) => { + emitContextFn = onContextChange; + emitActiveFieldFn = onActiveFieldChange; + lastFormBodyProps = { isEditMode, showOnlyParameter }; + + const testTypeField: FieldProp = { + name: 'testTypeId', + label: 'Test Type', + type: FieldTypes.TEXT, + required: false, + id: 'root/testType', + doc: TEST_TYPE_DOC, + props: { 'data-testid': 'test-type' }, + }; + + const testNameValue = form?.watch ? form.watch('testName') : undefined; + const displayNameValue = form?.watch + ? form.watch('displayName') + : undefined; + const paramsValue = form?.watch ? form.watch('params') : undefined; + + return ( +
+ {!showOnlyParameter && ( + undefined} + /> + )} + {!showOnlyParameter && isEditMode && ( + undefined} + /> + )} + {!showOnlyParameter && ( +
select-table-card
+ )} +
+ {getField(testTypeField)} +
+ {paramsValue ? JSON.stringify(paramsValue) : ''} +
+
+ {errorMessage &&
{errorMessage}
} + + + +
+ ); + } + ) +); + +jest.mock('../../../common/ServiceDocPanel/ServiceDocPanel', () => + jest + .fn() + .mockImplementation(() => ( +
doc-panel
+ )) +); + +// RichTextEditorPreviewerV1 wraps a lazy BlockEditor (TipTap) that does not +// render its content synchronously in jsdom. Mock it to render the markdown as +// plain text so the field-doc popover assertion inspects the real doc string +// that renderFieldDoc receives. +jest.mock( + '../../../common/RichTextEditor/RichTextEditorPreviewerV1', + () => + function MockRichTextEditorPreviewerV1({ markdown }: { markdown: string }) { + return
{markdown}
; + } +); + +const mockCreateTestCase = createTestCase as jest.Mock; +const mockAddIngestionPipeline = addIngestionPipeline as jest.Mock; +const mockDeployIngestionPipelineById = + deployIngestionPipelineById as jest.Mock; + +const mockTable = { + id: 'table-id', + name: 'table', + fullyQualifiedName: 'service.db.schema.table', +} as Table; + +const renderDrawer = (props: Partial = {}) => + render( + + ); + +describe('TestCaseFormDrawer', () => { + beforeEach(() => { + jest.clearAllMocks(); + emitContextFn = undefined; + emitActiveFieldFn = undefined; + mockCreateTestCase.mockResolvedValue({ + name: 'transformed-test-case', + id: 'created-id', + }); + }); + + it('should render the drawer with the form body when open is true', async () => { + renderDrawer(); + + expect( + await screen.findByTestId('test-case-form-body') + ).toBeInTheDocument(); + expect(screen.getByText('label.add-entity')).toBeInTheDocument(); + }); + + it('should create test case and call onFormSubmit then onClose on submit', async () => { + const onFormSubmit = jest.fn(); + const onClose = jest.fn(); + renderDrawer({ onFormSubmit, onClose }); + + const submitBtn = await screen.findByTestId('create-btn'); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(mockCreateTestCase).toHaveBeenCalledWith({ + name: 'transformed-test-case', + }); + }); + + await waitFor(() => { + expect(onFormSubmit).toHaveBeenCalledWith({ + name: 'transformed-test-case', + id: 'created-id', + }); + }); + + await waitFor(() => { + expect(onClose).toHaveBeenCalled(); + }); + }); + + it('should call onClose exactly once on a successful submit', async () => { + const onClose = jest.fn(); + renderDrawer({ onClose }); + + const submitBtn = await screen.findByTestId('create-btn'); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(onClose).toHaveBeenCalledTimes(1); + }); + }); + + it('should call onClose exactly once when the cancel button is clicked', async () => { + const onClose = jest.fn(); + renderDrawer({ onClose }); + + const cancelBtn = await screen.findByTestId('cancel-btn'); + + await act(async () => { + fireEvent.click(cancelBtn); + }); + + expect(onClose).toHaveBeenCalledTimes(1); + }); + + it('should call onClose exactly once when a consumer flips open to false on cancel', async () => { + const onCloseSpy = jest.fn(); + + const Consumer = () => { + const [open, setOpen] = useState(true); + + return ( + { + onCloseSpy(); + setOpen(false); + }} + /> + ); + }; + + render(); + + const cancelBtn = await screen.findByTestId('cancel-btn'); + + await act(async () => { + fireEvent.click(cancelBtn); + }); + + expect(onCloseSpy).toHaveBeenCalledTimes(1); + }); + + it('should keep the drawer open and not call onClose when createTestCase rejects', async () => { + mockCreateTestCase.mockRejectedValueOnce({ + response: { data: { message: 'boom' } }, + }); + const onClose = jest.fn(); + const onFormSubmit = jest.fn(); + renderDrawer({ onClose, onFormSubmit }); + + const submitBtn = await screen.findByTestId('create-btn'); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(screen.getByText('boom')).toBeInTheDocument(); + }); + + expect(onClose).not.toHaveBeenCalled(); + expect(onFormSubmit).not.toHaveBeenCalled(); + }); + + it('should render the doc panel in classic variant', async () => { + renderDrawer({ variant: 'drawer' }); + + expect(await screen.findByTestId('service-doc-panel')).toBeInTheDocument(); + }); + + it('should not render the service doc panel in ai variant', async () => { + renderDrawer({ variant: 'modal' }); + + expect( + await screen.findByTestId('test-case-form-body') + ).toBeInTheDocument(); + // The AI variant replaces the ServiceDocPanel hint with the per-field + // documentation popover (gated by the Show Hint toggle). + expect(screen.queryByTestId('service-doc-panel')).not.toBeInTheDocument(); + }); + + it('should call addIngestionPipeline and deployIngestionPipelineById when canCreatePipeline is true', async () => { + const mockTestSuite = { id: 'suite-id', name: 'test-suite' }; + mockCreateTestCase.mockResolvedValue({ + name: 'transformed-test-case', + id: 'created-id', + testSuite: mockTestSuite, + }); + + const onFormSubmit = jest.fn(); + const onClose = jest.fn(); + renderDrawer({ onFormSubmit, onClose }); + + await screen.findByTestId('test-case-form-body'); + + // Emit the pipeline-enabled context directly via the captured callback + // before interacting with UI, to avoid triggering a re-render mid-test + await act(async () => { + emitContextFn?.(mockContextWithPipeline); + }); + + const submitBtn = await screen.findByTestId('create-btn'); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(mockCreateTestCase).toHaveBeenCalledWith({ + name: 'transformed-test-case', + }); + }); + + await waitFor(() => { + expect(mockAddIngestionPipeline).toHaveBeenCalledWith({ + name: 'pipeline-payload', + }); + }); + + await waitFor(() => { + expect(mockDeployIngestionPipelineById).toHaveBeenCalledWith( + 'pipeline-id' + ); + }); + + await waitFor(() => { + expect(onFormSubmit).toHaveBeenCalled(); + }); + + await waitFor(() => { + expect(onClose).toHaveBeenCalled(); + }); + }); + + it('should forward onActiveFieldChange from body to the prop callback', async () => { + const onActiveFieldChange = jest.fn(); + renderDrawer({ onActiveFieldChange }); + + await screen.findByTestId('test-case-form-body'); + + await act(async () => { + emitActiveFieldFn?.('testName'); + }); + + expect(onActiveFieldChange).toHaveBeenCalledWith('testName'); + }); + + it('should not throw when onActiveFieldChange prop is not provided', async () => { + renderDrawer(); + + await screen.findByTestId('test-case-form-body'); + + await expect( + act(async () => { + emitActiveFieldFn?.('testName'); + }) + ).resolves.not.toThrow(); + }); + + describe('ai variant', () => { + it('should render a centered modal (role=dialog) instead of the slideout drawer when open', async () => { + renderDrawer({ variant: 'modal' }); + + expect(await screen.findByRole('dialog')).toBeInTheDocument(); + expect( + await screen.findByTestId('test-case-form-body') + ).toBeInTheDocument(); + // The AI modal exposes the same footer test ids as the classic drawer so + // the shared submit helpers drive either variant. + expect(screen.getByTestId('create-btn')).toBeInTheDocument(); + expect(screen.getByTestId('cancel-btn')).toBeInTheDocument(); + // But not the slideout drawer chrome. + expect(screen.queryByTestId('drawer-title')).not.toBeInTheDocument(); + }); + + it('should render the default ai header title', async () => { + renderDrawer({ variant: 'modal' }); + + await screen.findByRole('dialog'); + + expect(screen.getByText('label.add-entity')).toBeInTheDocument(); + }); + + it('should call onClose exactly once when the cancel button is clicked', async () => { + const onClose = jest.fn(); + renderDrawer({ variant: 'modal', onClose }); + + await screen.findByRole('dialog'); + + await act(async () => { + fireEvent.click(screen.getByRole('button', { name: 'label.cancel' })); + }); + + expect(onClose).toHaveBeenCalledTimes(1); + }); + + it('should call onClose exactly once when the X close button is clicked', async () => { + const onClose = jest.fn(); + renderDrawer({ variant: 'modal', onClose }); + + await screen.findByRole('dialog'); + + await act(async () => { + fireEvent.click(screen.getByRole('button', { name: 'Close' })); + }); + + expect(onClose).toHaveBeenCalledTimes(1); + }); + + it('should create the test case and call onClose once on a successful submit', async () => { + const onFormSubmit = jest.fn(); + const onClose = jest.fn(); + renderDrawer({ variant: 'modal', onFormSubmit, onClose }); + + await screen.findByRole('dialog'); + + const submitBtn = screen.getByRole('button', { name: 'label.create' }); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(mockCreateTestCase).toHaveBeenCalledWith({ + name: 'transformed-test-case', + }); + }); + + await waitFor(() => { + expect(onFormSubmit).toHaveBeenCalled(); + }); + + await waitFor(() => { + expect(onClose).toHaveBeenCalledTimes(1); + }); + }); + + it('should keep the modal open and show the inline error when createTestCase rejects', async () => { + mockCreateTestCase.mockRejectedValueOnce({ + response: { data: { message: 'boom' } }, + }); + const onClose = jest.fn(); + renderDrawer({ variant: 'modal', onClose }); + + await screen.findByRole('dialog'); + + await act(async () => { + fireEvent.click(screen.getByRole('button', { name: 'label.create' })); + }); + + await waitFor(() => { + expect(screen.getByTestId('form-error')).toHaveTextContent('boom'); + }); + + expect(onClose).not.toHaveBeenCalled(); + }); + + it('gates the field doc popover behind the Show Hint toggle', async () => { + renderDrawer({ variant: 'modal' }); + + const testType = await screen.findByLabelText(/test type/i); + + // Show Hint is on by default: focusing a field shows its doc popover. + await act(async () => { + testType.focus(); + }); + + expect( + await screen.findByText(/kind of validation to run/i) + ).toBeInTheDocument(); + + // Toggling Show Hint off removes the popover. + await act(async () => { + fireEvent.click( + screen.getByRole('switch', { name: 'label.show-hint' }) + ); + }); + + expect( + screen.queryByText(/kind of validation to run/i) + ).not.toBeInTheDocument(); + }); + + it('shows the field doc popover in the AI variant on focus', async () => { + renderDrawer({ variant: 'modal' }); + + const testType = await screen.findByLabelText(/test type/i); + + await act(async () => { + testType.focus(); + }); + + expect( + await screen.findByText(/kind of validation to run/i) + ).toBeInTheDocument(); + }); + }); + + it('does not show the field doc popover in the classic variant on focus', async () => { + renderDrawer({ variant: 'drawer' }); + + const testType = await screen.findByLabelText(/test type/i); + + await act(async () => { + testType.focus(); + }); + + expect( + screen.queryByText(/kind of validation to run/i) + ).not.toBeInTheDocument(); + }); + + describe('edit mode', () => { + const mockTestDefinition = { + id: 'def-1', + name: 'tableRowCountToEqual', + fullyQualifiedName: 'tableRowCountToEqual', + supportsRowLevelPassedFailed: false, + } as TestDefinition; + + const mockTestCase = { + id: 'test-case-id', + name: 'existing-test-case', + displayName: 'Existing Test Case', + entityLink: '<#E::table::service.db.schema.table>', + testDefinition: { + id: 'def-1', + fullyQualifiedName: 'tableRowCountToEqual', + }, + parameterValues: [{ name: 'value', value: '10' }], + tags: [], + } as unknown as TestCase; + + const mockGetTestDefinitionById = getTestDefinitionById as jest.Mock; + const mockUpdateTestCaseById = updateTestCaseById as jest.Mock; + const mockCreateUpdatedTestCasePatch = + createUpdatedTestCasePatch as jest.Mock; + + beforeEach(() => { + mockGetTestDefinitionById.mockResolvedValue(mockTestDefinition); + mockUpdateTestCaseById.mockResolvedValue(mockTestCase); + mockCreateUpdatedTestCasePatch.mockReturnValue([ + { op: 'replace', path: '/displayName', value: 'Updated Name' }, + ]); + }); + + it('prefills the form with the test case name (disabled) and display name', async () => { + renderDrawer({ testCase: mockTestCase }); + + await waitFor(() => { + expect(mockGetTestDefinitionById).toHaveBeenCalledWith('def-1'); + }); + + const nameInput = await screen.findByTestId('test-case-name'); + const displayNameInput = await screen.findByTestId('display-name'); + + await waitFor(() => { + expect(nameInput).toHaveValue('existing-test-case'); + }); + + expect(nameInput).toBeDisabled(); + expect(displayNameInput).toBeInTheDocument(); + + await waitFor(() => { + expect(screen.getByTestId('params-value')).toHaveTextContent('value'); + }); + }); + + it('submits an update patch via updateTestCaseById and fires onUpdate', async () => { + const onUpdate = jest.fn(); + const onClose = jest.fn(); + renderDrawer({ testCase: mockTestCase, onUpdate, onClose }); + + await waitFor(() => { + expect(screen.getByTestId('test-case-name')).toHaveValue( + 'existing-test-case' + ); + }); + + const submitBtn = await screen.findByTestId('create-btn'); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(mockUpdateTestCaseById).toHaveBeenCalledWith('test-case-id', [ + { op: 'replace', path: '/displayName', value: 'Updated Name' }, + ]); + }); + + await waitFor(() => { + expect(onUpdate).toHaveBeenCalledWith(mockTestCase); + }); + + await waitFor(() => { + expect(onClose).toHaveBeenCalled(); + }); + }); + + it('does not call updateTestCaseById and closes the drawer when the patch is empty', async () => { + mockCreateUpdatedTestCasePatch.mockReturnValue([]); + const onClose = jest.fn(); + const onUpdate = jest.fn(); + renderDrawer({ testCase: mockTestCase, onClose, onUpdate }); + + await waitFor(() => { + expect(screen.getByTestId('test-case-name')).toHaveValue( + 'existing-test-case' + ); + }); + + const submitBtn = await screen.findByTestId('create-btn'); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(onClose).toHaveBeenCalled(); + }); + + expect(mockUpdateTestCaseById).not.toHaveBeenCalled(); + expect(onUpdate).not.toHaveBeenCalled(); + }); + + it('renders only the params card when showOnlyParameter is true', async () => { + renderDrawer({ testCase: mockTestCase, showOnlyParameter: true }); + + await waitFor(() => { + expect(mockGetTestDefinitionById).toHaveBeenCalled(); + }); + + expect(await screen.findByTestId('test-type-card')).toBeInTheDocument(); + expect(screen.queryByTestId('select-table-card')).not.toBeInTheDocument(); + expect(screen.queryByTestId('test-case-name')).not.toBeInTheDocument(); + expect(lastFormBodyProps?.showOnlyParameter).toBe(true); + }); + + it('renders the edit title with the test case name', async () => { + renderDrawer({ testCase: mockTestCase }); + + expect(await screen.findByText('label.edit-entity')).toBeInTheDocument(); + }); + }); +}); + +describe('edit submit uses the directly-fetched definition (Finding 1 regression)', () => { + // createUpdatedTestCasePatch is mocked module-wide above; pull the real + // implementation here so a genuine JSON patch is produced and the + // Array-param serialization bug is actually observable end-to-end. + const { createUpdatedTestCasePatch: realCreateUpdatedTestCasePatch } = + jest.requireActual('../../../../utils/DataQuality/DataQualityPureUtils'); + + const mockGetTestDefinitionById = getTestDefinitionById as jest.Mock; + const mockUpdateTestCaseById = updateTestCaseById as jest.Mock; + const mockCreateUpdatedTestCasePatch = + createUpdatedTestCasePatch as jest.Mock; + const mockBuildEditDefaults = buildEditDefaults as jest.Mock; + + const arrayParamDefinition = { + id: 'def-array', + name: 'columnValuesToBeInSet', + fullyQualifiedName: 'columnValuesToBeInSet', + supportsRowLevelPassedFailed: false, + parameterDefinition: [ + { name: 'allowedValues', dataType: TestDataType.Array }, + ], + } as TestDefinition; + + const arrayParamTestCase = { + id: 'test-case-id', + name: 'existing-test-case', + displayName: 'Existing Test Case', + entityLink: '<#E::table::service.db.schema.table>', + testDefinition: { + id: 'def-array', + fullyQualifiedName: 'columnValuesToBeInSet', + }, + parameterValues: [ + { name: 'allowedValues', value: JSON.stringify(['a', 'b']) }, + ], + tags: [], + } as unknown as TestCase; + + beforeEach(() => { + mockGetTestDefinitionById.mockResolvedValue(arrayParamDefinition); + mockUpdateTestCaseById.mockResolvedValue(arrayParamTestCase); + // Real implementation, restored per-test since the top-level mock + // factory replaces createUpdatedTestCasePatch with a jest.fn(). + mockCreateUpdatedTestCasePatch.mockImplementation( + realCreateUpdatedTestCasePatch + ); + // Mirrors what the real buildEditDefaults produces for an Array-type + // param (see transformTestCaseFormData.buildEditParams): a + // `{ value: string }[]` shape that createTestCaseParameters must + // re-serialize using the test definition's parameterDefinition. The + // values differ from the stored testCase.parameterValues (['a','b']) + // so the edit produces a genuine, non-empty patch. + mockBuildEditDefaults.mockReturnValue({ + testName: arrayParamTestCase.name, + displayName: arrayParamTestCase.displayName, + params: { allowedValues: [{ value: 'c' }, { value: 'd' }] }, + }); + }); + + it('serializes an Array-type param correctly even when TestCaseFormBody reports selectedDefinition as undefined (filter-miss/race)', async () => { + renderDrawer({ testCase: arrayParamTestCase }); + + await waitFor(() => { + expect(mockGetTestDefinitionById).toHaveBeenCalledWith('def-array'); + }); + + // Simulate TestCaseFormBody resolving its filtered definitions list + // without the current test's definition (deprecated/mismatched, or a + // race where submit happens before the list loads). + await act(async () => { + emitContextFn?.({ + selectedDefinition: undefined, + selectedTableData: undefined, + selectedColumn: undefined, + selectedTestLevel: TestLevel.TABLE, + generateName: () => 'generated-name', + canCreatePipeline: false, + }); + }); + + const submitBtn = await screen.findByTestId('create-btn'); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(mockUpdateTestCaseById).toHaveBeenCalled(); + }); + + const [, patch] = mockUpdateTestCaseById.mock.calls[0] as [ + string, + Array<{ op: string; path: string; value?: unknown }> + ]; + + const paramsValueOp = patch.find((op) => + op.path.startsWith('/parameterValues') + ); + + expect(paramsValueOp).toBeDefined(); + + // The allowedValues param must be serialized as a JSON-stringified array + // (matching TestCaseParameterValue.value: string), not the raw + // `{ value: string }[]` form-field shape. + expect(typeof paramsValueOp?.value).toBe('string'); + expect(JSON.parse(paramsValueOp?.value as string)).toEqual(['c', 'd']); + }); +}); + +describe('edit submit normalizes FormSelectItem-shaped prefill values (patch corruption regression)', () => { + // createUpdatedTestCasePatch is mocked module-wide above; pull the real + // implementation so the patch actually reflects whatever shape + // handleEditSubmit hands it — a raw FormSelectItem/dotted-key/object-array + // would otherwise be masked by the jest.fn() mock. + const { createUpdatedTestCasePatch: realCreateUpdatedTestCasePatch } = + jest.requireActual('../../../../utils/DataQuality/DataQualityPureUtils'); + + const mockGetTestDefinitionById = getTestDefinitionById as jest.Mock; + const mockUpdateTestCaseById = updateTestCaseById as jest.Mock; + const mockCreateUpdatedTestCasePatch = + createUpdatedTestCasePatch as jest.Mock; + const mockBuildEditDefaults = buildEditDefaults as jest.Mock; + + // A `column` param is classified 'select' by `isSelectParam` (param.name + // === 'column'), so edit prefill stores it as a FormSelectItem — see + // `buildEditParamEntry` in transformTestCaseFormData.ts. + const selectParamDefinition = { + id: 'def-select', + name: 'columnValuesToBeInSet', + fullyQualifiedName: 'columnValuesToBeInSet', + supportsRowLevelPassedFailed: false, + parameterDefinition: [ + { name: 'column', dataType: TestDataType.String }, + { name: 'partition.interval', dataType: TestDataType.String }, + { name: 'allowedValues', dataType: TestDataType.Array }, + ], + } as TestDefinition; + + const selectParamTestCase = { + id: 'test-case-id', + name: 'existing-test-case', + displayName: 'Existing Test Case', + entityLink: '<#E::table::service.db.schema.table::columns::col_x>', + testDefinition: { + id: 'def-select', + fullyQualifiedName: 'columnValuesToBeInSet', + }, + parameterValues: [ + { name: 'column', value: 'col_x' }, + { name: 'partition.interval', value: '15' }, + { name: 'allowedValues', value: JSON.stringify(['a', 'b']) }, + ], + dimensionColumns: ['col_b'], + tags: [], + } as unknown as TestCase; + + beforeEach(() => { + mockGetTestDefinitionById.mockResolvedValue(selectParamDefinition); + mockUpdateTestCaseById.mockResolvedValue(selectParamTestCase); + mockCreateUpdatedTestCasePatch.mockImplementation( + realCreateUpdatedTestCasePatch + ); + // Mirrors the real edit-prefill shape (`buildEditDefaults` / + // `buildEditParamEntry`): a select param prefills as a FormSelectItem, a + // dotted param name prefills sanitized (`___`), and `dimensionColumns` + // prefills as FormSelectItem[] — all exactly as they'd render in the UI. + mockBuildEditDefaults.mockReturnValue({ + testName: selectParamTestCase.name, + displayName: selectParamTestCase.displayName, + params: { + column: { id: 'col_x', label: 'col_x' }, + partition___interval: '30', + allowedValues: [ + { value: { id: 'a', label: 'a' } }, + { value: { id: 'b', label: 'b' } }, + ], + }, + dimensionColumns: [{ id: 'col_a', label: 'col_a' }], + }); + }); + + it('emits ids/dotted-keys/string[] in the patch, not raw FormSelectItem shapes', async () => { + renderDrawer({ testCase: selectParamTestCase }); + + await waitFor(() => { + expect(mockGetTestDefinitionById).toHaveBeenCalledWith('def-select'); + }); + + const submitBtn = await screen.findByTestId('create-btn'); + + await act(async () => { + fireEvent.click(submitBtn); + }); + + await waitFor(() => { + expect(mockUpdateTestCaseById).toHaveBeenCalled(); + }); + + const [, patch] = mockUpdateTestCaseById.mock.calls[0] as [ + string, + Operation[] + ]; + + // Reconstruct the patched entity instead of asserting on individual ops + // directly — fast-json-patch may emit either a whole-array replace or + // per-index replaces depending on how many elements changed, and the + // assertion should hold either way. + const patched = applyPatch(structuredClone(selectParamTestCase), patch) + .newDocument as unknown as TestCase & { + parameterValues: Array<{ name: string; value: string }>; + }; + + const columnParam = patched.parameterValues.find( + (p) => p.name === 'column' + ); + + // Must be the raw string id, not `{ id: 'col_x', label: 'col_x' }`. + expect(columnParam?.value).toBe('col_x'); + + const dottedParam = patched.parameterValues.find( + (p) => p.name === 'partition.interval' + ); + + // The sanitized `___` key must be restored to its dotted form. + expect(dottedParam).toBeDefined(); + expect(dottedParam?.value).toBe('30'); + expect( + patched.parameterValues.some((p) => p.name === 'partition___interval') + ).toBe(false); + + const allowedValuesParam = patched.parameterValues.find( + (p) => p.name === 'allowedValues' + ); + + // Array param values must unwrap the nested FormSelectItem to its id. + expect(JSON.parse(allowedValuesParam?.value as string)).toEqual(['a', 'b']); + + // dimensionColumns must be a plain string[], not FormSelectItem[]. + expect(patched.dimensionColumns).toEqual(['col_a']); + }); +}); + +describe('createUpdatedTestCasePatch (phantom tags op)', () => { + // createUpdatedTestCasePatch is mocked module-wide above for the drawer + // tests; pull the real implementation to verify the tags-diffing edge case + // that used to live in EditTestCaseModal(V1)'s tests. + const { createUpdatedTestCasePatch: realCreateUpdatedTestCasePatch } = + jest.requireActual('../../../../utils/DataQuality/DataQualityPureUtils'); + + const baseTestCase = { + id: 'test-case-id', + name: 'existing-test-case', + displayName: 'Existing Test Case', + entityLink: '<#E::table::service.db.schema.table>', + tags: undefined, + } as unknown as TestCase; + + it('does not emit a phantom /tags op when editing display name of a tagless test case', () => { + const patch = realCreateUpdatedTestCasePatch({ + testCase: baseTestCase, + value: { displayName: 'Updated Display Name' }, + createTestCaseObject: {}, + isComputeRowCountFieldVisible: false, + }); + + expect(patch).not.toContainEqual( + expect.objectContaining({ path: '/tags' }) + ); + expect(patch).toContainEqual({ + op: 'replace', + path: '/displayName', + value: 'Updated Display Name', + }); + }); + + it('emits a /tags replace op when tags actually change', () => { + const patch = realCreateUpdatedTestCasePatch({ + testCase: baseTestCase, + value: { + displayName: 'Existing Test Case', + tags: [ + { + tagFQN: 'PII.Sensitive', + source: 'Classification', + labelType: 'Manual', + state: 'Confirmed', + }, + ], + }, + createTestCaseObject: {}, + isComputeRowCountFieldVisible: false, + }); + + expect(patch).toContainEqual(expect.objectContaining({ path: '/tags' })); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormDrawer.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormDrawer.tsx new file mode 100644 index 000000000000..69f9a783b5fe --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormDrawer.tsx @@ -0,0 +1,506 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + Box, + HookForm, + Toggle, + Typography, +} from '@openmetadata/ui-core-components'; +import { Lightbulb05 } from '@untitledui/icons'; +import { AxiosError } from 'axios'; +import { isUndefined } from 'lodash'; +import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { useForm } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; +import { DEFAULT_SCHEDULE_CRON_DAILY } from '../../../../constants/Schedular.constants'; +import { + OPEN_METADATA, + TEST_CASE_FORM, +} from '../../../../constants/service-guide.constant'; +import { useAirflowStatus } from '../../../../context/AirflowStatusProvider/AirflowStatusProvider'; +import { useLimitStore } from '../../../../context/LimitsProvider/useLimitsStore'; +import { usePermissionProvider } from '../../../../context/PermissionProvider/PermissionProvider'; +import { EntityType as EntityTypeEnum } from '../../../../enums/entity.enum'; +import { ServiceCategory } from '../../../../enums/service.enum'; +import { TestCase } from '../../../../generated/tests/testCase'; +import { TestDefinition } from '../../../../generated/tests/testDefinition'; +import { TestSuite } from '../../../../generated/tests/testSuite'; +import { TableSearchSource } from '../../../../interface/search.interface'; +import testCaseClassBase from '../../../../pages/IncidentManager/IncidentManagerDetailPage/TestCaseClassBase'; +import { + addIngestionPipeline, + deployIngestionPipelineById, +} from '../../../../rest/ingestionPipelineAPI'; +import { + createTestCase, + getTestDefinitionById, + updateTestCaseById, +} from '../../../../rest/testAPI'; +import { createUpdatedTestCasePatch } from '../../../../utils/DataQuality/DataQualityPureUtils'; +import { getDefaultTestCaseFormVariant } from '../../../../utils/DataQuality/TestCaseFormVariantUtils'; +import { getEntityName } from '../../../../utils/EntityNameUtils'; +import { submitAndClose } from '../../../../utils/FormDrawerUtils'; +import { createScrollToErrorHandler } from '../../../../utils/formPureUtils'; +import { showSuccessToast } from '../../../../utils/ToastUtils'; +import { AiFormModal } from '../../../common/atoms/drawer/AiFormModal'; +import { useFormDrawerWithHook } from '../../../common/atoms/drawer/useFormDrawer'; +import Loader from '../../../common/Loader/Loader'; +import RichTextEditorPreviewerV1 from '../../../common/RichTextEditor/RichTextEditorPreviewerV1'; +import ServiceDocPanel from '../../../common/ServiceDocPanel/ServiceDocPanel'; +import { TestCaseFormType } from '../AddDataQualityTest.interface'; +import TestCaseFormBody from './TestCaseFormBody'; +import { + FormValues, + TestCaseFormContext, + TestCaseFormDrawerProps, + TestLevel, +} from './TestCaseFormV1.interface'; +import './TestCaseFormV1.less'; +import { + buildEditDefaults, + buildTestSuitePipelinePayload, + normalizeFormValuesForPayload, + transformTestCaseFormData, +} from './transformTestCaseFormData'; + +const TestCaseFormDrawer: FC = ({ + open, + onClose, + onFormSubmit, + onActiveFieldChange, + table, + testSuite, + testLevel, + variant = getDefaultTestCaseFormVariant(), + title, + headerActions, + width, + showDocPanel = variant === 'drawer', + testCase, + showOnlyParameter = false, + onUpdate, +}: TestCaseFormDrawerProps) => { + const { t } = useTranslation(); + const { getResourceLimit } = useLimitStore(); + const { isAirflowAvailable } = useAirflowStatus(); + const { permissions } = usePermissionProvider(); + const { ingestionPipeline } = permissions; + + const isEditMode = !!testCase; + + const form = useForm({ + // Legacy antd validated fields on change (name regex/uniqueness errors + // surface while typing); mirror that instead of RHF's submit-time default. + mode: 'onChange', + defaultValues: { + testLevel: testLevel ?? TestLevel.TABLE, + useDynamicAssertion: false, + ...testCaseClassBase.initialFormValues(), + cron: DEFAULT_SCHEDULE_CRON_DAILY, + enableDebugLog: false, + raiseOnError: true, + selectAllTestCases: true, + selectedTable: table?.fullyQualifiedName, + } as FormValues, + }); + + const [errorMessage, setErrorMessage] = useState(''); + const [activeField, setActiveField] = useState(''); + const [formContext, setFormContext] = useState(); + const [showHint, setShowHint] = useState(true); + const [editDefinition, setEditDefinition] = useState(); + // Id of the test case whose edit prefill has finished. Until this matches the + // open test case, the body renders a loader so the form appears fully + // populated in one paint instead of filling in as the async prefill lands. + const [editPrefilledId, setEditPrefilledId] = useState(); + + const handleErrorDismiss = useCallback(() => setErrorMessage(''), []); + + useEffect(() => { + if (!testCase || !open) { + return undefined; + } + // Guard against a stale prefill: if the drawer closes (or reopens for a + // different test case) while this fetch is in flight, its late result must + // not reset the form out from under the current contents. + let cancelled = false; + (async () => { + try { + const definition = await getTestDefinitionById( + testCase.testDefinition?.id ?? '' + ); + if (cancelled) { + return; + } + setEditDefinition(definition); + form.reset({ + ...form.getValues(), + ...buildEditDefaults(testCase, definition), + } as FormValues); + } finally { + // Release the loader even if the definition fetch fails, so the drawer + // never gets stuck on the spinner. + if (!cancelled) { + setEditPrefilledId(testCase.id); + } + } + })(); + + return () => { + cancelled = true; + }; + }, [testCase, open, form]); + + const handleActiveFieldChange = useCallback( + (fieldId: string) => { + setActiveField(fieldId); + onActiveFieldChange?.(fieldId); + }, + [onActiveFieldChange] + ); + + const createTestCasePipeline = useCallback( + async (values: FormValues, created: TestCase) => { + const pipelineTestSuite = + (created.testSuite as TestSuite | undefined) ?? testSuite; + if (!formContext?.canCreatePipeline || !pipelineTestSuite) { + return; + } + + const pipeline = buildTestSuitePipelinePayload(values, { + testSuite: pipelineTestSuite, + createdTestCaseName: created.name, + selectedTable: formContext?.selectedTableData?.fullyQualifiedName, + table, + }); + + const ingestion = await addIngestionPipeline(pipeline); + if (isAirflowAvailable && ingestionPipeline.EditAll) { + await deployIngestionPipelineById(ingestion.id ?? ''); + } + }, + [formContext, testSuite, table, isAirflowAvailable, ingestionPipeline] + ); + + const handleEditSubmit = useCallback( + async (values: FormValues) => { + // `editDefinition` comes from the direct getTestDefinitionById fetch in + // the prefill effect, which is keyed by the test case's own definition + // id. `formContext.selectedDefinition` is resolved by TestCaseFormBody + // from its filtered getListTestDefinitions list, which can be + // undefined on a submit-before-load race or when the definition is + // filtered out (deprecated/mismatched service or data type). Prefer + // the directly-fetched definition so Array-type params are always + // correctly serialized. + const resolvedDefinition = + editDefinition ?? formContext?.selectedDefinition; + const isComputeRowCountFieldVisible = + resolvedDefinition?.supportsRowLevelPassedFailed ?? false; + // Edit prefill (`buildEditDefaults`) stores select-type params and + // `dimensionColumns` as `FormSelectItem` shapes so the fields display + // correctly, exactly like the create path's raw RHF values. Both + // submit paths MUST run through the same normalizer before building + // their payload/patch, or this one emits objects/dotted keys instead + // of ids/paths — see `transformTestCaseFormData` (create). + const normalizedValues = normalizeFormValuesForPayload( + values, + resolvedDefinition + ); + const formValue = normalizedValues as unknown as TestCaseFormType; + const jsonPatch = createUpdatedTestCasePatch({ + testCase: testCase as TestCase, + value: formValue, + createTestCaseObject: testCaseClassBase.getCreateTestCaseObject( + formValue, + resolvedDefinition + ), + showOnlyParameter, + isComputeRowCountFieldVisible, + }); + + if (!jsonPatch.length) { + return; + } + + const updated = await updateTestCaseById( + (testCase as TestCase).id ?? '', + jsonPatch + ); + showSuccessToast( + t('server.update-entity-success', { entity: t('label.test-case') }) + ); + onUpdate?.(updated); + }, + [testCase, editDefinition, formContext, showOnlyParameter, onUpdate, t] + ); + + const handleCreateSubmit = useCallback( + async (values: FormValues) => { + const testCaseObj = transformTestCaseFormData(values, { + selectedDefinition: formContext?.selectedDefinition, + selectedTableData: formContext?.selectedTableData, + selectedColumn: formContext?.selectedColumn, + selectedTestLevel: formContext?.selectedTestLevel ?? TestLevel.TABLE, + table, + selectedTable: formContext?.selectedTableData?.fullyQualifiedName, + generateName: formContext?.generateName ?? (() => ''), + }); + + const created = await createTestCase(testCaseObj); + await getResourceLimit('dataQuality', true, true); + await createTestCasePipeline(values, created); + + showSuccessToast( + t('server.create-entity-success', { entity: t('label.test-case') }) + ); + + onFormSubmit?.(created); + }, + [ + formContext, + table, + getResourceLimit, + createTestCasePipeline, + onFormSubmit, + t, + ] + ); + + const handleSubmit = useCallback( + async (values: FormValues) => { + setErrorMessage(''); + try { + if (isEditMode) { + await handleEditSubmit(values); + } else { + await handleCreateSubmit(values); + } + } catch (error) { + const errorMsg = + (error as AxiosError<{ message: string }>)?.response?.data?.message || + t( + isEditMode + ? 'server.update-entity-error' + : 'server.create-entity-error', + { entity: t('label.test-case') } + ); + setErrorMessage(errorMsg); + + throw error; + } + }, + [isEditMode, handleEditSubmit, handleCreateSubmit, t] + ); + + const serviceDocPanel = ( + + ); + + const testCaseFormBody = ( + + ); + + const isModalVariant = variant === 'modal'; + + const docPanel = showDocPanel ? ( +
+ {serviceDocPanel} +
+ ) : null; + + // Without the doc panel the form spans the full drawer, so drop the drawer + // width to roughly the form's original 65% column and let it fill (see the + // .no-doc-panel grid override in TestCaseFormV1.less). + const resolvedWidth = width ?? (showDocPanel ? '80vw' : '52vw'); + + const scrollToError = useMemo( + () => + createScrollToErrorHandler({ + errorSelector: '[aria-invalid="true"], [data-invalid="true"]', + }), + [] + ); + + // In edit mode hold the form behind a loader until the prefill (definition + // fetch + form.reset) is done for the open test case, so it renders fully + // populated in one paint rather than flickering values in as calls resolve. + const isEditPrefilling = + isEditMode && open && editPrefilledId !== testCase?.id; + + const gatedFormBody = isEditPrefilling ? ( +
+ +
+ ) : ( + testCaseFormBody + ); + + const formBody = ( + + submitAndClose(data, handleSubmit, () => closeDrawerRef.current()), + () => scrollToError() + )}> +
+
{gatedFormBody}
+ {docPanel} +
+
+ ); + + const closeDrawerRef = useRef<() => void>(() => undefined); + + // Every dismissal path (cancel, X, Escape, backdrop, programmatic close) + // funnels through the base drawer's onClose, so the parent is notified + // exactly once and the form resets. The backdrop stays dismissable to match + // the legacy antd drawer (only the bundle suite drawer was mask-locked). + const handleDrawerDismiss = useCallback(() => { + form.reset(); + // Force the loader again on the next open so a reopened drawer never shows + // the previous (or empty) form before its prefill lands. + setEditPrefilledId(undefined); + onClose(); + }, [form, onClose]); + + const defaultTitle = isEditMode + ? t('label.edit-entity', { entity: getEntityName(testCase) }) + : t('label.add-entity', { entity: t('label.test-case') }); + + const { formDrawer, openDrawer, closeDrawer, isOpen } = + useFormDrawerWithHook({ + className: 'test-case-form-drawer', + title: title ?? defaultTitle, + hookForm: form, + form: formBody, + headerActions, + width: resolvedWidth, + submitLabel: isEditMode ? t('label.update') : t('label.create'), + submitTestId: 'create-btn', + submitLoading: formContext?.isCheckingPermissions ?? false, + onClose: handleDrawerDismiss, + onSubmit: (data) => + submitAndClose(data, handleSubmit, () => closeDrawerRef.current()), + }); + + closeDrawerRef.current = closeDrawer; + + useEffect(() => { + if (isModalVariant) { + return; + } + if (open) { + openDrawer(); + } else if (isOpen) { + closeDrawer(); + } + }, [isModalVariant, open, isOpen, openDrawer, closeDrawer]); + + if (isModalVariant) { + return ( + + + + {t('label.show-hint')} + + + + ) + } + isSubmitting={form.formState.isSubmitting} + open={open} + reserveHintSpace={showHint} + submitLabel={isEditMode ? t('label.update') : undefined} + subtitle={t('message.page-sub-header-for-data-quality')} + title={title ?? defaultTitle} + onClose={handleDrawerDismiss} + onSubmit={form.handleSubmit( + (data) => submitAndClose(data, handleSubmit, handleDrawerDismiss), + () => scrollToError() + )}> + + + + {t('label.form-hint')} + + + } + fieldDocOffset={56} + form={form} + renderFieldDoc={(markdown) => ( + // Render the full field doc without the "see more" toggle — the + // popover shows the whole hint, and toggling it would resize the + // popover and make react-aria re-anchor it (flicker). + + )} + showFieldDocs={showHint} + onSubmit={form.handleSubmit( + (data) => submitAndClose(data, handleSubmit, handleDrawerDismiss), + () => scrollToError() + )}> + {gatedFormBody} + + + ); + } + + return formDrawer; +}; + +export default TestCaseFormDrawer; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormEditPrefill.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormEditPrefill.test.tsx new file mode 100644 index 000000000000..b5fbf29f4944 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormEditPrefill.test.tsx @@ -0,0 +1,928 @@ +/* + * Copyright 2025 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Render-level regression guard for DQ edit-form prefill. + * + * Unit tests around `buildEditDefaults`/`transformTestCaseFormData` assert on + * `form.getValues(...)` shapes; they can't catch a class of bug where the RHF + * value is shaped correctly but the field component that's supposed to + * *display* it never renders that value (a mismatched `id`, a field that + * reads the wrong RHF path, a missing options list, etc). This file mounts + * the REAL `TestCaseFormDrawer` (real `TestCaseFormBody`, `ParameterFields`, + * `TableDiffFields`, `buildEditDefaults` — nothing under test is mocked) with + * a `testCase` prop across a matrix of representative test types, and asserts + * the actual displayed DOM value for each prefilled field. Only external + * boundaries (REST, tag suggestion search, permission/limit/airflow context + * providers) are mocked so option lists resolve in jsdom. + */ +import { render, screen, waitFor, within } from '@testing-library/react'; +import { Table } from '../../../../generated/entity/data/table'; +import { TestCase } from '../../../../generated/tests/testCase'; +import { + TestDataType, + TestDefinition, +} from '../../../../generated/tests/testDefinition'; +import { getIngestionPipelines } from '../../../../rest/ingestionPipelineAPI'; +import { searchQuery } from '../../../../rest/searchAPI'; +import { getTableDetailsByFQN } from '../../../../rest/tableAPI'; +import { + getListTestCaseBySearch, + getListTestDefinitions, + getTestDefinitionById, +} from '../../../../rest/testAPI'; +import TestCaseFormDrawer from './TestCaseFormDrawer'; +import { TestCaseFormDrawerProps } from './TestCaseFormV1.interface'; + +jest.mock('../../../../rest/testAPI', () => ({ + getTestDefinitionById: jest.fn(), + getListTestDefinitions: jest.fn(), + getListTestCaseBySearch: jest.fn(), + createTestCase: jest.fn(), + updateTestCaseById: jest.fn(), +})); + +jest.mock('../../../../rest/searchAPI', () => ({ + searchQuery: jest.fn(), +})); + +jest.mock('../../../../rest/tableAPI', () => ({ + getTableDetailsByFQN: jest.fn(), +})); + +jest.mock('../../../../rest/ingestionPipelineAPI', () => ({ + getIngestionPipelines: jest.fn(), + addIngestionPipeline: jest.fn(), + deployIngestionPipelineById: jest.fn(), +})); + +jest.mock( + '../../../../context/AirflowStatusProvider/AirflowStatusProvider', + () => ({ + useAirflowStatus: jest.fn().mockReturnValue({ isAirflowAvailable: true }), + }) +); + +jest.mock('../../../../context/LimitsProvider/useLimitsStore', () => ({ + useLimitStore: jest.fn().mockReturnValue({ + config: {}, + getResourceLimit: jest.fn().mockResolvedValue(undefined), + }), +})); + +jest.mock('../../../../context/PermissionProvider/PermissionProvider', () => ({ + usePermissionProvider: () => ({ + permissions: { + ingestionPipeline: { Create: true, EditAll: true }, + testCase: { Create: true }, + }, + getEntityPermissionByFqn: jest + .fn() + .mockResolvedValue({ EditAll: true, EditTests: true }), + }), +})); + +jest.mock('../../../../utils/ToastUtils', () => ({ + showSuccessToast: jest.fn(), + showErrorToast: jest.fn(), +})); + +// ServiceDocPanel pulls in EntitySummaryPanel, which calls useNavigate() and +// needs a ancestor this harness doesn't provide. The doc/hint panel +// is not part of the prefill surface under test (TestCaseFormBody/ +// ParameterFields/TableDiffFields are), so it's stubbed the same way +// TestCaseFormDrawer.test.tsx and TestCaseForm.integration.test.tsx do. +jest.mock('../../../common/ServiceDocPanel/ServiceDocPanel', () => + jest + .fn() + .mockImplementation(() => ( +
doc-panel
+ )) +); + +// RichTextEditor wraps a lazy BlockEditor (TipTap) that does not render its +// content synchronously in jsdom. Mock it to a plain div carrying the +// initialValue so the description field's prefilled value is still +// display-assertable without pulling in the real editor. +jest.mock('../../../common/RichTextEditor/RichTextEditor', () => ({ + __esModule: true, + default: function MockRichTextEditor({ + initialValue, + }: { + initialValue?: string; + }) { + return
{initialValue}
; + }, +})); + +const mockSearchQuery = searchQuery as jest.MockedFunction; +const mockGetTableDetailsByFQN = getTableDetailsByFQN as jest.MockedFunction< + typeof getTableDetailsByFQN +>; +const mockGetTestDefinitionById = getTestDefinitionById as jest.MockedFunction< + typeof getTestDefinitionById +>; +const mockGetListTestDefinitions = + getListTestDefinitions as jest.MockedFunction; +const mockGetListTestCaseBySearch = + getListTestCaseBySearch as jest.MockedFunction< + typeof getListTestCaseBySearch + >; +const mockGetIngestionPipelines = getIngestionPipelines as jest.MockedFunction< + typeof getIngestionPipelines +>; + +const emptySearchResponse = { + hits: { total: { value: 0 }, hits: [] }, +} as unknown as Awaited>; + +const renderDrawer = (props: Partial) => + render(); + +const PARAM_FIELD_TIMEOUT = { timeout: 5000 }; + +/** + * NOTE on the table-less edit path (historically a suspected prefill race): + * + * When `TestCaseFormDrawer` is opened in edit mode WITHOUT a `table` prop — + * how `DataQualityTab.tsx`, `IncidentManagerDetailPage.tsx`, and + * `TestCaseResultTab.tsx` invoke it — the table's columns load asynchronously + * via `getTableDetailsByFQN`, so `selectedTableData` transitions + * undefined -> table after mount. + * + * A prior concern was that this transition could re-fire the effect that + * resets `selectedTestDefinition` to `undefined` (via `fetchTestDefinitions` + * changing identity) with nothing left to re-derive it, leaving + * `showParameterFields` stuck `false` and the parameter fields never + * rendering. Case 9's "renders parameter fields after the async table + * resolves (no table prop)" exercises exactly that ordering and passes — the + * parameters do render — so that race does not manifest on the natural path. + * + * Most cases below still pass an explicit `table` prop (matching + * `TableProfilerProvider.tsx` and the existing `TestCaseFormBody.test.tsx` + * suite) to keep the matrix focused on per-type prefill display rather than + * the async-load ordering, which case 9 covers on its own. + */ + +describe('TestCaseFormEditPrefill (render-level regression matrix)', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockSearchQuery.mockResolvedValue(emptySearchResponse); + mockGetListTestCaseBySearch.mockResolvedValue({ + data: [], + paging: { total: 0 }, + } as never); + mockGetIngestionPipelines.mockResolvedValue({ + data: [], + paging: { total: 0 }, + } as never); + }); + + describe('1. Table-level scalar (tableRowCountToBeBetween)', () => { + const TABLE_FQN = 'service.db.schema.orders'; + + const definition = { + id: 'def-table-scalar', + name: 'tableRowCountToBeBetween', + fullyQualifiedName: 'tableRowCountToBeBetween', + parameterDefinition: [ + { name: 'minValue', displayName: 'Min', dataType: TestDataType.Int }, + { name: 'maxValue', displayName: 'Max', dataType: TestDataType.Int }, + ], + } as unknown as TestDefinition; + + const testCase = { + id: 'tc-1', + name: 'orders_row_count_between', + displayName: 'Orders Row Count Between', + entityLink: `<#E::table::${TABLE_FQN}>`, + testDefinition: { + id: 'def-table-scalar', + fullyQualifiedName: 'tableRowCountToBeBetween', + }, + parameterValues: [ + { name: 'minValue', value: '10' }, + { name: 'maxValue', value: '1000' }, + ], + tags: [], + } as unknown as TestCase; + + const table = { + id: 'table-1', + name: 'orders', + fullyQualifiedName: TABLE_FQN, + columns: [], + } as unknown as Table; + + beforeEach(() => { + mockGetTestDefinitionById.mockResolvedValue(definition); + mockGetTableDetailsByFQN.mockResolvedValue(table); + mockGetListTestDefinitions.mockResolvedValue({ + data: [definition], + paging: { total: 1 }, + } as never); + }); + + it('displays the disabled table FQN, the test name, and the numeric param values', async () => { + // `table` is passed explicitly — see the FINDING note above the + // describe block: without it, selectedTestDefinition can get reset + // after being correctly derived and the param fields never render. + renderDrawer({ testCase, table }); + + await waitFor(() => { + expect(mockGetTestDefinitionById).toHaveBeenCalledWith( + 'def-table-scalar' + ); + }); + + const tableSelect = await screen.findByTestId('selectedTable'); + // The table field is FieldTypes.ASYNC_SELECT (Autocomplete); its + // selected item is rendered as a chip carrying the FQN as its label — + // this is the exact display path the selectedTable prefill bug broke. + await waitFor(() => { + expect(within(tableSelect).getByText(TABLE_FQN)).toBeInTheDocument(); + }); + + expect(tableSelect.querySelector('input')).toBeDisabled(); + + const nameField = await screen.findByTestId('test-case-name'); + + expect(nameField.querySelector('input')).toHaveValue( + 'orders_row_count_between' + ); + + const minValueField = await screen.findByTestId( + 'parameter-minValue', + {}, + PARAM_FIELD_TIMEOUT + ); + + expect(minValueField.querySelector('input')).toHaveValue(10); + + const maxValueField = await screen.findByTestId('parameter-maxValue'); + + expect(maxValueField.querySelector('input')).toHaveValue(1000); + }); + }); + + describe('2. Column-level with a Set param (columnValuesToBeInSet) — PRIORITY CASE', () => { + const TABLE_FQN = 'service.db.schema.customers'; + + const definition = { + id: 'def-col-set', + name: 'columnValuesToBeInSet', + fullyQualifiedName: 'columnValuesToBeInSet', + parameterDefinition: [ + { + name: 'allowedValues', + displayName: 'Allowed Values', + dataType: TestDataType.Set, + }, + ], + } as unknown as TestDefinition; + + const testCase = { + id: 'tc-2', + name: 'email_domain_in_set', + entityLink: `<#E::table::${TABLE_FQN}::columns::email_domain>`, + testDefinition: { + id: 'def-col-set', + fullyQualifiedName: 'columnValuesToBeInSet', + }, + parameterValues: [ + { + name: 'allowedValues', + value: JSON.stringify(['gmail.com', 'yahoo.com']), + }, + ], + tags: [], + } as unknown as TestCase; + + const table = { + id: 'table-2', + name: 'customers', + fullyQualifiedName: TABLE_FQN, + columns: [ + { name: 'id', dataType: 'BIGINT' }, + { name: 'email_domain', dataType: 'VARCHAR' }, + ], + } as unknown as Table; + + beforeEach(() => { + mockGetTestDefinitionById.mockResolvedValue(definition); + mockGetTableDetailsByFQN.mockResolvedValue(table); + mockGetListTestDefinitions.mockResolvedValue({ + data: [definition], + paging: { total: 1 }, + } as never); + }); + + it('displays the table, the saved column, and every allowed-value row', async () => { + // `table` passed explicitly — see the FINDING note above the describe + // block. + renderDrawer({ testCase, table }); + + await waitFor(() => { + expect(mockGetTestDefinitionById).toHaveBeenCalledWith('def-col-set'); + }); + + const tableSelect = await screen.findByTestId('selectedTable'); + await waitFor(() => { + expect(within(tableSelect).getByText(TABLE_FQN)).toBeInTheDocument(); + }); + + // This is the exact bug class this file guards against: selectedColumn + // is a FieldTypes.SELECT whose RHF value must be a FormSelectItem + // ({ id, label }) to match `selectedKey` against `items` — a bare + // string id fails silently and the trigger renders blank even though + // form.getValues('selectedColumn') looks correct. + // + // FieldTypes.SELECT (react-aria Select) renders both a visible trigger + // button (selected item's label as a

) and a visually-hidden native + // mirror (for form semantics) whose

RichTextEditor.component
) - ) -); - -jest.mock('./ParameterForm', () => - jest.fn().mockImplementation(() =>
ParameterForm.component
) -); - -jest.mock('../../../../pages/TasksPage/shared/TagSuggestion', () => - jest.fn().mockImplementation(({ children, ...props }) => ( -
- TagSuggestion Component - {children} -
- )) -); - -// Mock ServiceDocPanel component -jest.mock('../../../common/ServiceDocPanel/ServiceDocPanel', () => - jest.fn().mockImplementation(({ activeField, selectedEntity }) => ( -
- ServiceDocPanel Component - Active Field: {activeField} - {selectedEntity && ( -
- {selectedEntity.entityType} -
- )} -
- )) -); - -jest.mock('../../../common/AsyncSelect/AsyncSelect', () => ({ - AsyncSelect: jest - .fn() - .mockImplementation(({ api, onChange, value, disabled }) => ( - - )), -})); - -jest.mock('../../../common/SelectionCardGroup/SelectionCardGroup', () => - jest.fn().mockImplementation(({ options, onChange, value, disabled }) => ( -
- {options.map((option: { value: string; label: string }) => ( - - ))} -
- )) -); - -jest.mock( - '../../../Settings/Services/AddIngestion/Steps/ScheduleIntervalV1', - () => - jest.fn().mockImplementation(({ defaultSchedule, onChange }) => ( -
- onChange?.(e.target.value)} - /> -
- )) -); - -jest.mock('@openmetadata/ui-core-components', () => ({ - Alert: ({ - title, - children, - ...props - }: { - title: string; - children?: React.ReactNode; - [key: string]: unknown; - }) => ( -
- {title} - {children} -
- ), -})); - -// Mock ToastUtils and getIconAndClassName function -jest.mock('../../../../utils/ToastUtils', () => ({ - getIconAndClassName: jest.fn().mockReturnValue({ - icon: null, - className: 'error', - type: 'error', - }), - showErrorToast: jest.fn(), - showSuccessToast: jest.fn(), -})); - -// Mock formUtils to prevent scroll issues in tests -jest.mock('../../../../utils/formUtils', () => ({ - ...jest.requireActual('../../../../utils/formUtils'), - createScrollToErrorHandler: jest.fn(() => jest.fn()), -})); - -const mockAddTestCaseList = jest - .fn() - .mockImplementation(() =>
); -jest.mock('../../AddTestCaseList/AddTestCaseList.component', () => ({ - AddTestCaseList: (props: Record) => - mockAddTestCaseList(props), -})); - -// Mock DataQualityUtils -jest.mock('../../../../utils/DataQuality/DataQualityUtils', () => ({ - ...jest.requireActual('../../../../utils/DataQuality/DataQualityUtils'), - getServiceTypeForTestDefinition: jest - .fn() - .mockImplementation(() => 'BigQuery'), -})); - -describe('TestCaseFormV1 Component', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('Component Rendering', () => { - it('should render form in drawer mode with all essential elements', async () => { - render(); - - expect(document.querySelector('.ant-drawer')).toBeInTheDocument(); - expect(document.querySelector('.drawer-mode')).toBeInTheDocument(); - expect(await screen.findByTestId('cancel-btn')).toBeInTheDocument(); - expect(await screen.findByTestId('create-btn')).toBeInTheDocument(); - }); - }); - - describe('Test Level Selection', () => { - it('should render test level selection with table and column options', async () => { - render(); - - expect( - await screen.findByTestId('selection-card-group') - ).toBeInTheDocument(); - expect(await screen.findByTestId('test-level-table')).toBeInTheDocument(); - expect( - await screen.findByTestId('test-level-column') - ).toBeInTheDocument(); - }); - - it('should handle test level change from table to column', async () => { - render(); - - const columnButton = await screen.findByTestId('test-level-column'); - - await act(async () => { - fireEvent.click(columnButton); - }); - - expect(columnButton).toHaveClass('selected'); - }); - - it('should show column selection when column test level is selected', async () => { - render(); - - // First select table - const tableSelect = await screen.findByTestId('async-select'); - await act(async () => { - fireEvent.change(tableSelect, { - target: { value: 'sample_data.ecommerce_db.shopify.users_table' }, - }); - }); - - // Then select column level - const columnButton = await screen.findByTestId('test-level-column'); - await act(async () => { - fireEvent.click(columnButton); - }); - - // Should show column selection dropdown - await waitFor( - () => { - // Column selection should appear after switching to column level and selecting table - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }, - { timeout: 5000 } - ); - }); - }); - - describe('Table Selection', () => { - it('should handle table selection and table prop integration', async () => { - render(); - - const tableSelect = await screen.findByTestId('async-select'); - - await act(async () => { - fireEvent.change(tableSelect, { - target: { value: 'sample_data.ecommerce_db.shopify.users_table' }, - }); - }); - - expect(tableSelect).toHaveValue( - 'sample_data.ecommerce_db.shopify.users_table' - ); - }); - }); - - describe('Test Type Selection', () => { - it('should load test definitions and handle test type selection', async () => { - render(); - - await waitFor(() => { - expect(getListTestDefinitions as jest.Mock).toHaveBeenCalledWith({ - entityType: 'TABLE', - limit: 50, - testPlatform: 'OpenMetadata', - supportedDataType: undefined, - supportedService: 'BigQuery', - }); - expect(document.querySelector('.ant-select')).toBeInTheDocument(); - }); - }); - }); - - describe('Test Details Fields', () => { - it('should render all essential form fields', async () => { - render(); - - expect(await screen.findByTestId('test-case-name')).toBeInTheDocument(); - expect( - await screen.findByText('RichTextEditor.component') - ).toBeInTheDocument(); - expect(await screen.findByTestId('tags-selector')).toBeInTheDocument(); - expect( - await screen.findByTestId('glossary-terms-selector') - ).toBeInTheDocument(); - }); - }); - - describe('Scheduler Section', () => { - it('should show scheduler section when conditions are met', async () => { - // Ensure getIngestionPipelines returns 0 pipelines for canCreatePipeline to be true - - (getIngestionPipelines as jest.Mock).mockResolvedValue({ - paging: { total: 0 }, - }); - - render(); - - // Wait for form to initialize - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Select table first - use the AsyncSelect mock properly - const tableSelect = await screen.findByTestId('async-select'); - await act(async () => { - fireEvent.change(tableSelect, { - target: { value: 'sample_data.ecommerce_db.shopify.users_table' }, - }); - }); - - // Wait for any async operations to complete - await waitFor( - () => { - const schedulerCard = document.querySelector( - '[data-testid="scheduler-card"]' - ); - - expect(schedulerCard).toBeInTheDocument(); - }, - { timeout: 5000 } - ); - }); - - it('should render debug log and raise on error switches', async () => { - // Ensure getIngestionPipelines returns 0 pipelines for canCreatePipeline to be true - - (getIngestionPipelines as jest.Mock).mockResolvedValue({ - paging: { total: 0 }, - }); - - render(); - - // Wait for form to initialize - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Select table to enable scheduler - const tableSelect = await screen.findByTestId('async-select'); - await act(async () => { - fireEvent.change(tableSelect, { - target: { value: 'sample_data.ecommerce_db.shopify.users_table' }, - }); - }); - - // Wait for scheduler card to appear - await waitFor( - () => { - const schedulerCard = document.querySelector( - '[data-testid="scheduler-card"]' - ); - - expect(schedulerCard).toBeInTheDocument(); - }, - { timeout: 5000 } - ); - - // Now check for the debug log and raise on error switches - // These are rendered as Typography.Paragraph elements, not labels - await waitFor(() => { - expect(screen.getByText('label.enable-debug-log')).toBeInTheDocument(); - expect(screen.getByText('label.raise-on-error')).toBeInTheDocument(); - }); - }); - }); - - describe('Form Interactions', () => { - it('should handle cancel and submit actions', async () => { - render(); - - const cancelBtn = await screen.findByTestId('cancel-btn'); - const createBtn = await screen.findByTestId('create-btn'); - - await act(async () => { - fireEvent.click(cancelBtn); - }); - - expect(mockProps.onCancel).toHaveBeenCalled(); - expect(createBtn).toBeInTheDocument(); - }); - }); - - describe('Table Prop Handling', () => { - it('should handle table prop correctly', async () => { - render(); - - const tableSelect = await screen.findByTestId('async-select'); - - expect(tableSelect).toBeDisabled(); - }); - }); - - describe('AddTestCaseList props when opened from profiler', () => { - const tableWithTestSuite = { - ...MOCK_TABLE, - testSuite: { - id: 'suite-1', - fullyQualifiedName: 'test-suite', - summary: { success: 0, failed: 0, aborted: 0 }, - }, - }; - - it('passes hideTableFilter and columnFilters when table prop is provided', async () => { - (getIngestionPipelines as jest.Mock).mockResolvedValue({ - paging: { total: 0 }, - }); - - render( - - ); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - const schedulerCard = await screen.findByTestId('scheduler-card'); - await waitFor( - () => { - expect(schedulerCard).toBeInTheDocument(); - }, - { timeout: 5000 } - ); - - const switches = within(schedulerCard).getAllByRole('switch'); - const selectAllSwitch = switches[0]; - await act(async () => { - fireEvent.click(selectAllSwitch); - }); - - expect( - await screen.findByTestId('add-test-case-list') - ).toBeInTheDocument(); - - const lastCall = - mockAddTestCaseList.mock.calls[ - mockAddTestCaseList.mock.calls.length - 1 - ]; - const props = lastCall[0] as { - hideTableFilter: boolean; - columnFilters?: string; - }; - - expect(props.hideTableFilter).toBe(true); - expect(props.columnFilters).toBe( - 'fullyQualifiedName:"sample_data.ecommerce_db.shopify.dim_address"' - ); - }); - - it('passes hideTableFilter false and columnFilters undefined when table is not provided', async () => { - (getTableDetailsByFQN as jest.Mock).mockResolvedValue(tableWithTestSuite); - (getIngestionPipelines as jest.Mock).mockResolvedValue({ - paging: { total: 0 }, - }); - - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - const tableSelect = await screen.findByTestId('async-select'); - await act(async () => { - fireEvent.change(tableSelect, { - target: { value: 'sample_data.ecommerce_db.shopify.dim_address' }, - }); - }); - - const schedulerCard = await screen.findByTestId('scheduler-card'); - await waitFor( - () => { - expect(schedulerCard).toBeInTheDocument(); - }, - { timeout: 5000 } - ); - - const switches = within(schedulerCard).getAllByRole('switch'); - const selectAllSwitch = switches[0]; - await act(async () => { - fireEvent.click(selectAllSwitch); - }); - - expect( - await screen.findByTestId('add-test-case-list') - ).toBeInTheDocument(); - - const lastCall = - mockAddTestCaseList.mock.calls[ - mockAddTestCaseList.mock.calls.length - 1 - ]; - const props = lastCall[0] as { - hideTableFilter: boolean; - columnFilters?: string; - }; - - expect(props.hideTableFilter).toBe(false); - expect(props.columnFilters).toBeUndefined(); - }); - }); - - describe('Custom Query Functionality', () => { - it('should render custom query button for table level tests', async () => { - render(); - - // Wait for component to render - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Custom query button should be visible for table level - await waitFor(() => { - const customQueryButton = screen.getByTestId('custom-query'); - - expect(customQueryButton).toBeInTheDocument(); - }); - }); - - it('should toggle to custom query mode when custom query button is clicked', async () => { - render(); - - // Wait for component to render - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Click custom query button - const customQueryButton = await screen.findByTestId('custom-query'); - await act(async () => { - fireEvent.click(customQueryButton); - }); - - // Should show the edit button to go back to test type selection - await waitFor(() => { - const editButton = screen.getByTestId('test-type-btn'); - - expect(editButton).toBeInTheDocument(); - }); - }); - - it('should switch back to test type selection from custom query mode', async () => { - render(); - - // Wait for component to render - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // First switch to custom query mode - const customQueryButton = await screen.findByTestId('custom-query'); - await act(async () => { - fireEvent.click(customQueryButton); - }); - - // Wait for mode to change - await waitFor(() => { - const editButton = screen.getByTestId('test-type-btn'); - - expect(editButton).toBeInTheDocument(); - }); - - // Now click the select test type button to go back - const selectTestTypeButton = screen.getByTestId('test-type-btn'); - - await act(async () => { - fireEvent.click(selectTestTypeButton); - }); - - // Should show custom query button again - await waitFor(() => { - expect(screen.getByTestId('custom-query')).toBeInTheDocument(); - }); - }); - - it('should hide test type dropdown when in custom query mode', async () => { - render(); - - // Wait for component to render - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Initially test type dropdown should be visible - await waitFor(() => { - expect(screen.getByTestId('test-type')).toBeInTheDocument(); - }); - - // Switch to custom query mode - const customQueryButton = await screen.findByTestId('custom-query'); - await act(async () => { - fireEvent.click(customQueryButton); - }); - - // Test type dropdown should not be easily accessible in custom query mode - await waitFor(() => { - expect(screen.getByText('label.test-type')).toBeInTheDocument(); - - // The dropdown should exist but be hidden from view - const testTypeSelect = document.querySelector( - '[data-testid="test-type"]' - ); - - expect(testTypeSelect).toBeInTheDocument(); - }); - }); - - it('should not show custom query button for column level tests', async () => { - render(); - - // Wait for component to render - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Switch to column level - const columnButton = await screen.findByTestId('test-level-column'); - await act(async () => { - fireEvent.click(columnButton); - }); - - // Custom query button should not be present for column level - await waitFor(() => { - expect(screen.queryByTestId('custom-query')).not.toBeInTheDocument(); - }); - }); - - it('should show test type label when in custom query mode', async () => { - render(); - - // Wait for component to render - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Switch to custom query mode - const customQueryButton = await screen.findByTestId('custom-query'); - await act(async () => { - fireEvent.click(customQueryButton); - }); - - // Should show test type label - await waitFor(() => { - expect(screen.getByText('label.test-type')).toBeInTheDocument(); - }); - }); - - it('should properly handle form field updates when switching modes', async () => { - render(); - - // Wait for component to render - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Switch to custom query mode - const customQueryButton = await screen.findByTestId('custom-query'); - await act(async () => { - fireEvent.click(customQueryButton); - }); - - // Verify the form field is set correctly (tableCustomSQLQuery) - await waitFor(() => { - expect(screen.getByText('label.test-type')).toBeInTheDocument(); - }); - - // Switch back to regular mode - const selectTestTypeButton = screen.getByTestId('test-type-btn'); - - await act(async () => { - fireEvent.click(selectTestTypeButton); - }); - - // Verify we're back to normal mode - await waitFor(() => { - expect(screen.getByTestId('custom-query')).toBeInTheDocument(); - }); - }); - }); - - // ============================================= - // NEW FEATURE TESTS - // ============================================= - - describe('ServiceDocPanel Integration', () => { - it('should render ServiceDocPanel with correct props', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('service-doc-panel')).toBeInTheDocument(); - expect( - screen.getByText(/ServiceDocPanel Component - Active Field:/) - ).toBeInTheDocument(); - }); - }); - - it('should render dual-pane drawer layout', async () => { - render(); - - await waitFor(() => { - expect( - document.querySelector('.drawer-content-wrapper') - ).toBeInTheDocument(); - expect( - document.querySelector('.drawer-form-content') - ).toBeInTheDocument(); - expect(document.querySelector('.drawer-doc-panel')).toBeInTheDocument(); - }); - }); - - it('should update activeField when field receives focus', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - const testNameField = document.querySelector( - 'input[data-testid="test-case-name"]' - ); - - expect(testNameField).toBeInTheDocument(); - expect(testNameField).toBeTruthy(); - - if (testNameField) { - fireEvent.focus(testNameField); - } - - await waitFor(() => { - expect( - screen.getByText(/Active Field: root\/name/) - ).toBeInTheDocument(); - }); - }); - - it('should pass selectedEntity with entityType field to ServiceDocPanel', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('service-doc-panel')).toBeInTheDocument(); - }); - - const entityTypeElement = screen.getByTestId( - 'service-doc-panel-entity-type' - ); - - expect(entityTypeElement).toBeInTheDocument(); - expect(entityTypeElement).toHaveTextContent('table'); - }); - - it('should preserve selectedTableData properties when passed to ServiceDocPanel', async () => { - const ServiceDocPanelMock = require('../../../common/ServiceDocPanel/ServiceDocPanel'); - - render(); - - await waitFor( - () => { - const calls = ServiceDocPanelMock.mock.calls; - const lastCall = calls[calls.length - 1]; - if (lastCall && lastCall[0].selectedEntity) { - expect(lastCall[0].selectedEntity.name).toBeDefined(); - } - }, - { timeout: 5000 } - ); - - const callArgs = - ServiceDocPanelMock.mock.calls[ - ServiceDocPanelMock.mock.calls.length - 1 - ][0]; - const { selectedEntity } = callArgs; - - expect(selectedEntity).toBeDefined(); - expect(selectedEntity.entityType).toBe('table'); - expect(selectedEntity.name).toBe(MOCK_TABLE.name); - expect(selectedEntity.fullyQualifiedName).toBe( - MOCK_TABLE.fullyQualifiedName - ); - expect(selectedEntity.columns).toEqual(MOCK_TABLE.columns); - }); - - it('should use EntityTypeEnum.TABLE enum value for entityType', async () => { - const { - EntityType: EntityTypeEnum, - } = require('../../../../enums/entity.enum'); - const ServiceDocPanelMock = require('../../../common/ServiceDocPanel/ServiceDocPanel'); - - render(); - - await waitFor( - () => { - const calls = ServiceDocPanelMock.mock.calls; - const lastCall = calls[calls.length - 1]; - if (lastCall && lastCall[0].selectedEntity) { - expect(lastCall[0].selectedEntity.name).toBeDefined(); - } - }, - { timeout: 5000 } - ); - - const callArgs = - ServiceDocPanelMock.mock.calls[ - ServiceDocPanelMock.mock.calls.length - 1 - ][0]; - const { selectedEntity } = callArgs; - - expect(selectedEntity.entityType).toBe(EntityTypeEnum.TABLE); - expect(selectedEntity.entityType).toBe('table'); - }); - }); - - describe('Enhanced Field Focus Handling', () => { - it('should handle focus events and activeField updates', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - const form = screen.getByTestId('test-case-form-v1'); - - // Create a mock focus event with root pattern - const mockEvent = { - target: { id: 'root/testLevel' }, - }; - - fireEvent.focus(form, mockEvent); - - await waitFor(() => { - expect( - screen.getByText(/Active Field: root\/testLevel/) - ).toBeInTheDocument(); - }); - }); - - it('should handle scheduler card click for activeField', async () => { - // Mock getIngestionPipelines to return 0 pipelines - (getIngestionPipelines as jest.Mock).mockResolvedValue({ - paging: { total: 0 }, - }); - - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Select table to enable scheduler - const tableSelect = screen.getByTestId('async-select'); - fireEvent.change(tableSelect, { - target: { value: 'sample_data.ecommerce_db.shopify.users_table' }, - }); - - // Wait for scheduler card to appear - await waitFor( - () => { - const schedulerCard = document.querySelector( - '[data-testid="scheduler-card"]' - ); - - expect(schedulerCard).toBeInTheDocument(); - - if (schedulerCard) { - fireEvent.click(schedulerCard); - } - }, - { timeout: 5000 } - ); - - // ActiveField should be updated for scheduler - await waitFor(() => { - expect( - screen.getByText(/Active Field: root\/cron/) - ).toBeInTheDocument(); - }); - }); - }); - - describe('Display Name Field Enhancement', () => { - it('should set display name equal to test name in form submission', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - const testNameField = document.querySelector( - 'input[data-testid="test-case-name"]' - ); - - expect(testNameField).toBeTruthy(); - - if (testNameField) { - fireEvent.change(testNameField, { - target: { value: 'test_with_display_name' }, - }); - } - - // Form submission would use this name as both name and displayName - expect(testNameField).toHaveValue('test_with_display_name'); - }); - - it('should handle display name in createTestCaseObj function', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Select required fields for form submission - const tableSelect = screen.getByTestId('async-select'); - fireEvent.change(tableSelect, { - target: { value: 'sample_data.ecommerce_db.shopify.users_table' }, - }); - - const testNameField = document.querySelector( - 'input[data-testid="test-case-name"]' - ); - - if (testNameField) { - fireEvent.change(testNameField, { - target: { value: 'test_case_with_display' }, - }); - } - - // The component internally sets displayName = name in createTestCaseObj - expect(testNameField).toHaveValue('test_case_with_display'); - }); - }); - - describe('Enhanced Table and Column Integration', () => { - it('should handle table selection with focus field updates', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - const tableSelect = screen.getByTestId('async-select'); - - // Focus and selection should work together - fireEvent.focus(tableSelect); - fireEvent.change(tableSelect, { - target: { value: 'sample_data.ecommerce_db.shopify.users_table' }, - }); - - // Verify that the table selection worked - await waitFor(() => { - expect(tableSelect).toHaveValue( - 'sample_data.ecommerce_db.shopify.users_table' - ); - }); - }); - - it('should handle column selection field focus when in column mode', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - // Switch to column level - const columnButton = screen.getByTestId('test-level-column'); - fireEvent.click(columnButton); - - // Select table first - const tableSelect = screen.getByTestId('async-select'); - fireEvent.change(tableSelect, { - target: { value: 'sample_data.ecommerce_db.shopify.users_table' }, - }); - - // Wait for column selection to appear and verify it's functional - await waitFor( - () => { - // Verify the form is still functional in column mode - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }, - { timeout: 5000 } - ); - }); - }); - - describe('Test Case Name Validation', () => { - it('should render test case name field with validation rules', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - const testNameField = screen.getByTestId('test-case-name'); - - expect(testNameField).toBeInTheDocument(); - - // Test that the field accepts input - await act(async () => { - fireEvent.change(testNameField, { - target: { value: 'valid_test_name' }, - }); - }); - - expect(testNameField).toHaveValue('valid_test_name'); - }); - - it('should accept valid test case names without validation errors', async () => { - render(); - - await waitFor(() => { - expect(screen.getByTestId('test-case-form-v1')).toBeInTheDocument(); - }); - - const testNameField = screen.getByTestId('test-case-name'); - - // Test valid name format - const validName = 'table_column_count_equals'; - - await act(async () => { - fireEvent.change(testNameField, { target: { value: validName } }); - fireEvent.blur(testNameField); - }); - - // Field should accept the valid input - expect(testNameField).toHaveValue(validName); - }); - - it('should have TEST_CASE_NAME_REGEX validation configured', () => { - // Test that TEST_CASE_NAME_REGEX pattern is correctly configured - // Test forbidden characters - expect(TEST_CASE_NAME_REGEX.test('test::case')).toBe(false); - expect(TEST_CASE_NAME_REGEX.test('test"case')).toBe(false); - expect(TEST_CASE_NAME_REGEX.test('test>case')).toBe(false); - - // Test allowed characters - expect(TEST_CASE_NAME_REGEX.test('table_column_count_equals')).toBe(true); - expect(TEST_CASE_NAME_REGEX.test('valid.test.name')).toBe(true); - expect(TEST_CASE_NAME_REGEX.test('test case with spaces')).toBe(true); - }); - }); - - describe('Test Cases Selection Logic', () => { - it('should set testCases to undefined when selectAllTestCases is not false', () => { - const testValues = { - selectAllTestCases: true, - otherField: 'value', - }; - - // Testing the new logic: values?.selectAllTestCases === false - const result = - testValues?.selectAllTestCases === false - ? ['testCase1', 'testCase2'] - : undefined; - - expect(result).toBeUndefined(); - }); - - it('should set testCases to array when selectAllTestCases is explicitly false', () => { - const testValues = { - selectAllTestCases: false, - otherField: 'value', - }; - - const mockSelectedTestCases = ['existingTestCase1', 'existingTestCase2']; - const mockCreatedTestCase = { name: 'newTestCase' }; - - // Testing the new logic: values?.selectAllTestCases === false - const result = - testValues?.selectAllTestCases === false - ? [mockCreatedTestCase.name, ...mockSelectedTestCases] - : undefined; - - expect(result).toEqual([ - 'newTestCase', - 'existingTestCase1', - 'existingTestCase2', - ]); - }); - - it('should set testCases to undefined when selectAllTestCases is undefined', () => { - const testValues: { selectAllTestCases?: boolean; otherField: string } = { - otherField: 'value', - }; - - // Testing the new logic: values?.selectAllTestCases === false - const result = - testValues?.selectAllTestCases === false ? ['testCase1'] : undefined; - - expect(result).toBeUndefined(); - }); - }); -}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormV1.tsx deleted file mode 100644 index e919b8b7b901..000000000000 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormV1.tsx +++ /dev/null @@ -1,1502 +0,0 @@ -/* - * Copyright 2025 Collate. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// ============================================= -// IMPORTS -// ============================================= -import { EditOutlined } from '@ant-design/icons'; -import { Alert } from '@openmetadata/ui-core-components'; -import { - Button, - Card, - Col, - Drawer, - Form, - InputNumber, - Row, - Select, - Space, - Switch, - Typography, -} from 'antd'; -import { useForm } from 'antd/lib/form/Form'; -import { AxiosError } from 'axios'; -import classNames from 'classnames'; -import cryptoRandomString from 'crypto-random-string-with-promisify-polyfill'; -import { isEmpty, isEqual, isUndefined, snakeCase } from 'lodash'; -import { - FC, - FocusEvent, - useCallback, - useEffect, - useMemo, - useState, -} from 'react'; -import { useTranslation } from 'react-i18next'; -import { ReactComponent as CloseIcon } from '../../../../assets/svg/close.svg'; -import { ReactComponent as DimensionIcon } from '../../../../assets/svg/data-observability/dimension.svg'; -import { ReactComponent as ColumnIcon } from '../../../../assets/svg/ic-column.svg'; -import { ReactComponent as TableIcon } from '../../../../assets/svg/ic-table-test.svg'; -import { - MAX_NAME_LENGTH, - PAGE_SIZE_LARGE, - PAGE_SIZE_MEDIUM, -} from '../../../../constants/constants'; -import { TEST_CASE_NAME_REGEX } from '../../../../constants/regex.constants'; -import { DEFAULT_SCHEDULE_CRON_DAILY } from '../../../../constants/Schedular.constants'; -import { TEST_CASE_FORM } from '../../../../constants/service-guide.constant'; -import { OPEN_METADATA } from '../../../../constants/Services.constant'; -import { useAirflowStatus } from '../../../../context/AirflowStatusProvider/AirflowStatusProvider'; -import { useLimitStore } from '../../../../context/LimitsProvider/useLimitsStore'; -import { usePermissionProvider } from '../../../../context/PermissionProvider/PermissionProvider'; -import { ResourceEntity } from '../../../../context/PermissionProvider/PermissionProvider.interface'; -import { EntityType as EntityTypeEnum } from '../../../../enums/entity.enum'; -import { SearchIndex } from '../../../../enums/search.enum'; -import { ServiceCategory } from '../../../../enums/service.enum'; -import { TagSource } from '../../../../generated/api/domains/createDataProduct'; -import { - CreateIngestionPipeline, - FluffyType as ConfigType, - PipelineType, -} from '../../../../generated/api/services/ingestionPipelines/createIngestionPipeline'; -import { CreateTestCase } from '../../../../generated/api/tests/createTestCase'; -import { Table } from '../../../../generated/entity/data/table'; -import { LogLevels } from '../../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; -import { - EntityType, - TestDefinition, - TestPlatform, -} from '../../../../generated/tests/testDefinition'; -import { - FieldProp, - FieldTypes, - FormItemLayout, -} from '../../../../interface/FormUtils.interface'; -import { TableSearchSource } from '../../../../interface/search.interface'; -import testCaseClassBase from '../../../../pages/IncidentManager/IncidentManagerDetailPage/TestCaseClassBase'; -import { - addIngestionPipeline, - deployIngestionPipelineById, - getIngestionPipelines, -} from '../../../../rest/ingestionPipelineAPI'; -import { searchQuery } from '../../../../rest/searchAPI'; -import { getTableDetailsByFQN } from '../../../../rest/tableAPI'; -import { - createTestCase, - getListTestCaseBySearch, - getListTestDefinitions, -} from '../../../../rest/testAPI'; -import { getScheduleOptionsFromSchedules } from '../../../../utils/CronExpressionUtils'; -import { - convertSearchSourceToTable, - getServiceTypeForTestDefinition, -} from '../../../../utils/DataQuality/DataQualityPureUtils'; -import { getEntityName } from '../../../../utils/EntityNameUtils'; -import { filterSelectOptions } from '../../../../utils/FilterQueryUtils'; -import { - createScrollToErrorHandler, - getPopupContainer, -} from '../../../../utils/formPureUtils'; -import { generateFormFields } from '../../../../utils/formUtils'; -import { Transi18next } from '../../../../utils/i18next/LocalUtil'; -import { getIngestionName } from '../../../../utils/ServicePureUtils'; -import { - escapeESReservedCharacters, - generateUUID, - replaceAllSpacialCharWith_, -} from '../../../../utils/StringUtils'; -import { generateEntityLink } from '../../../../utils/TablePureUtils'; -import { showSuccessToast } from '../../../../utils/ToastUtils'; -import { AsyncSelect } from '../../../common/AsyncSelect/AsyncSelect'; -import SelectionCardGroup from '../../../common/SelectionCardGroup/SelectionCardGroup'; -import { SelectionOption } from '../../../common/SelectionCardGroup/SelectionCardGroup.interface'; -import ServiceDocPanel from '../../../common/ServiceDocPanel/ServiceDocPanel'; -import ScheduleIntervalV1 from '../../../Settings/Services/AddIngestion/Steps/ScheduleIntervalV1'; -import { AddTestCaseList } from '../../AddTestCaseList/AddTestCaseList.component'; -import { normalizeSelectedTestProp } from '../../AddTestCaseList/AddTestCaseListForm.utils'; -import { TestCaseFormType } from '../AddDataQualityTest.interface'; -import ParameterForm from './ParameterForm'; -import { - FormValues, - TablesCache, - TestCaseFormV1Props, - TestLevel, -} from './TestCaseFormV1.interface'; -import './TestCaseFormV1.less'; -// ============================================= -// MAIN COMPONENT -// ============================================= -const TestCaseFormV1: FC = ({ - className, - drawerProps, - table, - testSuite, - onFormSubmit, - onCancel, - loading: externalLoading = false, - testLevel = TestLevel.TABLE, -}: TestCaseFormV1Props) => { - // ============================================= - // HOOKS - External - // ============================================= - const { t } = useTranslation(); - const { config, getResourceLimit } = useLimitStore(); - const [form] = useForm(); - const { isAirflowAvailable } = useAirflowStatus(); - const { getEntityPermissionByFqn, permissions } = usePermissionProvider(); - const { ingestionPipeline, testCase } = permissions; - - const TEST_LEVEL_OPTIONS: SelectionOption[] = [ - { - value: TestLevel.TABLE, - label: t('label.table-level'), - description: t('label.test-applied-on-entity', { - entity: t('label.table-lowercase'), - }), - icon: , - }, - { - value: TestLevel.COLUMN, - label: t('label.column-level'), - description: t('label.test-applied-on-entity', { - entity: t('label.column-lowercase'), - }), - icon: , - }, - { - value: TestLevel.COLUMN_DIMENSION, - label: 'Dimension Level', - description: 'Column with dimension', - icon: , - isBeta: true, - }, - ]; - - // ============================================= - // HOOKS - State (grouped by functionality) - // ============================================= - // Form state - const [loading, setLoading] = useState(false); - const [errorMessage, setErrorMessage] = useState(''); - - // Test definition state - const [testDefinitions, setTestDefinitions] = useState([]); - const [selectedTestDefinition, setSelectedTestDefinition] = - useState(); - const [selectedTestType, setSelectedTestType] = useState< - string | undefined - >(); - const [currentColumnType, setCurrentColumnType] = useState(); - - // Table state - const [selectedTableData, setSelectedTableData] = useState
( - table - ); - const [tablesCache, setTablesCache] = useState(new Map()); - - // Test case state - const [existingTestCases, setExistingTestCases] = useState([]); - - // Pipeline state - const [canCreatePipeline, setCanCreatePipeline] = useState(false); - const [isTestNameManuallyEdited, setIsTestNameManuallyEdited] = - useState(false); - - // Permission state - only need loading state - const [isCheckingPermissions, setIsCheckingPermissions] = - useState(false); - const [isCustomQuery, setIsCustomQuery] = useState(false); - - const [activeField, setActiveField] = useState(''); - - const scrollToError = useMemo(() => createScrollToErrorHandler(), []); - - // ============================================= - // HOOKS - Form Watches - // ============================================= - const testLevelFieldValue = Form.useWatch('testLevel', form); - const selectedTable = Form.useWatch('selectedTable', form); - const selectedColumn = Form.useWatch('selectedColumn', form); - const selectAllTestCases = Form.useWatch('selectAllTestCases', form); - - // ============================================= - // HOOKS - Computed Values - // ============================================= - const hasTestSuite = Boolean( - testSuite?.id || selectedTableData?.testSuite?.id - ); - // Show select all test cases switch only when table has test suite and can create pipeline - const isSelectAllTestCasesEnabled = Boolean( - selectedTable && hasTestSuite && canCreatePipeline - ); - const shouldShowScheduler = selectedTable && canCreatePipeline; - const isFormLoading = loading || externalLoading; - - const pipelineSchedules = config?.limits?.config.featureLimits.find( - (feature) => feature.name === 'dataQuality' - )?.pipelineSchedules; - - const selectedTestLevel = useMemo(() => { - if (testLevelFieldValue === TestLevel.COLUMN_DIMENSION) { - return TestLevel.COLUMN; - } - - return testLevelFieldValue; - }, [testLevelFieldValue]); - - // ============================================= - // HOOKS - Memoized Values (grouped by functionality) - // ============================================= - // Scheduler options - const schedulerOptions = useMemo(() => { - if (isEmpty(pipelineSchedules) || !pipelineSchedules) { - return undefined; - } - - return getScheduleOptionsFromSchedules(pipelineSchedules); - }, [pipelineSchedules]); - - // Table & Column options - const columnOptions = useMemo(() => { - if (!selectedTableData?.columns) { - return []; - } - - return selectedTableData.columns.map((column) => ({ - label: column.name, - value: column.name, - data: column, - })); - }, [selectedTableData]); - - // Filtered options for dimension columns (excludes selected column) - const dimensionColumnOptions = useMemo(() => { - if (!selectedColumn) { - return columnOptions; - } - - return columnOptions.filter((option) => option.value !== selectedColumn); - }, [columnOptions, selectedColumn]); - - // Test type options - const testTypeOptions = useMemo( - () => - testDefinitions.map((testDef) => ({ - label: ( -
- - {getEntityName(testDef)} - - - {testDef.description} - -
- ), - value: testDef.fullyQualifiedName ?? '', - labelValue: getEntityName(testDef), - })), - [testDefinitions] - ); - - // Test definition capabilities - const isComputeRowCountFieldVisible = useMemo( - () => selectedTestDefinition?.supportsRowLevelPassedFailed ?? false, - [selectedTestDefinition] - ); - - const handleActiveField = useCallback( - (id: string) => { - // Only update if id matches pattern root/{any string} - if (/^root\/.+/.test(id)) { - setActiveField((pre) => { - if (pre !== id) { - return id; - } - - return pre; - }); - } - }, - [setActiveField] - ); - - // Parameter form rendering - const generateParamsField = useMemo(() => { - if (!selectedTestDefinition?.parameterDefinition) { - return null; - } - - return ( -
- handleActiveField( - selectedTestType ? `root/${selectedTestType}` : 'root/testType' - ) - }> - -
- ); - }, [selectedTestDefinition, selectedTableData, selectedTestType]); - - // Dynamic test name generation - const generateDynamicTestName = useCallback(() => { - const testType = selectedTestDefinition?.name || ''; - - // Don't generate if test type is missing - if (!testType) { - return ''; - } - - const randomString = cryptoRandomString({ - length: 4, - type: 'alphanumeric', - }); - - let dynamicName = ''; - - if (selectedTestLevel === TestLevel.TABLE) { - // Table level: tableName_testType_randomString - const tableName = selectedTableData?.name || selectedTable || 'table'; - dynamicName = `${tableName}_${testType}_${randomString}`; - } else if (selectedTestLevel === TestLevel.COLUMN && selectedColumn) { - // Column level: columnName_testType_randomString - dynamicName = `${selectedColumn}_${testType}_${randomString}`; - } - - // Replace spaces and special characters with underscores - let finalName = snakeCase(dynamicName); - - // Check length limit - if (finalName.length > MAX_NAME_LENGTH) { - // Fallback to testType_randomString if too long - finalName = snakeCase(`${testType}_${randomString}`); - } - - return finalName; - }, [ - selectedTableData, - selectedTable, - selectedColumn, - selectedTestDefinition, - selectedTestLevel, - ]); - - // Form field configurations (grouped by form section) - const testDetailsFormFields: FieldProp[] = useMemo( - () => [ - { - name: 'testName', - required: false, - label: t('label.name'), - id: 'root/name', - type: FieldTypes.TEXT, - placeholder: t('message.enter-test-case-name'), - rules: [ - { - pattern: TEST_CASE_NAME_REGEX, - message: t('message.test-case-name-validation'), - }, - { - max: MAX_NAME_LENGTH, - message: t('message.entity-maximum-size', { - entity: t('label.name'), - max: MAX_NAME_LENGTH, - }), - }, - { - validator: (_, value) => { - if (value && existingTestCases.includes(value)) { - return Promise.reject( - t('message.entity-already-exists', { - entity: t('label.name'), - }) - ); - } - - return Promise.resolve(); - }, - }, - ], - props: { - 'data-testid': 'test-case-name', - onChange: () => setIsTestNameManuallyEdited(true), - }, - }, - { - name: 'description', - required: false, - label: t('label.description'), - id: 'root/description', - type: FieldTypes.DESCRIPTION, - props: { - 'data-testid': 'description', - initialValue: '', - style: { margin: 0 }, - }, - }, - { - name: 'tags', - required: false, - label: t('label.tag-plural'), - id: 'tags', - type: FieldTypes.TAG_SUGGESTION, - props: { - selectProps: { - 'data-testid': 'tags-selector', - getPopupContainer, - maxTagCount: 8, - id: 'root/tags', - }, - newLook: true, - }, - }, - { - name: 'glossaryTerms', - required: false, - label: t('label.glossary-term-plural'), - id: 'glossaryTerms', - type: FieldTypes.TAG_SUGGESTION, - props: { - selectProps: { - 'data-testid': 'glossary-terms-selector', - getPopupContainer, - maxTagCount: 8, - id: 'root/glossaryTerms', - }, - open: false, - hasNoActionButtons: true, - newLook: true, - isTreeSelect: true, - tagType: TagSource.Glossary, - placeholder: t('label.select-field', { - field: t('label.glossary-term-plural'), - }), - }, - }, - ], - [existingTestCases, setIsTestNameManuallyEdited] - ); - - const computeRowCountField: FieldProp[] = useMemo( - () => [ - { - name: 'computePassedFailedRowCount', - label: t('label.compute-row-count'), - type: FieldTypes.SWITCH, - helperText: t('message.compute-row-count-helper-text'), - required: false, - props: { 'data-testid': 'compute-passed-failed-row-count' }, - id: 'root/computePassedFailedRowCount', - formItemLayout: FormItemLayout.HORIZONTAL, - newLook: true, - }, - ], - [] - ); - - const schedulerFormFields: FieldProp[] = useMemo( - () => [ - { - name: 'pipelineName', - label: t('label.name'), - type: FieldTypes.TEXT, - required: false, - placeholder: t('label.enter-entity', { entity: t('label.name') }), - props: { 'data-testid': 'pipeline-name' }, - id: 'root/pipelineName', - }, - ], - [] - ); - - // ============================================= - // HOOKS - Callbacks (grouped by functionality) - // ============================================= - // Pipeline-related callbacks - const checkExistingPipelines = useCallback( - async (testSuiteFqn: string) => { - try { - const { paging } = await getIngestionPipelines({ - testSuite: testSuiteFqn, - pipelineType: [PipelineType.TestSuite], - arrQueryFields: ['id'], - limit: 0, - }); - setCanCreatePipeline(paging.total === 0); - } catch { - setCanCreatePipeline(true); - } - }, - [ingestionPipeline] - ); - - // Form interaction callbacks - const handleCancel = useCallback(() => { - onCancel?.(); - }, [onCancel]); - - const handleValuesChange = useCallback( - (changedValues: Partial) => { - if (changedValues.testTypeId) { - setSelectedTestType(changedValues.testTypeId); - const testDef = testDefinitions.find( - (definition) => - definition.fullyQualifiedName === changedValues.testTypeId - ); - setSelectedTestDefinition(testDef); - } - }, - [testDefinitions] - ); - - const handleTestDefinitionChange = useCallback( - (value: string) => { - const testDefinition = testDefinitions.find( - (definition) => definition.fullyQualifiedName === value - ); - setSelectedTestDefinition(testDefinition); - setActiveField(() => `root/${value}`); - }, - [testDefinitions] - ); - - // Action buttons rendering - const renderActionButtons = useMemo( - () => ( - - - - - ), - [isFormLoading, isCheckingPermissions, handleCancel, form, t] - ); - - // API-related callbacks - const fetchTables = useCallback( - async (searchValue = '', page = 1) => { - // Skip API call if table is provided via props - if (table) { - return { - data: [ - { - label: table.fullyQualifiedName, - value: table.fullyQualifiedName, - data: table, - }, - ], - paging: { total: 1 }, - }; - } - - try { - const response = await searchQuery({ - query: searchValue ? `*${searchValue}*` : '*', - pageNumber: page, - pageSize: PAGE_SIZE_MEDIUM, - searchIndex: SearchIndex.TABLE, - fetchSource: true, - trackTotalHits: true, - }); - - const data = response.hits.hits.map((hit) => { - setTablesCache((prev) => { - const newCache = new Map(prev); - newCache.set( - hit._source.fullyQualifiedName ?? hit._source.name, - hit._source - ); - - return newCache; - }); - - return { - label: hit._source.fullyQualifiedName, - value: hit._source.fullyQualifiedName, - onclick: () => { - handleActiveField('root/selected-entity'); - }, - data: hit._source, - }; - }); - - return { - data, - paging: { total: response.hits.total.value }, - }; - } catch { - return { data: [], paging: { total: 0 } }; - } - }, - [table] - ); - - const fetchTestDefinitions = useCallback( - async (columnType?: string) => { - try { - // Derive service type from table for filtering - const serviceType = getServiceTypeForTestDefinition( - selectedTableData || table - ); - - const { data } = await getListTestDefinitions({ - limit: PAGE_SIZE_LARGE, - entityType: - selectedTestLevel === TestLevel.COLUMN - ? EntityType.Column - : EntityType.Table, - testPlatform: TestPlatform.OpenMetadata, - supportedDataType: columnType, - supportedService: serviceType, - }); - setTestDefinitions(data); - } catch { - setTestDefinitions([]); - } - }, - [selectedTestLevel, selectedTableData, table] - ); - - const fetchSelectedTableData = useCallback(async (tableFqn: string) => { - if (table) { - setSelectedTableData(table); - - return; - } - - try { - const tableData = await getTableDetailsByFQN(tableFqn, { - fields: 'columns,testSuite', - }); - setSelectedTableData(tableData); - } catch (error) { - setSelectedTableData(undefined); - } - }, []); - - const fetchExistingTestCases = useCallback(async () => { - if (!hasTestSuite || (!selectedTableData && !selectedTable)) { - setExistingTestCases([]); - - return; - } - - try { - const entityFqn = selectedTableData?.fullyQualifiedName || selectedTable; - if (!entityFqn) { - setExistingTestCases([]); - - return; - } - - const { data } = await getListTestCaseBySearch({ - limit: PAGE_SIZE_LARGE, - entityLink: `<#E::table::${entityFqn}>`, - }); - - setExistingTestCases(data.map((testCase) => testCase.name)); - } catch { - setExistingTestCases([]); - } - }, [selectedTableData, selectedTable, hasTestSuite]); - - // Permission checking callback - const checkTablePermissions = useCallback( - async (tableFqn: string) => { - if (testCase.Create) { - return Promise.resolve(); - } - - setIsCheckingPermissions(true); - try { - const permissions = await getEntityPermissionByFqn( - ResourceEntity.TABLE, - tableFqn - ); - const canCreate = permissions.EditAll || permissions.EditTests; - - setCanCreatePipeline(canCreate); - - if (!canCreate) { - // Return false to trigger validation error - return Promise.reject( - t('message.no-permission-for-create-test-case-on-table') - ); - } - - return Promise.resolve(); - } catch (error) { - // On permission check error, allow creation - return Promise.resolve(); - } finally { - setIsCheckingPermissions(false); - } - }, - [getEntityPermissionByFqn, t] - ); - - // Utility callbacks - const getSelectedTestDefinition = useCallback(() => { - return testDefinitions.find( - (definition) => definition.fullyQualifiedName === selectedTestType - ); - }, [selectedTestType, testDefinitions]); - - const createTestCaseObj = useCallback( - (value: FormValues): CreateTestCase => { - const selectedDefinition = getSelectedTestDefinition(); - const columnName = selectedColumn; - - const name = value.testName?.trim() || generateDynamicTestName(); - - const entityFqn = - selectedTableData?.fullyQualifiedName || - selectedTable || - table?.fullyQualifiedName || - ''; - const isColumnLevel = selectedTestLevel === TestLevel.COLUMN; - const entityLink = generateEntityLink( - isColumnLevel ? `${entityFqn}.${columnName}` : entityFqn, - isColumnLevel - ); - - return { - name, - displayName: name, - computePassedFailedRowCount: value.computePassedFailedRowCount, - entityLink, - testDefinition: value.testTypeId ?? '', - dimensionColumns: - value.testLevel === TestLevel.COLUMN_DIMENSION - ? value.dimensionColumns - : undefined, - topDimensions: - value.testLevel === TestLevel.COLUMN_DIMENSION - ? value.topDimensions - : undefined, - description: isEmpty(value.description) ? undefined : value.description, - tags: [...(value.tags ?? []), ...(value.glossaryTerms ?? [])], - ...testCaseClassBase.getCreateTestCaseObject( - value as TestCaseFormType, - selectedDefinition - ), - }; - }, - [ - getSelectedTestDefinition, - selectedTableData, - selectedTable, - table, - selectedColumn, - selectedTestType, - selectedTestLevel, - ] - ); - - const handleSubmit = useCallback( - async (values: FormValues) => { - setLoading(true); - setErrorMessage(''); - try { - const testCaseObj = createTestCaseObj(values); - const createdTestCase = await createTestCase(testCaseObj); - - // Update current count when Create / Delete operation performed - await getResourceLimit('dataQuality', true, true); - const testSuiteResponse = createdTestCase.testSuite ?? testSuite; - - // Pipeline Creation Logic: - // Pipeline will be created when ALL conditions are met: - // 1. canCreatePipeline is true, which happens when: - // - Table has NO existing test suite (test suite will be created automatically) - // - Table has test suite with NO existing pipelines (count = 0) - // 2. A test suite exists (either provided or newly created) - // 3. User has configured scheduler (cron value for scheduled, undefined for onDemand) - // - // Pipeline will NOT be created when: - // - No table is selected - // - Table has test suite with existing pipelines - // - canCreatePipeline is false - if (testSuiteResponse && canCreatePipeline) { - const selectedTestCases = normalizeSelectedTestProp(values.testCases); - const tableName = replaceAllSpacialCharWith_( - selectedTable || table?.fullyQualifiedName || '' - ); - const updatedName = - values.pipelineName || - getIngestionName(tableName, PipelineType.TestSuite); - - const ingestionPayload: CreateIngestionPipeline = { - airflowConfig: { - scheduleInterval: values.cron, - }, - displayName: updatedName, - name: generateUUID(), - loggerLevel: values.enableDebugLog - ? LogLevels.Debug - : LogLevels.Info, - pipelineType: PipelineType.TestSuite, - raiseOnError: values.raiseOnError ?? true, - service: { - id: testSuiteResponse.id ?? '', - type: 'testSuite', - }, - sourceConfig: { - config: { - type: ConfigType.TestSuite, - entityFullyQualifiedName: testSuiteResponse.fullyQualifiedName, - testCases: - values?.selectAllTestCases === false - ? [createdTestCase.name, ...selectedTestCases] - : undefined, - }, - }, - }; - - const ingestion = await addIngestionPipeline(ingestionPayload); - if (isAirflowAvailable && ingestionPipeline.EditAll) { - await deployIngestionPipelineById(ingestion.id ?? ''); - } - } - - showSuccessToast( - t('server.create-entity-success', { - entity: t('label.test-case'), - }) - ); - - onFormSubmit?.(createdTestCase); - onCancel?.(); - } catch (error) { - // Show inline error alert for drawer mode - const errorMsg = - (error as AxiosError<{ message: string }>)?.response?.data?.message || - t('server.create-entity-error', { - entity: t('label.test-case'), - }); - setErrorMessage(errorMsg); - } finally { - setLoading(false); - } - }, - [createTestCaseObj, testSuite, selectedTable, table, onFormSubmit, onCancel] - ); - - const handleFieldFocus = useCallback( - (event: FocusEvent) => { - if (event.target.id) { - handleActiveField(event.target.id); - } - }, - [handleActiveField] - ); - - // ============================================= - // EFFECT HOOKS - // ============================================= - - // Handle test level changes - useEffect(() => { - if (selectedTestLevel) { - fetchTestDefinitions(); - form.setFieldsValue({ - testTypeId: undefined, - selectedColumn: - selectedTestLevel === TestLevel.TABLE - ? undefined - : form.getFieldValue('selectedColumn'), - }); - setSelectedTestDefinition(undefined); - setIsCustomQuery(false); - } - }, [selectedTestLevel, fetchTestDefinitions, form]); - - // Handle table selection: use cached data or fetch if needed - useEffect(() => { - if (selectedTable) { - const cachedTableData = tablesCache.get(selectedTable); - if (cachedTableData) { - setSelectedTableData(convertSearchSourceToTable(cachedTableData)); - } else { - fetchSelectedTableData(selectedTable); - } - } else { - setSelectedTableData(table); - } - form.setFieldsValue({ - selectedColumn: undefined, - dimensionColumns: undefined, - topDimensions: undefined, - }); - }, [selectedTable, table, tablesCache, fetchSelectedTableData, form]); - - // Fetch existing test cases when table data is available - useEffect(() => { - fetchExistingTestCases(); - }, [fetchExistingTestCases]); - - // Handle column selection and fetch test definitions with column type - useEffect(() => { - if ( - selectedColumn && - selectedTableData && - selectedTestLevel === TestLevel.COLUMN - ) { - const selectedColumnData = selectedTableData.columns?.find( - (column) => column.name === selectedColumn - ); - - if (selectedColumnData?.dataType !== currentColumnType) { - fetchTestDefinitions(selectedColumnData?.dataType); - setCurrentColumnType(selectedColumnData?.dataType); - } - } - - // Reset dimensionColumns when selectedColumn changes - form.setFieldValue('dimensionColumns', undefined); - form.setFieldValue('topDimensions', undefined); - }, [ - selectedColumn, - selectedTableData, - currentColumnType, - selectedTestLevel, - fetchTestDefinitions, - form, - ]); - - // Check for existing pipelines when table is selected - useEffect(() => { - // Early return if user doesn't have permission to create pipelines or Early return if no table is selected - if (!ingestionPipeline.Create || !selectedTable) { - setCanCreatePipeline(false); - - return; - } - - // Get the test suite FQN from either the table data or provided test suite - const testSuiteFqn = - selectedTableData?.testSuite?.fullyQualifiedName || - testSuite?.fullyQualifiedName; - - if (testSuiteFqn) { - // Check for existing pipelines if we have a test suite - checkExistingPipelines(testSuiteFqn); - } else { - // No test suite exists - can create pipeline (test suite will be created) - setCanCreatePipeline(true); - } - }, [ - selectedTableData?.testSuite?.fullyQualifiedName, - testSuite?.fullyQualifiedName, - selectedTable, - checkExistingPipelines, - ingestionPipeline, - ]); - - // Initialize manual edit flag - useEffect(() => { - // Reset manual edit flag for new test case - setIsTestNameManuallyEdited(false); - }, []); - - // Auto-generate test name when inputs change - useEffect(() => { - if ( - selectedTable && - selectedTestDefinition && - selectedTestLevel && - !isTestNameManuallyEdited // Don't override if user has manually edited the name - ) { - const dynamicName = generateDynamicTestName(); - if (dynamicName) { - form.setFieldValue('testName', dynamicName); - } - } - }, [ - selectedTable, - selectedColumn, - selectedTestDefinition, - selectedTestLevel, - generateDynamicTestName, - isTestNameManuallyEdited, - ]); - - // ============================================= - // RENDER - // ============================================= - const formContent = ( -
- {/* Floating Error Alert - always visible at top */} - {errorMessage && ( -
- setErrorMessage('')}> - {errorMessage} - -
- )} - -
- - - handleActiveField('root/testLevel')} - /> - - { - if (value && !table) { - // Only check permissions if table is not provided via props - return checkTablePermissions(value); - } - - return Promise.resolve(); - }, - }, - ]}> - - handleActiveField(value ? `root/selected-entity` : 'root/table') - } - /> - - - {selectedTestLevel === TestLevel.COLUMN && ( - - - - )} - {testLevelFieldValue === TestLevel.COLUMN_DIMENSION && ( - - - - )} - - - - - {selectedTestLevel === TestLevel.TABLE && ( -
- {isCustomQuery ? ( - <> - - {t('label.test-type')} - - - - ) : ( - - )} -
- )} -
- )) -); - -jest.mock('../AddTestCaseList/AddTestCaseList.component', () => ({ - AddTestCaseList: jest - .fn() - .mockImplementation(({ selectedTest, onChange }) => ( -
-
Selected tests: {selectedTest?.length || 0}
- -
- )), -})); - -jest.mock('../../../components/common/RichTextEditor/RichTextEditor', () => - forwardRef( - jest - .fn() - .mockImplementation(({ onChange, initialValue, ...props }) => ( -