Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8bf3da5
fix: donut chart fixes
itssharmasandeep Jul 13, 2021
5599c6a
Revert "fix: donut chart fixes"
itssharmasandeep Jul 13, 2021
88d3bd4
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Jul 15, 2021
cd18474
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Jul 19, 2021
2aa1a9b
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Jul 20, 2021
111e41d
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Jul 26, 2021
9b40fc4
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Jul 28, 2021
00b1e07
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Jul 29, 2021
f81b19d
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Jul 30, 2021
423dc6d
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Aug 9, 2021
9466514
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Aug 11, 2021
b2b04ba
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Aug 18, 2021
1e2e570
Merge remote-tracking branch 'origin/main'
itssharmasandeep Aug 19, 2021
403a9d4
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Aug 20, 2021
a74bd5d
Merge remote-tracking branch 'origin/main'
itssharmasandeep Aug 23, 2021
5d47c7f
Merge branch 'main' of github.com:hypertrace/hypertrace-ui
itssharmasandeep Aug 25, 2021
60746c3
feat: custom dimensions for modal
itssharmasandeep Aug 25, 2021
94374ed
fix: test case
itssharmasandeep Aug 25, 2021
29c7ed5
fix: addressed review comments
itssharmasandeep Aug 25, 2021
d5fc366
fix: lint error
itssharmasandeep Aug 25, 2021
cf7774e
fix: add test
itssharmasandeep Aug 25, 2021
d6d65ad
fix: build error
itssharmasandeep Aug 25, 2021
b14e30a
fix: remove unwanted code
itssharmasandeep Aug 25, 2021
f2084a1
fix: add test
itssharmasandeep Aug 25, 2021
ed028d6
fix: lint errors
itssharmasandeep Aug 25, 2021
c5a2226
fix: code refactor
itssharmasandeep Aug 26, 2021
5c7bfdd
fix: test cases and code refactor
itssharmasandeep Aug 26, 2021
7165d5b
chore: merging distributed-tracing into observability
itssharmasandeep Aug 26, 2021
9aec1e3
fix: donut chart fixes
itssharmasandeep Jul 13, 2021
583998d
Revert "fix: donut chart fixes"
itssharmasandeep Jul 13, 2021
7f732d0
feat: custom dimensions for modal
itssharmasandeep Aug 25, 2021
e8280c0
fix: test case
itssharmasandeep Aug 25, 2021
8187f41
fix: addressed review comments
itssharmasandeep Aug 25, 2021
45f5e9c
fix: lint error
itssharmasandeep Aug 25, 2021
59706d7
fix: add test
itssharmasandeep Aug 25, 2021
a2ce229
fix: build error
itssharmasandeep Aug 25, 2021
2712fde
fix: remove unwanted code
itssharmasandeep Aug 25, 2021
4387a46
fix: add test
itssharmasandeep Aug 25, 2021
1f390e8
fix: lint errors
itssharmasandeep Aug 25, 2021
6fd5c7c
fix: code refactor
itssharmasandeep Aug 26, 2021
03c2e1a
fix: test cases and code refactor
itssharmasandeep Aug 26, 2021
c27aa76
chore: merging distributed-tracing into observability
itssharmasandeep Aug 26, 2021
aaf2def
Merge branch 'merge-projects' of github.com:hypertrace/hypertrace-ui …
itssharmasandeep Aug 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion ONBOARDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ This documents contains the onboarding guide for hypertrace-ui.
- [Common](https://github.com/hypertrace/hypertrace-ui/tree/main/projects/common)
- [Components](https://github.com/hypertrace/hypertrace-ui/tree/main/projects/components)
- [Dashboards](https://github.com/hypertrace/hypertrace-ui/tree/main/projects/dashboards)
- [Distributed Tracing](https://github.com/hypertrace/hypertrace-ui/tree/main/projects/distributed-tracing)
- [Observability](https://github.com/hypertrace/hypertrace-ui/tree/main/projects/observability)

- [Hypertrace ui app](https://github.com/hypertrace/hypertrace-ui/tree/main/src)
Expand Down
39 changes: 0 additions & 39 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
"input": "./projects/assets-library/assets",
"output": "./assets"
},
{
"glob": "**/*",
"input": "./projects/distributed-tracing/assets",
"output": "./assets"
},
{
"glob": "**/*",
"input": "./projects/observability/assets",
Expand Down Expand Up @@ -177,40 +172,6 @@
}
}
},
"distributed-tracing": {
"root": "projects/distributed-tracing",
"sourceRoot": "projects/distributed-tracing",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/distributed-tracing/tsconfig.lib.json",
"project": "projects/distributed-tracing/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/distributed-tracing/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-builders/jest:run",
"options": {}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/distributed-tracing/tsconfig.lib.json",
"projects/distributed-tracing/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
}
}
},
"components": {
"root": "projects/components",
"sourceRoot": "projects/components",
Expand Down
1 change: 0 additions & 1 deletion jest.config.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = {
'@hypertrace/dashboards/testing': '<rootDir>/projects/dashboards/src/test/public-api.ts',
'@hypertrace/test-utils': '<rootDir>/projects/test-utils/src/public-api.ts',
'@hypertrace/graphql-client': '<rootDir>/projects/graphql-client/src/public-api.ts',
'@hypertrace/distributed-tracing': '<rootDir>/projects/distributed-tracing/src/public-api.ts',
'@hypertrace/observability': '<rootDir>/projects/observability/src/public-api.ts'
}
};
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ module.exports = {
'@hypertrace/dashboards/testing': '<rootDir>/projects/dashboards/src/test/public-api.ts',
'@hypertrace/test-utils': '<rootDir>/projects/test-utils/src/public-api.ts',
'@hypertrace/graphql-client': '<rootDir>/projects/graphql-client/src/public-api.ts',
'@hypertrace/distributed-tracing': '<rootDir>/projects/distributed-tracing/src/public-api.ts',
'@hypertrace/observability': '<rootDir>/projects/observability/src/public-api.ts'
}
};
30 changes: 0 additions & 30 deletions projects/components/src/modal/modal-container.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,6 @@
display: flex;
flex-direction: column;

