Skip to content

Commit

Permalink
linting and prettier errors
Browse files Browse the repository at this point in the history
  • Loading branch information
somshrivastava committed Oct 28, 2024
1 parent 225467f commit 204d5e8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Component, Input } from '@angular/core';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatButtonModule } from '@angular/material/button';

/**
* Graph Header Component to display the graph page header.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
<div class="container">
<graph-header class="graph-header" [runId]="run?.id" />
<div class="content-div">
<graph-sidebar [nodes]="nodes!" [selectDataType]="setSelectedDataType" [selectedDataType]="selectedDataType" class="desktop-sidebar" />
<graph-sidebar
[nodes]="nodes!"
[selectDataType]="setSelectedDataType"
[selectedDataType]="selectedDataType"
class="desktop-sidebar"
/>
<div class="right-container">
<graph [valuesSubject]="selectedDataTypeValuesSubject" class="graph" />
<graph-caption
Expand Down
18 changes: 9 additions & 9 deletions angular-client/src/pages/graph-page/graph-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export default class GraphPage implements OnInit {

@HostListener('document:keydown', ['$event'])
handleKeyboardEvent(event: KeyboardEvent) {
if (this.dataTypeName == undefined) {
if (this.dataTypeName === undefined) {
this.setSelectedDataType(this.nodes?.at(0)?.dataTypes[0] as DataType);
} else {
const node = this.getNode(this.dataTypeName as string);
Expand All @@ -170,19 +170,19 @@ export default class GraphPage implements OnInit {
this.getNode(this.dataTypeName as string),
this.getDataType(this.getNode(this.dataTypeName as string), this.dataTypeName as string)
);
if (event.key == 'ArrowDown') {
if (dataTypeIndex + 1 == node.dataTypes.length && nodeIndex + 1 == this.nodes?.length) {
if (event.key === 'ArrowDown') {
if (dataTypeIndex + 1 === node.dataTypes.length && nodeIndex + 1 === this.nodes?.length) {
this.setSelectedDataType(this.nodes?.at(0)?.dataTypes[0] as DataType);
} else if (dataTypeIndex + 1 == node.dataTypes.length) {
} else if (dataTypeIndex + 1 === node.dataTypes.length) {
this.setSelectedDataType(this.nodes?.at(nodeIndex + 1)?.dataTypes[0] as DataType);
} else {
this.setSelectedDataType(node.dataTypes[dataTypeIndex + 1]);
}
} else if (event.key == 'ArrowUp') {
if (dataTypeIndex == 0 && nodeIndex == 0) {
} else if (event.key === 'ArrowUp') {
if (dataTypeIndex === 0 && nodeIndex === 0) {
const lastNode = this.nodes?.at(this.nodes.length - 1) as Node;
this.setSelectedDataType(lastNode.dataTypes[(lastNode.dataTypes.length as number) - 1] as DataType);
} else if (dataTypeIndex == 0) {
} else if (dataTypeIndex === 0) {
const lastNode = this.nodes?.at(nodeIndex - 1) as Node;
this.setSelectedDataType(lastNode.dataTypes[(lastNode.dataTypes.length as number) - 1] as DataType);
} else {
Expand All @@ -194,7 +194,7 @@ export default class GraphPage implements OnInit {

private getNode(name: string): Node {
return this.nodes?.filter(
(node: Node) => node.dataTypes.filter((dataType: DataType) => dataType.name == name)[0]
(node: Node) => node.dataTypes.filter((dataType: DataType) => dataType.name === name)[0]
)[0] as Node;
}

Expand All @@ -203,7 +203,7 @@ export default class GraphPage implements OnInit {
}

private getDataType(node: Node, name: string) {
return node.dataTypes.filter((dataType: DataType) => dataType.name == name)[0];
return node.dataTypes.filter((dataType: DataType) => dataType.name === name)[0];
}

private getDataTypeIndex(node: Node, dataType: DataType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default class GraphSidebarDesktop implements OnInit {
}

isNodeOpen(node: NodeWithVisibilityToggle) {
return node.dataTypes.filter((dataType: DataType) => dataType.name == this.dataTypeName).length > 0;
return node.dataTypes.filter((dataType: DataType) => dataType.name === this.dataTypeName).length > 0;
}

ngOnDestroy(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<graph-sidebar-mobile [nodes]="nodes" [selectDataType]="selectDataType" [onRunSelected]="onRunSelected" />
</div>
<ng-template #desktopView>
<graph-sidebar-desktop [nodes]="nodes" [selectDataType]="selectDataType" [selectedDataType]="selectedDataType"/>
<graph-sidebar-desktop [nodes]="nodes" [selectDataType]="selectDataType" [selectedDataType]="selectedDataType" />
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class SidebarCard implements OnInit {
ngOnInit(): void {
this.iconId = `${this.title}-icon`;
this.selectedDataType.subscribe((dataType: DataType) => {
this.selected = this.title == dataType.name;
this.selected = this.title === dataType.name;
});
}
}

0 comments on commit 204d5e8

Please sign in to comment.