Skip to content

Commit

Permalink
Merge branch 'develop' into fix-conf
Browse files Browse the repository at this point in the history
  • Loading branch information
vpavlenko-cv authored Dec 31, 2024
2 parents 8f71306 + e1f289b commit 76e8bc3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('ChainAddParserPageComponent', () => {
]
}),
{provide: ActivatedRoute, useValue: {params: of({id: testChain.id, chainId: testChain.name})}},
{provide: Router, useValue: jasmine.createSpyObj('Router', ['navigateByUrl'])}
{provide: Router, useValue: jasmine.createSpyObj('Router', ['navigate'])}
]
})
.compileComponents();
Expand All @@ -122,7 +122,7 @@ describe('ChainAddParserPageComponent', () => {

it('should dispatch AddParserAction with subchain if exist', fakeAsync(() => {
const dispatchSpy = spyOn(store, 'dispatch').and.callThrough();
routerSpy.navigateByUrl = jasmine.createSpy('navigateByUrl').and.callThrough();
routerSpy.navigate = jasmine.createSpy('navigate').and.callThrough();
const expectChainId = 'fooTestChain';
const expectSubchainId = "testSubchainId";

Expand Down Expand Up @@ -151,7 +151,7 @@ describe('ChainAddParserPageComponent', () => {
parser: expectedParser
})
);
expect(routerSpy.navigateByUrl).toHaveBeenCalledWith(`/parserconfig/chains/${expectChainId}`);
expect(routerSpy.navigate).toHaveBeenCalledWith([`/parserconfig/chains/${expectChainId}`, {}], {queryParams: {pipeline: undefined}});
flush();
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export class ChainAddParserPageComponent implements OnInit, OnDestroy {
parser
}));

this._router.navigateByUrl(`/parserconfig/chains/${this.chainId}`);
const queryParams = {pipeline: this.currentPipeline}
this._router.navigate([`/parserconfig/chains/${this.chainId}`, {}], {queryParams});
}

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,10 @@ export class ChainPageComponent implements OnInit, OnDestroy, DeactivatePrevente

onAddParserClick(event: Event) {
event.preventDefault();
const routeParams = this.breadcrumbs.length > 1
const routeParams: {subchain?: string, pipeline?: string} = this.breadcrumbs.length > 1
? { subchain: this.breadcrumbs[this.breadcrumbs.length - 1].id }
: {};
routeParams.pipeline = this.currentPipeline
this._router.navigate([`/parserconfig/chains/${this.chainId}/new`, routeParams]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ private byte[] readLocalFilePath(String fileName) {
String[] parts = uri.toString().split("!");
URI jarUri = URI.create(parts[0]);
try (FileSystem fs = FileSystems.newFileSystem(jarUri, Collections.emptyMap())) {
return Files.readAllBytes(fs.getPath(parts[1]));
StringBuilder filePathInsideJarBuilder = new StringBuilder();
for (int i = 1; i < parts.length; i++) {
filePathInsideJarBuilder.append(parts[i]);
}
return Files.readAllBytes(fs.getPath(filePathInsideJarBuilder.toString()));
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 76e8bc3

Please sign in to comment.