Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
47,667 changes: 34,988 additions & 12,679 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"license": "LicenseRef-LICENSE",
"scripts": {
"postinstall": "ngcc --properties browser main --tsconfig './tsconfig.spec.json'",
"postinstall": "ngcc --tsconfig './tsconfig.app.json' --use-program-dependencies && ngcc --source 'node_modules/@angular'",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does these new options do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so previously, we were running ngcc across all test dependencies. The issue there is that spectator and spectator jest circularly reference each other (not sure why this wasn't an issue in the past) and break. We don't actually need spectator to be compiled for ivy though - so now we're using --tsconfig './tsconfig.app.json' --use-program-dependencies to only compile modules reference from the actual application, and then manually adding ngcc --source 'node_modules/@angular' to compile the angular testing modules used by the test bed (and we know all the first party angular ones are compatible with the ivy compiler anyway).

"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
Expand All @@ -24,17 +24,17 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^10.0.4",
"@angular/cdk": "^10.2.7",
"@angular/common": "^10.0.4",
"@angular/compiler": "^10.0.4",
"@angular/core": "^10.0.4",
"@angular/flex-layout": "^10.0.0-beta.32",
"@angular/forms": "^10.0.4",
"@angular/material": "^10.2.7",
"@angular/platform-browser": "^10.0.4",
"@angular/platform-browser-dynamic": "^10.0.4",
"@angular/router": "^10.0.4",
"@angular/animations": "^11.0.2",
"@angular/cdk": "^11.0.1",
"@angular/common": "^11.0.2",
"@angular/compiler": "^11.0.2",
"@angular/core": "^11.0.2",
"@angular/flex-layout": "^11.0.0-beta.33",
"@angular/forms": "^11.0.2",
"@angular/material": "^11.0.1",
"@angular/platform-browser": "^11.0.2",
"@angular/platform-browser-dynamic": "^11.0.2",
"@angular/router": "^11.0.2",
"@apollo/client": "^3.2.5",
"@hypertrace/hyperdash": "^1.1.2",
"@hypertrace/hyperdash-angular": "^2.2.0",
Expand Down Expand Up @@ -67,11 +67,11 @@
},
"devDependencies": {
"@angular-builders/jest": "^10.0.0-beta.0",
"@angular-devkit/build-angular": "~0.1002.0",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular-devkit/build-ng-packagr": "~0.1002.0",
"@angular/cli": "10.1.6",
"@angular/compiler-cli": "~10.0.4",
"@angular/language-service": "~10.0.4",
"@angular/cli": "11.0.2",
"@angular/compiler-cli": "~11.0.2",
"@angular/language-service": "~11.0.2",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@compodoc/compodoc": "^1.1.11",
Expand Down Expand Up @@ -102,13 +102,13 @@
"jest-junit": "^12.0.0",
"lodash": "^4.17.20",
"ng-mocks": "^11.0.0",
"ng-packagr": "^10.1.2",
"ng-packagr": "^11.0.3",
"prettier": "^2.1.2",
"pretty-quick": "^3.0.0",
"ts-node": "~9.0.0",
"tslint": "~6.1.3",
"tslint-config-prettier": "^1.18.0",
"typescript": "~3.9.7",
"typescript": "~4.0.5",
"typescript-tslint-plugin": "^0.5.5"
},
"config": {
Expand Down
12 changes: 6 additions & 6 deletions projects/assets-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "@hypertrace/assets-library",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^10.0.4",
"@angular/core": "^10.0.4",
"@angular/platform-browser": "^10.0.4",
"@angular/material": "^10.0.2",
"rxjs": "~6.6.0",
"@angular/common": "^11.0.2",
"@angular/core": "^11.0.2",
"@angular/platform-browser": "^11.0.2",
"@angular/material": "^11.0.1",
"rxjs": "~6.6.3",
"lodash-es": "^4.17.15"
},
"dependencies": {
"tslib": "^2.0.0"
"tslib": "^2.0.3"
}
}
16 changes: 8 additions & 8 deletions projects/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"test:watch": "pushd ../.. && ng test common --watch"
},
"peerDependencies": {
"@angular/common": "^10.0.4",
"@angular/core": "^10.0.4",
"@angular/cdk": "^10.0.2",
"@angular/platform-browser": "^10.0.4",
"@angular/router": "^10.0.4",
"@angular/common": "^11.0.2",
"@angular/core": "^11.0.2",
"@angular/cdk": "^11.0.1",
"@angular/platform-browser": "^11.0.2",
"@angular/router": "^11.0.2",
"@hypertrace/graphql-client": "^0.0.0",
"core-js": "^3.5.0",
"rxjs": "~6.6.0",
"core-js": "^3.7.0",
"rxjs": "~6.6.3",
"zone.js": "^0.10.3",
"lodash-es": "^4.17.15",
"d3-interpolate": "^1.3.2",
Expand All @@ -25,6 +25,6 @@
"@hypertrace/test-utils": "^0.0.0"
},
"dependencies": {
"tslib": "^2.0.0"
"tslib": "^2.0.3"
}
}
4 changes: 2 additions & 2 deletions projects/common/src/color/color.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export class ColorService {
}