&.modal-size-small {
height: 365px;
width: 420px;
}

&.modal-size-medium {
height: 530px;
width: 456px;
}

&.modal-size-large-short {
height: 540px;
width: 640px;
}

&.modal-size-large {
height: 720px;
width: 640px;
}

&.modal-size-large-tall {
height: 800px;
width: 640px;
}

&.modal-size-medium-wide {
height: 600px;
width: 840px;
}

.header {
display: flex;
flex-direction: column;
Expand Down
73 changes: 71 additions & 2 deletions projects/components/src/modal/modal-container.component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ class TestComponent {
describe('Modal Container component', () => {
let spectator: Spectator<ModalContainerComponent>;

const checkSyles = (width: string, height: string): void => {
const modalContainer = spectator.query('.modal-container') as HTMLElement;
expect(modalContainer.style.height).toBe(height);
expect(modalContainer.style.width).toBe(width);
};

const createHost = createHostFactory({
component: ModalContainerComponent,
shallow: true,
Expand Down Expand Up @@ -77,14 +83,77 @@ describe('Modal Container component', () => {
expect(spectator.query('.header')).toHaveText('Create User');
});

test('uses the requested size', () => {
test('uses the requested small size', () => {
spectator = createConfiguredHost({
showControls: true,
title: 'Create User',
content: TestComponent,
size: ModalSize.Small
});
expect(spectator.query('.modal-container')).toHaveClass('modal-size-small');
checkSyles('420px', '365px');
});

test('uses the requested medium size', () => {
spectator = createConfiguredHost({
showControls: true,
title: 'Create User',
content: TestComponent,
size: ModalSize.Medium
});
checkSyles('456px', '530px');
});

test('uses the requested large-short size', () => {
spectator = createConfiguredHost({
showControls: true,
title: 'Create User',
content: TestComponent,
size: ModalSize.LargeShort
});
checkSyles('640px', '540px');
});

test('uses the requested large size', () => {
spectator = createConfiguredHost({
showControls: true,
title: 'Create User',
content: TestComponent,
size: ModalSize.Large
});
checkSyles('640px', '720px');
});

test('uses the requested large-tall size', () => {
spectator = createConfiguredHost({
showControls: true,
title: 'Create User',
content: TestComponent,
size: ModalSize.LargeTall
});
checkSyles('640px', '800px');
});

test('uses the requested medium-wide size', () => {
spectator = createConfiguredHost({
showControls: true,
title: 'Create User',
content: TestComponent,
size: ModalSize.MediumWide
});
checkSyles('840px', '600px');
});

test('custom size', () => {
spectator = createConfiguredHost({
showControls: true,
title: 'Create User',
content: TestComponent,
size: {
width: 100,
height: 100
}
});
checkSyles('100px', '100px');
});

test('closes on close button click', () => {
Expand Down
28 changes: 24 additions & 4 deletions projects/components/src/modal/modal-container.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { LayoutChangeService } from '@hypertrace/common';
import { ButtonSize, ButtonStyle } from '../button/button';
import { POPOVER_DATA } from '../popover/popover';
import { PopoverRef } from '../popover/popover-ref';
import { ModalConfig, ModalSize, MODAL_DATA } from './modal';
import { getModalDimensions, ModalConfig, ModalDimension, MODAL_DATA } from './modal';

@Component({
selector: 'ht-modal-container',
styleUrls: ['./modal-container.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div *ngIf="this.visible" class="modal-container" [ngClass]="'modal-size-' + this.size">
<div *ngIf="this.visible" class="modal-container" [style.height]="this.size.height" [style.width]="this.size.width">
<div class="header">
<ht-button
*ngIf="this.showControls"
Expand Down Expand Up @@ -41,7 +41,7 @@ import { ModalConfig, ModalSize, MODAL_DATA } from './modal';
export class ModalContainerComponent {
public readonly modalTitle: string;
public readonly showControls: boolean;
public readonly size: ModalSize;
public readonly size: ModalDimension;
public readonly isComponentModal: boolean;
public readonly renderer: TemplateRef<unknown> | Type<unknown>;
public readonly rendererInjector: Injector;
Expand All @@ -58,7 +58,9 @@ export class ModalContainerComponent {
const config = constructionData.config;
this.showControls = config.showControls ?? false;
this.modalTitle = config.title ?? '';
this.size = config.size;
this.size = this.isModalDimension(config.size)
? this.getDimensionsWithUnits(config.size)
: this.getDimensionsWithUnits(getModalDimensions(config.size));
this.isComponentModal = !(config.content instanceof TemplateRef);
this.closeOnEscape = config.closeOnEscapeKey ?? true;
this.renderer = config.content;
Expand All @@ -85,6 +87,24 @@ export class ModalContainerComponent {
this.visible = false;
this.popoverRef.close();
}

private isModalDimension(size: unknown): size is ModalDimension {
// tslint:disable-next-line:strict-type-predicates
return typeof size === 'object' && size !== null && (size as ModalDimension).width !== undefined;
}

private getDimensionsWithUnits(dims: ModalDimension): ModalDimension {
const dimsWithUnits: ModalDimension = { ...dims };
if (typeof dims.height === 'number') {
dimsWithUnits.height = `${dims.height}px`;
}

if (typeof dims.width === 'number') {
dimsWithUnits.width = `${dims.width}px`;
}

return dimsWithUnits;
}
}

export interface ModalConstructionData {
Expand Down
29 changes: 28 additions & 1 deletion projects/components/src/modal/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { InjectionToken, TemplateRef, Type } from '@angular/core';
import { Observable } from 'rxjs';

export interface ModalConfig<TData = unknown> {
size: ModalSize;
content: TemplateRef<unknown> | Type<unknown>;
size: ModalSize | ModalDimension;
showControls?: boolean;
title?: string;
data?: TData;
Expand All @@ -19,6 +19,33 @@ export const enum ModalSize {
MediumWide = 'medium-wide'
}

export interface ModalDimension {
// Number => without unit (considered px) and String => with units (expression included)
width: number | string;
height: number | string;
}

export const getModalDimensions = (modalSize: ModalSize): ModalDimension => {
switch (modalSize) {
case ModalSize.Small:
return getModalDimensionObject(420, 365);
case ModalSize.Medium:
return getModalDimensionObject(456, 530);
case ModalSize.LargeShort:
return getModalDimensionObject(640, 540);
case ModalSize.Large:
return getModalDimensionObject(640, 720);
case ModalSize.LargeTall:
return getModalDimensionObject(640, 800);
case ModalSize.MediumWide:
return getModalDimensionObject(840, 600);
default:
return getModalDimensionObject(420, 365);
}
};

const getModalDimensionObject = (width: number, height: number): ModalDimension => ({ width: width, height: height });

export const MODAL_DATA = new InjectionToken<unknown>('MODAL_DATA');

export abstract class ModalRef<TResult> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MetricAggregation } from '@hypertrace/distributed-tracing';
import { MetricAggregation } from '@hypertrace/observability';
import { TableCellParser } from '../table-cell-parser';
import { TableCellParserBase } from '../table-cell-parser-base';
import { CoreTableCellParserType } from '../types/core-table-cell-parser-type';
Expand Down
2 changes: 1 addition & 1 deletion projects/dashboards/src/test/dashboard-verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import {
TimeRangeService,
TimeUnit
} from '@hypertrace/common';
import { GraphQlQueryEventService, MetadataService } from '@hypertrace/distributed-tracing';
import { GraphQlRequestService } from '@hypertrace/graphql-client';
import { ModelJson } from '@hypertrace/hyperdash';
import { DashboardManagerService, LoggerService, RENDERER_API } from '@hypertrace/hyperdash-angular';
import { GraphQlQueryEventService, MetadataService } from '@hypertrace/observability';
import { getMockFlexLayoutProviders } from '@hypertrace/test-utils';
import { mockProvider, Spectator } from '@ngneat/spectator/jest';
import { EMPTY, of } from 'rxjs';
Expand Down
25 changes: 0 additions & 25 deletions projects/distributed-tracing/README.md

This file was deleted.

29 changes: 0 additions & 29 deletions projects/distributed-tracing/jest.config.js

This file was deleted.

8 changes: 0 additions & 8 deletions projects/distributed-tracing/ng-package.json

This file was deleted.

Loading