Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly set standalone for all Angular directives #6922

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
} from '../types';
import {AppRoutingEffects, TEST_ONLY} from './app_routing_effects';

@Component({selector: 'test', template: '', jit: true})
@Component({standalone: false, selector: 'test', template: '', jit: true})
class TestableComponent {}

const testAction = createAction('[TEST] test action');
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/webapp/app_routing/route_config_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {RouteConfigs, RouteMatch} from './route_config';
import {ConcreteRouteDef, RedirectionRouteDef} from './route_config_types';
import {Navigation, RouteKind} from './types';

@Component({selector: 'test', template: ''})
@Component({standalone: false, selector: 'test', template: ''})
class TestableComponent {}

function buildConcreteRouteDef(override: Partial<ConcreteRouteDef>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import {navigationRequested} from '../actions';
import {AppRootProvider} from '../app_root';
import {Location} from '../location';

@Directive({selector: 'a[routerLink]'})
@Directive({
standalone: false,
selector: 'a[routerLink]',
})
export class RouterLinkDirectiveContainer {
private pathname: string | null = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import {FEATURE_FLAGS_QUERY_STRING_NAME} from '../http/const';
import {getFeatureFlagsToSendToServer} from '../store/feature_flag_selectors';
import {State as FeatureFlagState} from '../store/feature_flag_types';

@Directive({selector: 'a[includeFeatureFlags], img[includeFeatureFlags]'})
@Directive({
standalone: false,
selector: 'a[includeFeatureFlags], img[includeFeatureFlags]',
})
export class FeatureFlagDirective {
@HostBinding('attr.href') hrefAttr: string | undefined = undefined;
@HostBinding('attr.src') srcAttr: string | undefined = undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class TestableScrollingContainer {
/**
* Stub 'card-view' component for ease of testing.
*/
@Component({selector: 'card-view'})
@Component({standalone: false, selector: 'card-view'})
class TestableCardView {
@Output() fullHeightChanged = new EventEmitter<boolean>();
@Output() fullWidthChanged = new EventEmitter<boolean>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ import {take, takeUntil} from 'rxjs/operators';
/**
* A directive that calls `onVisibilityChange` when element visiblity changes.
*/
@Directive({selector: '[observeIntersection]'})
@Directive({
standalone: false,
selector: '[observeIntersection]',
})
export class IntersectionObserverDirective implements OnInit, OnDestroy {
@Input() intersectionObserverMargin?: string;
@Output() onVisibilityChange = new EventEmitter<{visible: boolean}>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import {Directive, EventEmitter, NgModule, Output} from '@angular/core';
import {ComponentFixture} from '@angular/core/testing';
import {By} from '@angular/platform-browser';

@Directive({selector: '[observeIntersection]', jit: true})
@Directive({
standalone: false,
selector: '[observeIntersection]',
jit: true,
})
class IntersectionObserverTestingDirective {
@Output() onVisibilityChange = new EventEmitter<{visible: boolean}>();

Expand Down
5 changes: 4 additions & 1 deletion tensorboard/webapp/widgets/resize_detector_directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ import {debounceTime, skip, takeUntil} from 'rxjs/operators';
*
* It does not emit `onResize` on the initial render.
*/
@Directive({selector: '[detectResize]'})
@Directive({
standalone: false,
selector: '[detectResize]',
})
export class ResizeDetectorDirective implements OnDestroy, OnInit {
@Input() resizeEventDebouncePeriodInMs: number = 100;
@Output() onResize = new EventEmitter<void>();
Expand Down
5 changes: 4 additions & 1 deletion tensorboard/webapp/widgets/resize_detector_testing_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import {Directive, EventEmitter, Input, NgModule, Output} from '@angular/core';
import {ComponentFixture} from '@angular/core/testing';
import {By} from '@angular/platform-browser';

@Directive({selector: '[detectResize]'})
@Directive({
standalone: false,
selector: '[detectResize]',
})
class ResizeDetectorTestingDirective {
@Input() resizeEventDebouncePeriodInMs: number = 100;
@Output() onResize = new EventEmitter<void>();
Expand Down
Loading