public brighter(colorHex: string, basis: number): string {
return rgb(colorHex).brighter(basis).hex();
return rgb(colorHex).brighter(basis).formatHex();
}

public darker(colorHex: string, basis: number): string {
return rgb(colorHex).darker(basis).hex();
return rgb(colorHex).darker(basis).formatHex();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? I dont see d3 being updated with this pr.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a deprecation called out by the linter. If I were to guess, we got a new locked version of d3-color that was still compatible with the version spec in package.json

}

private getBasisColors(key: ColorPaletteKey): string[] {
Expand Down
24 changes: 12 additions & 12 deletions projects/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
"test:watch": "pushd ../.. && ng test components --watch"
},
"peerDependencies": {
"@angular/animations": "^10.0.4",
"@angular/common": "^10.0.4",
"@angular/core": "^10.0.4",
"@angular/cdk": "^10.0.2",
"@angular/platform-browser": "^10.0.4",
"@angular/material": "^10.0.2",
"@angular/forms": "^10.0.4",
"@angular/router": "^10.0.4",
"@angular/flex-layout": "^10.0.0-beta.32",
"@angular/animations": "^11.0.2",
"@angular/common": "^11.0.2",
"@angular/core": "^11.0.2",
"@angular/cdk": "^11.0.1",
"@angular/platform-browser": "^11.0.2",
"@angular/material": "^11.0.1",
"@angular/forms": "^11.0.2",
"@angular/router": "^11.0.2",
"@angular/flex-layout": "^11.0.0-beta.33",
"@hypertrace/common": "^0.0.0",
"graphql-tag": "^2.10.1",
"core-js": "^3.5.0",
"rxjs": "~6.6.0",
"core-js": "^3.7.0",
"rxjs": "~6.6.3",
"zone.js": "^0.10.3",
"lodash-es": "^4.17.15",
"d3-array": "^2.2.0",
Expand All @@ -33,6 +33,6 @@
"@hypertrace/test-utils": "^0.0.0"
},
"dependencies": {
"tslib": "^2.0.0"
"tslib": "^2.0.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Filter, FilterAttributeType, FilterOperator } from '@hypertrace/components';
import { getTestFilterAttribute } from '@hypertrace/test-utils';
import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest';
import { BooleanFilterBuilder } from '../filter/builder/types/boolean-filter-builder';
import { NumberFilterBuilder } from '../filter/builder/types/number-filter-builder';
import { StringFilterBuilder } from '../filter/builder/types/string-filter-builder';
import { StringMapFilterBuilder } from '../filter/builder/types/string-map-filter-builder';
import { Filter } from '../filter/filter';
import { FilterAttributeType } from '../filter/filter-attribute-type';
import { FilterOperator } from '../filter/filter-operators';
import { FilterBarService } from './filter-bar.service';

describe('Filter Bar service', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { assertUnreachable } from '@hypertrace/common';
import { FilterAttribute, FilterAttributeType } from '@hypertrace/components';
import { getTestFilterAttribute } from '@hypertrace/test-utils';
import { createServiceFactory, mockProvider, SpectatorService } from '@ngneat/spectator/jest';
import { FilterBuilderLookupService } from '../../filter/builder/filter-builder-lookup.service';
import { BooleanFilterBuilder } from '../../filter/builder/types/boolean-filter-builder';
import { NumberFilterBuilder } from '../../filter/builder/types/number-filter-builder';
import { StringFilterBuilder } from '../../filter/builder/types/string-filter-builder';
import { StringMapFilterBuilder } from '../../filter/builder/types/string-map-filter-builder';
import { FilterAttribute } from '../../filter/filter-attribute';
import { FilterAttributeType } from '../../filter/filter-attribute-type';
import { FilterOperator } from '../../filter/filter-operators';
import { FilterParserLookupService } from '../../filter/parser/filter-parser-lookup.service';
import { ComparisonFilterParser } from '../../filter/parser/types/comparison-filter-parser';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import {
FilterAttribute,
FilterAttributeType,
InFilterModalComponent,
ModalRef,
MODAL_DATA
} from '@hypertrace/components';
import { createHostFactory, mockProvider } from '@ngneat/spectator/jest';
import { ModalRef, MODAL_DATA } from '../../modal/modal';
import { FilterBuilderLookupService } from '../filter/builder/filter-builder-lookup.service';
import { NumberFilterBuilder } from '../filter/builder/types/number-filter-builder';
import { FilterAttribute } from '../filter/filter-attribute';
import { FilterAttributeType } from '../filter/filter-attribute-type';
import { FilterUrlService } from '../filter/filter-url.service';
import { InFilterModalComponent } from './in-filter-modal.component';

describe('In Filter Modal component', () => {
const attributes: FilterAttribute[] = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FilterOperator } from '@hypertrace/components';
import { getTestFilterAttribute } from '@hypertrace/test-utils';
import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest';
import { FilterAttributeType } from '../filter-attribute-type';
import { FilterOperator } from '../filter-operators';
import { FilterBuilderLookupService } from './filter-builder-lookup.service';
import { BooleanFilterBuilder } from './types/boolean-filter-builder';
import { NumberFilterBuilder } from './types/number-filter-builder';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { NavigationService, QueryParamObject } from '@hypertrace/common';
import { FilterAttribute, FilterAttributeType, IncompleteFilter } from '@hypertrace/components';
import { getAllTestFilterAttributes, getTestFilterAttribute } from '@hypertrace/test-utils';
import { createServiceFactory, mockProvider, SpectatorService } from '@ngneat/spectator/jest';
import { EMPTY } from 'rxjs';
import { NumberFilterBuilder } from './builder/types/number-filter-builder';
import { StringFilterBuilder } from './builder/types/string-filter-builder';
import { StringMapFilterBuilder } from './builder/types/string-map-filter-builder';
import { Filter } from './filter';
import { Filter, IncompleteFilter } from './filter';
import { FilterAttribute } from './filter-attribute';
import { FilterAttributeType } from './filter-attribute-type';
import { FilterOperator } from './filter-operators';
import { FilterUrlService } from './filter-url.service';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { FilterAttributeType, FilterOperator } from '@hypertrace/components';
import { getTestFilterAttribute } from '@hypertrace/test-utils';
import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest';
import { FilterAttributeType } from '../filter-attribute-type';
import { FilterOperator } from '../filter-operators';
import { FilterParserLookupService } from './filter-parser-lookup.service';
import { ComparisonFilterParser } from './types/comparison-filter-parser';
import { ContainsFilterParser } from './types/contains-filter-parser';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GreetingLabelComponent } from '@hypertrace/components';
import { createHostFactory, Spectator } from '@ngneat/spectator/jest';
import { GreetingLabelComponent } from './greeting-label.component';

describe('Greeting Label component', () => {
let spectator: Spectator<GreetingLabelComponent>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BreadcrumbsService, PageHeaderComponent } from '@hypertrace/components';
import { createHostFactory, mockProvider, Spectator } from '@ngneat/spectator/jest';
import { of } from 'rxjs';
import { BreadcrumbsService } from '../../breadcrumbs/breadcrumbs.service';
import { PageHeaderComponent } from './page-header.component';

describe('Page Header Component', () => {
let spectator: Spectator<PageHeaderComponent>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import { createHostFactory, mockProvider, SpectatorHost } from '@ngneat/spectato
import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs';
import { LabelComponent } from '../label/label.component';
import { PopoverComponent } from '../popover/popover.component';
import { EventBlockerModule } from './../event-blocker/event-blocker.module';
import { PopoverModule } from './../popover/popover.module';
import { PopoverService } from './../popover/popover.service';
import { MenuDropdownComponent } from './menu-dropdown.component';
import { MenuItemComponent } from './menu-item/menu-item.component';

describe('Menu dropdown Component', () => {
const createHost = createHostFactory<MenuDropdownComponent>({
component: MenuDropdownComponent,
imports: [EventBlockerModule, PopoverModule],
declarations: [MockComponent(LabelComponent), MockComponent(MenuItemComponent)],
imports: [EventBlockerModule],
declarations: [MockComponent(LabelComponent), MockComponent(MenuItemComponent), MockComponent(PopoverComponent)],
shallow: true,
providers: [
mockProvider(NavigationService, {
Expand All @@ -37,42 +36,26 @@ describe('Menu dropdown Component', () => {
expect(spectator.query('.trigger-icon')).toExist();
});

test('should display menu items with icons when clicked', () => {
test('should display menu items as popovercontent', () => {
spectator = createHost(
`<ht-menu-dropdown label="Settings" icon="${IconType.MoreHorizontal}">
<ht-menu-item label="Do X"></ht-menu-item>
<ht-menu-item label="Do Y"></ht-menu-item>
</ht-menu-dropdown>`,
{
providers: [
mockProvider(PopoverService, {
drawPopover: jest.fn()
})
]
}
</ht-menu-dropdown>`
);

spectator.click('.trigger-content');
expect(spectator.inject(PopoverService).drawPopover).toHaveBeenCalled();
expect(spectator.queryAll(MenuItemComponent).map(component => component.label)).toEqual(['Do X', 'Do Y']);
});

test('should not display menu items with icons when disabled', () => {
test('should mark popover as disabled when disabled', () => {
spectator = createHost(
`<ht-menu-dropdown label="Settings" icon="${IconType.MoreHorizontal}" [disabled]="true">
<ht-menu-item label="Do X"></ht-menu-item>
<ht-menu-item label="Do Y"></ht-menu-item>
</ht-menu-dropdown>`,
{
providers: [
mockProvider(PopoverService, {
drawPopover: jest.fn()
})
]
}
</ht-menu-dropdown>`
);

spectator.click('.trigger-content');
expect(spectator.inject(PopoverService).drawPopover).not.toHaveBeenCalled();
expect(spectator.query(PopoverComponent)?.disabled).toBe(true);
});

test('should not bubble event from trigger element', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { fakeAsync } from '@angular/core/testing';
import { IconType } from '@hypertrace/assets-library';
import { Color, NavigationService } from '@hypertrace/common';
import { IconComponent, MenuItemComponent } from '@hypertrace/components';
import { createHostFactory, mockProvider } from '@ngneat/spectator/jest';
import { MockComponent } from 'ng-mocks';
import { IconComponent } from '../../icon/icon.component';
import { MenuItemComponent } from './menu-item.component';

describe('Menu Item Component', () => {
const createHost = createHostFactory<MenuItemComponent>({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { fakeAsync } from '@angular/core/testing';
import { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
import { IconType } from '@hypertrace/assets-library';
import { IconComponent } from '@hypertrace/components';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the new compiler catches these circular dependencies in test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope - I manually fixed all these because of the ngcc issue above. I thought the circular references breaking ngcc were our own, but it ended up being spectator. Since I had already fixed them, I left them in.

import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';
import { MockComponent } from 'ng-mocks';
import { Subject } from 'rxjs';
import { IconComponent } from '../icon/icon.component';
import { NotificationComponent, NotificationMode } from './notification.component';

describe('NotificationComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MatSnackBar } from '@angular/material/snack-bar';
import { NotificationService } from '@hypertrace/components';
import { createServiceFactory, mockProvider, SpectatorService } from '@ngneat/spectator/jest';
import { NotificationComponent, NotificationMode } from './notification.component';
import { NotificationService } from './notification.service';

describe('NotificationService', () => {
let spectator: SpectatorService<NotificationService>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import {
NavigationService,
TimeRangeService
} from '@hypertrace/common';
import { ButtonComponent, OpenInNewTabComponent } from '@hypertrace/components';
import { createHostFactory, mockProvider, Spectator } from '@ngneat/spectator/jest';
import { MockComponent } from 'ng-mocks';
import { ButtonComponent } from '../button/button.component';
import { OpenInNewTabComponent } from './open-in-new-tab.component';

describe('Open in new tab component', () => {
let spectator: Spectator<OpenInNewTabComponent>;
Expand Down
Loading