From 960ab61a736bac42a51e671369a59b1a0f48b9e8 Mon Sep 17 00:00:00 2001 From: AndyKIron Date: Tue, 3 Oct 2023 12:58:05 +0300 Subject: [PATCH 01/19] feat(storybook): up storybook version --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ce3560215..278962cd5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ Help us keep FusionUI open and inclusive. Please read and follow our [Code of Conduct][coc]. -## Got a Question or Problem? +## Got a Question or Problem? Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. Instead, we recommend email us to [fusion@is.com](mailto://fusion@is.com) or contact us on our Slack channel: [fusion-ui-community](https://superops.slack.com/app_redirect?channel=CR47GLKHQ) From a0b394f2001e6a46eb543c6cf87152897d356d68 Mon Sep 17 00:00:00 2001 From: AndyKIron Date: Wed, 4 Oct 2023 14:10:06 +0300 Subject: [PATCH 02/19] chore(isct-13): start add tests attributes --- .../common/base/chip-filter.base.component.ts | 4 ++++ .../chip-filter/v3/chip-filter.component.html | 2 +- .../chip-filter/v3/chip-filter.component.stories.ts | 3 ++- .../v3/stories/chip-filters.component.stories.ts | 12 +++++++----- .../dropdown-dual-multi-select.base.component.html | 4 +++- .../dropdown-dual-multi-select.base.component.ts | 4 ++++ .../dropdown-dual-multi-select-body.component.html | 1 + .../dropdown-dual-multi-select-body.component.ts | 4 ++++ .../dropdown-dual-multi-select-header.component.html | 1 + .../dropdown-dual-multi-select-header.component.ts | 3 +++ projects/fusion-ui/entities/public-api.ts | 1 + projects/fusion-ui/entities/test-ids-modifiers.ts | 10 ++++++++++ 12 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 projects/fusion-ui/entities/test-ids-modifiers.ts diff --git a/projects/fusion-ui/components/chip-filter/common/base/chip-filter.base.component.ts b/projects/fusion-ui/components/chip-filter/common/base/chip-filter.base.component.ts index 2add68b5a..cc006049a 100644 --- a/projects/fusion-ui/components/chip-filter/common/base/chip-filter.base.component.ts +++ b/projects/fusion-ui/components/chip-filter/common/base/chip-filter.base.component.ts @@ -24,9 +24,11 @@ import { } from './chip-filter-component-configurations'; import {takeUntil} from 'rxjs/operators'; import {ApiBase} from '@ironsource/fusion-ui/components/api-base'; +import {ChipFilterTestIdModifiers} from '@ironsource/fusion-ui'; @Directive() export abstract class ChipFilterBaseComponent implements OnInit, AfterViewInit, OnDestroy, AfterContentInit { + @Input() testId: string; /** @internal */ @ContentChild(ApiBase, {static: true}) apiBase: ApiBase; /** @internal */ @@ -47,6 +49,8 @@ export abstract class ChipFilterBaseComponent implements OnInit, AfterViewInit, /** @internal */ rightIcon: ChipIcon; + testIdChipFilterModifiers: typeof ChipFilterTestIdModifiers = ChipFilterTestIdModifiers; + private onDestroy$ = new Subject(); private restListeners$ = new Subject(); private clearClickSubscription$ = merge(this.onDestroy$, this.restListeners$); diff --git a/projects/fusion-ui/components/chip-filter/v3/chip-filter.component.html b/projects/fusion-ui/components/chip-filter/v3/chip-filter.component.html index f5fefd18e..2d4a9bae9 100644 --- a/projects/fusion-ui/components/chip-filter/v3/chip-filter.component.html +++ b/projects/fusion-ui/components/chip-filter/v3/chip-filter.component.html @@ -14,7 +14,7 @@ - + diff --git a/projects/fusion-ui/components/chip-filter/v3/chip-filter.component.stories.ts b/projects/fusion-ui/components/chip-filter/v3/chip-filter.component.stories.ts index d30716de0..dddee0582 100644 --- a/projects/fusion-ui/components/chip-filter/v3/chip-filter.component.stories.ts +++ b/projects/fusion-ui/components/chip-filter/v3/chip-filter.component.stories.ts @@ -574,13 +574,14 @@ export const DateRangeWithIcon = { const ChipFilterIncludeExcludeTemplate: StoryFn = (args: ChipFilterComponent) => ({ props: {...args}, template: `
- +
diff --git a/projects/fusion-ui/components/chip-filters/v3/stories/chip-filters.component.stories.ts b/projects/fusion-ui/components/chip-filters/v3/stories/chip-filters.component.stories.ts index 9afa57c29..ea6415db3 100644 --- a/projects/fusion-ui/components/chip-filters/v3/stories/chip-filters.component.stories.ts +++ b/projects/fusion-ui/components/chip-filters/v3/stories/chip-filters.component.stories.ts @@ -408,7 +408,7 @@ const FilterPanelTemplate: StoryFn = (args: ChipFiltersCom [disableAddFilter]="disableAddFilter" [isSearch]="isSearch" > - +
= (args: ChipFiltersCom
- +
= (args: ChipFiltersCom
- +
- +
= (args: ChipFiltersCom >
- +
-
{{ title + ': ' }}{{ selected$ | async }}
+
{{ title + ': ' }}{{ selected$ | async }}
diff --git a/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.ts b/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.ts index 6a6ab15b4..028231bab 100644 --- a/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.ts +++ b/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.ts @@ -9,6 +9,7 @@ import {ApiBase} from '@ironsource/fusion-ui/components/api-base'; import {UniqueIdService} from '@ironsource/fusion-ui/services/unique-id'; import {BackendPagination, SelectedItemName} from '@ironsource/fusion-ui/components/dropdown'; import {isNullOrUndefined} from '@ironsource/fusion-ui/utils'; +import {IncludeExcludeTestIdModifiers} from '@ironsource/fusion-ui/entities'; const CLASS_LIST = [ 'dual-select-button', @@ -31,6 +32,7 @@ export abstract class DropdownDualMultiSelectBaseComponent extends ApiBase imple /** @internal */ @Input() autoComplete: boolean = true; @Input() title: string; + @Input() testId: string; /** @internal */ @Input() pendingItems: boolean = false; /** @internal */ @@ -43,6 +45,8 @@ export abstract class DropdownDualMultiSelectBaseComponent extends ApiBase imple return this._hasSelectAll; } + testIdIncludeExcludeModifiers: typeof IncludeExcludeTestIdModifiers = IncludeExcludeTestIdModifiers; + @Input() set placeholder(data: string) { this.placeholder$.next(data); this.defaultPlaceHolder = data; diff --git a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.html b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.html index 9a84fa835..3fe748e08 100644 --- a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.html +++ b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.html @@ -21,6 +21,7 @@
Clear all
diff --git a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.ts b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.ts index 598f0d5f8..2145ceb44 100644 --- a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.ts +++ b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.ts @@ -15,6 +15,7 @@ import {BehaviorSubject, combineLatest, fromEvent, Observable, of, Subject} from import {debounceTime, filter, map, scan, takeUntil, tap} from 'rxjs/operators'; import {ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR} from '@angular/forms'; import {isNullOrUndefined} from '@ironsource/fusion-ui/utils'; +import {IncludeExcludeTestIdModifiers} from '@ironsource/fusion-ui'; const PAGINATION_CHUNK = 20; @@ -47,6 +48,7 @@ export class DropdownDualMultiSelectBodyComponent implements OnInit, OnDestroy, @Input() totalItems: number; @Input() isPendingItems: boolean; @Input() hasSelectAll: boolean = true; + @Input() testId: string; @Input() set items(data: DropdownOption[]) { this.options$.next(data || []); @@ -71,6 +73,8 @@ export class DropdownDualMultiSelectBodyComponent implements OnInit, OnDestroy, @Output() scrollDown = new EventEmitter(); + testIdIncludeExcludeModifiers: typeof IncludeExcludeTestIdModifiers = IncludeExcludeTestIdModifiers; + isSelectAllDisabled$ = new BehaviorSubject(false); selectedItemsNumber: number; selectedControl = new FormControl([]); diff --git a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-header/dropdown-dual-multi-select-header.component.html b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-header/dropdown-dual-multi-select-header.component.html index 8e405d4e0..7613ae7e5 100644 --- a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-header/dropdown-dual-multi-select-header.component.html +++ b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-header/dropdown-dual-multi-select-header.component.html @@ -6,6 +6,7 @@ - + diff --git a/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.html b/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.html index 4b8e645c3..4ae670b9d 100644 --- a/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.html +++ b/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.html @@ -74,6 +74,6 @@
-
{{ title + ': ' }}{{ selected$ | async }}
+
{{ title + ': ' }}{{ selected$ | async }}
diff --git a/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.ts b/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.ts index 028231bab..6afe80eeb 100644 --- a/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.ts +++ b/projects/fusion-ui/components/dropdown-dual-multi-select/common/base/dropdown-dual-multi-select.base.component.ts @@ -1,4 +1,16 @@ -import {Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, Renderer2, TemplateRef, ViewChild} from '@angular/core'; +import { + Directive, + ElementRef, + EventEmitter, + Injector, + Input, + OnDestroy, + OnInit, + Output, + Renderer2, + TemplateRef, + ViewChild +} from '@angular/core'; import {InputSize} from '@ironsource/fusion-ui/components/input/common/base'; import {ControlValueAccessor, FormControl} from '@angular/forms'; import {DynamicComponentConfiguration} from '@ironsource/fusion-ui/components/dynamic-components/common/entities'; @@ -10,6 +22,7 @@ import {UniqueIdService} from '@ironsource/fusion-ui/services/unique-id'; import {BackendPagination, SelectedItemName} from '@ironsource/fusion-ui/components/dropdown'; import {isNullOrUndefined} from '@ironsource/fusion-ui/utils'; import {IncludeExcludeTestIdModifiers} from '@ironsource/fusion-ui/entities'; +import {TestIdsService} from '@ironsource/fusion-ui/services'; const CLASS_LIST = [ 'dual-select-button', @@ -46,6 +59,7 @@ export abstract class DropdownDualMultiSelectBaseComponent extends ApiBase imple } testIdIncludeExcludeModifiers: typeof IncludeExcludeTestIdModifiers = IncludeExcludeTestIdModifiers; + testIdsService: TestIdsService = this.injector.get(TestIdsService); @Input() set placeholder(data: string) { this.placeholder$.next(data); @@ -144,7 +158,12 @@ export abstract class DropdownDualMultiSelectBaseComponent extends ApiBase imple /** @internal */ loadingLeft$ = new BehaviorSubject(false); - constructor(protected element: ElementRef, protected renderer: Renderer2, protected uidService: UniqueIdService) { + constructor( + protected element: ElementRef, + protected renderer: Renderer2, + protected uidService: UniqueIdService, + private injector: Injector + ) { super(); this.uid = this.uidService.getUniqueId().toString(); } diff --git a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.html b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.html index 3fe748e08..c729881c5 100644 --- a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.html +++ b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.html @@ -21,7 +21,7 @@
Clear all
diff --git a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.ts b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.ts index 2145ceb44..4c42da730 100644 --- a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.ts +++ b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-body/dropdown-dual-multi-select-body.component.ts @@ -4,6 +4,7 @@ import { ElementRef, EventEmitter, forwardRef, + Injector, Input, OnDestroy, OnInit, @@ -15,7 +16,8 @@ import {BehaviorSubject, combineLatest, fromEvent, Observable, of, Subject} from import {debounceTime, filter, map, scan, takeUntil, tap} from 'rxjs/operators'; import {ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR} from '@angular/forms'; import {isNullOrUndefined} from '@ironsource/fusion-ui/utils'; -import {IncludeExcludeTestIdModifiers} from '@ironsource/fusion-ui'; +import {IncludeExcludeTestIdModifiers} from '@ironsource/fusion-ui/entities'; +import {TestIdsService} from '@ironsource/fusion-ui/services'; const PAGINATION_CHUNK = 20; @@ -74,6 +76,7 @@ export class DropdownDualMultiSelectBodyComponent implements OnInit, OnDestroy, @Output() scrollDown = new EventEmitter(); testIdIncludeExcludeModifiers: typeof IncludeExcludeTestIdModifiers = IncludeExcludeTestIdModifiers; + testIdsService: TestIdsService = this.injector.get(TestIdsService); isSelectAllDisabled$ = new BehaviorSubject(false); selectedItemsNumber: number; @@ -98,7 +101,7 @@ export class DropdownDualMultiSelectBodyComponent implements OnInit, OnDestroy, private propagateChange = (_: DropdownOption[]) => {}; private propagateTouched = () => {}; - constructor() {} + constructor(private injector: Injector) {} ngOnInit(): void { this.displayOptions$ = this.generateOptions('left').pipe( diff --git a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-header/dropdown-dual-multi-select-header.component.html b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-header/dropdown-dual-multi-select-header.component.html index 7613ae7e5..1252c6c0b 100644 --- a/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-header/dropdown-dual-multi-select-header.component.html +++ b/projects/fusion-ui/components/dropdown-dual-multi-select/v3/components/dropdown-dual-multi-select-header/dropdown-dual-multi-select-header.component.html @@ -6,7 +6,7 @@