import { EventEmitter, ChangeDetectorRef, OnInit, OnChanges, SimpleChanges } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { TestCaseDetailsConfigSection, TestCaseDetailsMetadataItem } from '../test-case-details.models'; import { DynamicSelectFieldConfig, SelectOption } from '../../dynamic-select/dynamic-select-field.component'; import { DropdownOption } from '../../dropdown-button/dropdown-button.component'; import { RadioCardOption } from '../../radio-card-group/radio-card-option.model'; import * as i0 from "@angular/core"; declare type ViewportMode = 'desktop' | 'laptop' | 'tablet' | 'mobile' | 'custom'; /** Override config for a specific select. Use for server-side search, load more, custom options. */ export interface SelectConfigOverride { /** Replace options (e.g. from API). Update when API returns. */ options?: SelectOption[]; /** Enable server-side search; component emits selectSearch instead of local filtering. */ serverSearch?: boolean; /** Indicates more results available for infinite scroll. */ hasMore?: boolean; /** Loading state (e.g. during API call). */ isLoading?: boolean; /** Enable search input in the select. */ searchable?: boolean; /** When true, triggers initial search on panel open (serverSearch mode). */ initialFetchOnOpen?: boolean; /** Callback when user types in search. Call API, then update options via selectConfigOverrides. */ onSearch?: (query: string) => void; /** Callback when user scrolls to load more. Call API, append options via selectConfigOverrides. */ onLoadMore?: (query?: string) => void; } /** Map of select key -> config override. Enables API-driven options, infinite search, load more. */ export declare type SelectConfigOverrides = Partial>; /** Keys for each dynamic select in test-case-details-edit. Use these with selectConfigOverrides. */ export declare const TEST_CASE_DETAILS_SELECT_KEYS: { readonly status: "status"; readonly priority: "priority"; readonly type: "type"; readonly labels: "labels"; readonly prerequisiteCases: "prerequisiteCases"; readonly testDataProfile: "testDataProfile"; readonly testDataSet: "testDataSet"; readonly videoRecording: "videoRecording"; readonly enableAiSmartness: "enableAiSmartness"; readonly defaultAiAction: "defaultAiAction"; readonly knowledgeBaseDefaultTestCase: "knowledgeBaseDefaultTestCase"; readonly useAiMetadata: "useAiMetadata"; readonly defaultBrowser: "defaultBrowser"; readonly defaultViewport: "defaultViewport"; readonly deviceType: "deviceType"; readonly deviceOS: "deviceOS"; }; export interface TestCaseDetailsEditFormData { descriptionContent: string; status: string; priority: string; type?: string | number; labels: string[]; testDataProfileId?: number | string | null; testDataSetIndex?: number | string | null; configSections: TestCaseDetailsConfigSection[]; configSectionsRow2: TestCaseDetailsConfigSection[]; /** "Use mock API responses" row state. Mutually exclusive with `apiMockingStoreMock` when true. */ apiMockingRestoreMock?: boolean; /** "Renew and store API responses" row state. Mutually exclusive with `apiMockingRestoreMock` when true. */ apiMockingStoreMock?: boolean; } export declare class TestCaseDetailsEditComponent implements OnInit, OnChanges { private cdr; descriptionTitle: string; descriptionContent: string; /** When true, description uses Trix rich text editor (Bold, Italic, etc.). Host app must load Trix. */ enableMarkdown: boolean; metadataItems: TestCaseDetailsMetadataItem[]; labels: string[]; configTitle: string; configSections: TestCaseDetailsConfigSection[]; configSectionsRow2: TestCaseDetailsConfigSection[]; isSaving: boolean; /** Optional list of prerequisite test case options for the multi-select. If not provided, uses default sample options. */ prerequisiteCaseOptions: { value: string; name: string; }[]; /** Platform: 'web' shows Default Browser + Viewport; 'mobile' shows Device Type + OS. Defaults to 'web'. */ platform: 'web' | 'mobile'; /** When true, hides Priority, Type, and Test Data Set fields (step groups don't have these). Defaults to false. */ isStepGroup: boolean; /** * Override config per select key. Use for: * - API-driven options: pass options array (update when API returns) * - Server-side search: serverSearch: true, onSearch in override or listen to selectSearch * - Infinite scroll: hasMore: true, onLoadMore in override or listen to selectLoadMore * - Initial fetch on open: initialFetchOnOpen: true */ selectConfigOverrides: SelectConfigOverrides; showApiMockingCard: boolean; apiMockingTitle: string; apiMockingStatusLabel: string; apiMockingCaptureLabel: string; apiMockingCaptureHint: string; apiMockingRenewLabel: string; apiMockingRenewHint: string; /** * Single source of truth for the card's dual toggle state. * true → Renew ON, Capture OFF * false → Renew OFF, Capture ON */ apiMockingRestoreMock: boolean; /** "Renew and store API responses" — mutually exclusive with `apiMockingRestoreMock` when true. */ apiMockingStoreMock: boolean; apiMockingMockedApisCount: number; apiMockingTotalApisCount: number; apiMockingProgressPercent: number; /** Forwarded to `cqa-api-mocking-card`. In edit mode the card hides the block anyway, but * we still pipe the input through for symmetry with the read-only component. */ apiMockingShowProgress: boolean; apiMockingSummaryText?: string; apiMockingPercentText?: string; /** Org-level default for Test Case Timeout (minutes). Used to flag the input as "ORG level" vs "Custom". */ orgLevelTestCaseTimeout?: string | number | null; /** Viewport dropdown options per category from the API. Pass DESKTOP, LAPTOP, TABLET, MOBILE arrays. */ viewportCategoryOptions: { DESKTOP?: SelectOption[]; LAPTOP?: SelectOption[]; TABLET?: SelectOption[]; MOBILE?: SelectOption[]; }; save: EventEmitter; cancel: EventEmitter; /** Emitted when user searches in a select (serverSearch mode). Call API and update options via selectConfigOverrides. */ selectSearch: EventEmitter<{ key: string; query: string; }>; /** Emitted when user scrolls to load more. Call API, append to options via selectConfigOverrides. */ selectLoadMore: EventEmitter<{ key: string; query: string; }>; /** Emitted when a select panel is opened. Use to call API for initial load (e.g. when initialFetchOnOpen). */ selectOpened: EventEmitter<{ key: string; }>; /** Emitted when selection changes in any select. */ selectionChange: EventEmitter<{ key: string; value: unknown; }>; /** Emitted when user adds a new custom label via the "New" option. */ labelAdded: EventEmitter; /** Emitted when the user flips the "Use mock API responses" toggle. */ apiMockingRestoreMockChange: EventEmitter; /** Emitted when the user flips the "Renew and store API responses" toggle. */ apiMockingStoreMockChange: EventEmitter; /** Emitted when the user clicks "Configure Mock APIs" on the embedded card in edit mode. */ configureApiMocking: EventEmitter; constructor(cdr: ChangeDetectorRef); /** Form state */ editDescription: string; editStatus: string; editPriority: string; editLabels: string[]; /** Local edit-mode mirror of the `restoreMock` boolean. Seeded from @Input() on init/changes. */ editApiMockingRestoreMock: boolean; /** Local edit-mode mirror of the `storeMock` boolean. */ editApiMockingStoreMock: boolean; testCaseTimeout: string; /** 'org' → input disabled, payload sends null for testcaseTimeout; 'custom' → input enabled, payload sends the typed value. */ testCaseTimeoutMode: 'org' | 'custom'; waitTimeoutLocators: string; autoWaitEnabled: boolean; retryFailedSteps: string; configExpanded: boolean; executionExpanded: boolean; aiConfigExpanded: boolean; waitsRetriesExpanded: boolean; deviceExpanded: boolean; keyFlagsExpanded: boolean; mobileTestingEnabled: boolean; extensionUseEnabled: boolean; dataDrivenEnabled: boolean; viewportMode: ViewportMode; viewportDesktopDeviceForm: FormGroup; viewportLaptopDeviceForm: FormGroup; viewportTabletDeviceForm: FormGroup; viewportMobileDeviceForm: FormGroup; customViewportWidth: string; customViewportHeight: string; customViewportTags: string[]; readonly viewportModeOptions: RadioCardOption[]; desktopViewportConfig: DynamicSelectFieldConfig; laptopViewportConfig: DynamicSelectFieldConfig; tabletViewportConfig: DynamicSelectFieldConfig; mobileViewportConfig: DynamicSelectFieldConfig; readonly frequentlyUsedLabels: string[]; private _initialFormSnapshot; /** FormGroup for cqa-dynamic-select bindings */ editForm: FormGroup; get statusItem(): TestCaseDetailsMetadataItem | undefined; get priorityItem(): TestCaseDetailsMetadataItem | undefined; get typeItem(): TestCaseDetailsMetadataItem | undefined; get statusOptions(): string[]; get priorityOptions(): string[]; /** Cached configs to avoid new object refs each change detection (prevents infinite loops) */ readonly statusSelectConfig: DynamicSelectFieldConfig; readonly typeSelectConfig: DynamicSelectFieldConfig; readonly testDataProfileSelectConfig: DynamicSelectFieldConfig; readonly testDataSetSelectConfig: DynamicSelectFieldConfig; private readonly defaultPrerequisiteCaseOptions; readonly videoRecordingSelectConfig: DynamicSelectFieldConfig; readonly aiMetadataCollectionSelectConfig: DynamicSelectFieldConfig; /** Cached labels config to avoid new object on every CD (prevents freeze) */ private _labelsSelectConfigCache; private _labelsSelectConfigDirty; /** Labels multi-select: options = frequently used + current + API options from selectConfigOverrides */ get labelsSelectConfig(): DynamicSelectFieldConfig; prerequisiteCaseSelectConfig: DynamicSelectFieldConfig; readonly defaultViewportSelectConfig: DynamicSelectFieldConfig; readonly deviceTypeSelectConfig: DynamicSelectFieldConfig; readonly deviceOSSelectConfig: DynamicSelectFieldConfig; readonly defaultBrowserSelectConfig: DynamicSelectFieldConfig; readonly prioritySelectConfig: DynamicSelectFieldConfig; readonly enableAiSmartnessSelectConfig: DynamicSelectFieldConfig; readonly defaultAiActionSelectConfig: DynamicSelectFieldConfig; readonly knowledgeBaseDefaultTestCaseSelectConfig: DynamicSelectFieldConfig; /** * Returns merged config for a select: base config + override. * Wires onSearch, onLoadMore to both override callbacks and output events. */ getConfigForSelect(key: string, baseConfig: DynamicSelectFieldConfig): DynamicSelectFieldConfig; onSelectOpened(key: string): void; onSelectSearch(event: { key: string; query: string; }): void; onSelectLoadMore(event: { key: string; query: string; }): void; onSelectionChange(event: { key: string; value: unknown; }): void; onLabelsAddCustomValue(event: { key: string; value: string; }): void; private getConfigItemValue; /** Get value from Device section - supports both 'Device' and 'Device Setting' titles */ private getDeviceConfigValue; /** Get value from Waits section - supports both 'Wait and retries' and 'Waits & Retries' titles */ private getWaitsRetriesValue; /** Strip trailing 's' from value (e.g. "10s" -> "10") for display in timeout inputs */ private stripTrailingUnitS; readonly testCaseTimeoutModeOptions: DropdownOption[]; /** Value shown in the disabled (org) or enabled (custom) Test Case Timeout input. */ get testCaseTimeoutDisplayValue(): string; onTestCaseTimeoutModeChange(mode: 'org' | 'custom'): void; /** True when the portal wrapped the Test Case Timeout value as "Org Level (...)", meaning the TC API returned null. */ private isTestCaseTimeoutFromOrg; /** Allow only digits; used for Retry Failed Steps, Test Case Timeout, Wait Timeout inputs */ onlyDigits(val: string): string; /** For update: use "0" when value is empty so API gets a number */ private emptyNumToZero; private getPrerequisiteCasesFromConfig; /** Edit mode should show placeholder when dataset is not selected. */ private normalizeTestDataSetRawValue; get hasPrerequisiteCaseConfig(): boolean; private initViewportFromValue; private buildViewportValue; onViewportModeChange(mode: ViewportMode): void; private applyViewportCategoryOptions; addViewportCustomTag(): void; removeViewportCustomTag(index: number): void; ngOnInit(): void; get hasUnsavedChanges(): boolean; private buildSavePayload; /** * Handler bound to the embedded `` `restoreMockChange` output. * Keeps the local edit-mode mirror in sync (including the mutual-exclusivity rule — * turning Use-mock on forces store-mock off) and re-emits to the parent so the save * payload reflects the new state. */ onApiMockingRestoreMockChange(value: boolean): void; /** Mirror handler for the "Renew and store API responses" toggle. Mutually exclusive with Use-mock. */ onApiMockingStoreMockChange(value: boolean): void; private resolveToOptionValue; private normalizeBooleanSelectValue; ngOnChanges(changes: SimpleChanges): void; onRemoveLabel(label: string): void; onClearAllLabels(): void; onAddFrequentLabel(label: string): void; onSave(): void; private mergeConfigSections; private mergeConfigSectionsRow2; onCancel(): void; trackByLabel(_i: number, label: string): string; trackByConfigTitle(_i: number, section: TestCaseDetailsConfigSection): string; /** Current labels use consistent indigo style */ private readonly LABEL_CHIP_STYLE; getCurrentLabelChipStyle(_label: string): { [key: string]: string; }; getLabelCloseIconColor(_label: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};