Skip to content

Commit

Permalink
Kamu UI 545 set transform ux query aliases (#552)
Browse files Browse the repository at this point in the history
* replaced methods with routerLink attribute

* changed CHANGELOG.md

---------

Co-authored-by: Dmitriy Borzenko <[email protected]>
  • Loading branch information
dmitriy-borzenko and Dmitriy Borzenko authored Feb 12, 2025
1 parent e2cc360 commit 1f4f2b5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 35 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Batching trigger form: removed disabled state when updates turn off
- Edit SetTransform: initializing the correct engine
- Edit SetTransform: deleting input datasets with same name
- Edit SetTransform: opening links for account name and dataset name in a new tab

## [0.39.1] - 2025-02-03
### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@
</button>
<div class="d-flex align-items-center justify-content-between node-name-block">
<div class="node-link">
<a class="node-name" (click)="navigateToOwner(node.owner)"> {{ node.owner }} </a>/
<a class="node-name" (click)="navigateToDataset(node.owner, node.name)"> {{ node.name }}</a>
<a class="node-name" [routerLink]="['/', node.owner]" target="_blank"> {{ node.owner }} </a>/
<a class="node-name" [routerLink]="['/', node.owner, node.name]" target="_blank">
{{ node.name }}</a
>
</div>
<button
class="no-button d-flex"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import { of } from "rxjs";
import AppValues from "src/app/common/values/app.values";
import { dispatchInputEvent, emitClickOnElementByDataTestId } from "src/app/common/helpers/base-test.helpers.spec";
import { DatasetAutocompleteItem, TypeNames } from "src/app/interface/search.interface";
import { mockDatasetBasicsDerivedFragment, mockDatasetInfo } from "src/app/search/mock.data";
import { mockDatasetBasicsDerivedFragment } from "src/app/search/mock.data";
import { SearchApi } from "src/app/api/search.api";
import { NavigationService } from "src/app/services/navigation.service";
import { DatasetService } from "src/app/dataset-view/dataset.service";
import { mockGetDatasetSchemaQuery } from "../../mock.data";
import { DatasetNode } from "../../set-transform.types";
Expand All @@ -22,7 +21,6 @@ describe("SearchSectionComponent", () => {
let component: SearchSectionComponent;
let fixture: ComponentFixture<SearchSectionComponent>;
let searchApi: SearchApi;
let navigationService: NavigationService;
let datasetService: DatasetService;

beforeEach(async () => {
Expand All @@ -47,7 +45,6 @@ describe("SearchSectionComponent", () => {
component.dataSource = new MatTreeNestedDataSource<DatasetNode>();
searchApi = TestBed.inject(SearchApi);
datasetService = TestBed.inject(DatasetService);
navigationService = TestBed.inject(NavigationService);
fixture.detectChanges();
});

Expand Down Expand Up @@ -83,24 +80,6 @@ describe("SearchSectionComponent", () => {
expect(component.searchDataset).toEqual("");
});

it("should navigate to dataset overview tab", () => {
const datasetInfo = mockDatasetInfo;
const navigateToDatasetViewSpy = spyOn(navigationService, "navigateToDatasetView");

component.navigateToDataset(datasetInfo.accountName, datasetInfo.datasetName);

expect(navigateToDatasetViewSpy).toHaveBeenCalledWith(datasetInfo);
});

it("should navigate to owner view", () => {
const owner = "kamu";
const navigateToOwnerViewSpy = spyOn(navigationService, "navigateToOwnerView");

component.navigateToOwner(owner);

expect(navigateToOwnerViewSpy).toHaveBeenCalledWith(owner);
});

it("should check select input dataset", () => {
const mockNgbTypeaheadSelectItemEvent = {
item: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,4 @@ export class SearchSectionComponent extends BaseComponent {
public hasChild(_: number, node: DatasetNode): boolean {
return !!node.children && node.children.length > 0;
}

public navigateToDataset(accountName: string, datasetName: string): void {
this.navigationService.navigateToDatasetView({
accountName,
datasetName,
});
}

public navigateToOwner(owner: string): void {
this.navigationService.navigateToOwnerView(owner);
}
}

0 comments on commit 1f4f2b5

Please sign in to comment.