-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved saved queries in the separate component
- Loading branch information
Dmitriy Borzenko
committed
Nov 13, 2024
1 parent
4c58aad
commit 8a9218a
Showing
10 changed files
with
148 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...onal-components/data-component/saved-queries-section/saved-queries-section.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<cdk-accordion class="example-accordion"> | ||
<cdk-accordion-item | ||
[disabled]="true" | ||
*ngFor="let item of savedQueries; let index = index" | ||
#accordionItem="cdkAccordionItem" | ||
class="example-accordion-item" | ||
role="button" | ||
tabindex="0" | ||
[attr.id]="'accordion-header-' + index" | ||
[attr.aria-expanded]="accordionItem.expanded" | ||
[attr.aria-controls]="'accordion-body-' + index" | ||
> | ||
<div class="datatab-activity-item"> | ||
<div class="datatab-expanding-row"> | ||
<div class="datatab-expanding-row-header" (click)="accordionItem.toggle()"> | ||
<div class="datatab-expanding-row-header-content"> | ||
<div class="datatab-activity-row-summary"> | ||
<div class="datatab-activity-timestamp">{{ item.time }}</div> | ||
<div class="datatab-activity-icon"> | ||
<div | ||
class="ace-icon ace-icon-size-small cfc-color-active ace-icon-configuration ng-star-inserted" | ||
> | ||
<mat-icon class="datatab-activity-icon-size">query_stats</mat-icon> | ||
</div> | ||
</div> | ||
<div class="datatab-activity-info-container"> | ||
<div | ||
class="datatab-activity-title" | ||
style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap" | ||
title="" | ||
> | ||
<span> {{ item.title }} </span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<ng-template [ngIf]="!accordionItem.expanded"> | ||
<mat-icon>keyboard_arrow_down</mat-icon> | ||
</ng-template> | ||
<ng-template [ngIf]="accordionItem.expanded"> | ||
<mat-icon>keyboard_arrow_up</mat-icon> | ||
</ng-template> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div | ||
class="example-accordion-item-body pt-3 pb-3" | ||
role="region" | ||
[style.display]="accordionItem.expanded ? '' : 'none'" | ||
[attr.id]="'accordion-body-' + index" | ||
[attr.aria-labelledby]="'accordion-header-' + index" | ||
> | ||
{{ item.title }} <br /> | ||
<code style="display: block; white-space: pre-wrap">{{ item.query }}</code> | ||
<div class="d-inline"> | ||
<div class="btn-group-parent float-none"> | ||
<button | ||
mat-icon-button | ||
data-test-id="runSqlQueryRequestCode" | ||
name="run sql button" | ||
class="sql-run-button rounded-2 btn-group-item btn d-flex justify-content-center align-items-center" | ||
> | ||
<span>Run</span><mat-icon>play_arrow</mat-icon> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</cdk-accordion-item> | ||
</cdk-accordion> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...l-components/data-component/saved-queries-section/saved-queries-section.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ComponentFixture, TestBed } from "@angular/core/testing"; | ||
import { SavedQueriesSectionComponent } from "./saved-queries-section.component"; | ||
|
||
describe("SavedQueriesSectionComponent", () => { | ||
let component: SavedQueriesSectionComponent; | ||
let fixture: ComponentFixture<SavedQueriesSectionComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [SavedQueriesSectionComponent], | ||
}); | ||
fixture = TestBed.createComponent(SavedQueriesSectionComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it("should create", () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
...tional-components/data-component/saved-queries-section/saved-queries-section.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { ChangeDetectionStrategy, Component } from "@angular/core"; | ||
import DataTabValues from "../mock.data"; | ||
|
||
@Component({ | ||
selector: "app-saved-queries-section", | ||
templateUrl: "./saved-queries-section.component.html", | ||
styleUrls: ["./saved-queries-section.component.scss"], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class SavedQueriesSectionComponent { | ||
public savedQueries = DataTabValues.savedQueries; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.