From 57d410f16c391d8ad395bd20e2d48ab403a88cec Mon Sep 17 00:00:00 2001 From: jrlambs Date: Tue, 11 Oct 2022 16:56:35 -0400 Subject: [PATCH 1/4] should fix issue causing links to not work right. --- src/app/schemas/schema/schema.component.html | 2 +- src/app/schemas/schema/schema.component.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/schemas/schema/schema.component.html b/src/app/schemas/schema/schema.component.html index 6197bf8..164c4c4 100644 --- a/src/app/schemas/schema/schema.component.html +++ b/src/app/schemas/schema/schema.component.html @@ -8,7 +8,7 @@ {{ property.value.type }} - {{ property.value['$ref'] }} + {{ property.value['$ref'] }} ({{ property.value.format }})
{{ property.value.description }}
diff --git a/src/app/schemas/schema/schema.component.ts b/src/app/schemas/schema/schema.component.ts index f764ec0..88eb34c 100644 --- a/src/app/schemas/schema/schema.component.ts +++ b/src/app/schemas/schema/schema.component.ts @@ -10,4 +10,13 @@ export class SchemaComponent { @Input() schema: Schema; + public getSchemaUrl(fragment: string): string { + let baseUrl = window.location.href; + const lastHashPosition = baseUrl.lastIndexOf('#'); + if(lastHashPosition >= 0) { + baseUrl = baseUrl.substring(0, lastHashPosition); + } + return baseUrl + '#' + fragment; + } + } From 63aa6538cda9a5d866916b5e40eebda39ac0a9c9 Mon Sep 17 00:00:00 2001 From: jrlambs Date: Fri, 14 Oct 2022 09:11:08 -0400 Subject: [PATCH 2/4] try to prevent going to an error page when using spring boot ui dependency when clicking on the async API Json link --- src/app/info/info.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/info/info.component.html b/src/app/info/info.component.html index 363ca8a..d1e1c2a 100644 --- a/src/app/info/info.component.html +++ b/src/app/info/info.component.html @@ -2,6 +2,6 @@

{{ info?.title }}

API VERSION {{ info?.version }} - - AsyncAPI JSON file + AsyncAPI JSON file

{{ info.description }}

From 9473d0a663d14c750f6d55d8004fe46d426b6dac Mon Sep 17 00:00:00 2001 From: jrlambs Date: Mon, 24 Oct 2022 22:01:20 -0400 Subject: [PATCH 3/4] scroll element into view when opened. --- src/app/channels/channels.component.ts | 2 ++ src/app/schemas/schemas.component.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/channels/channels.component.ts b/src/app/channels/channels.component.ts index 7b001a4..457b2f1 100644 --- a/src/app/channels/channels.component.ts +++ b/src/app/channels/channels.component.ts @@ -49,6 +49,8 @@ export class ChannelsComponent implements OnInit { setChannelSelection(channel: Channel): void { window.location.hash = '#' + this.getChannelIdentifier(channel) + var element = window.document.getElementById(this.getChannelIdentifier(channel)); + element.scrollIntoView({behavior: 'smooth', block: 'start'}); } setChannelSelectionFromLocation(): void { const anchor = window.location.hash.substr(1); diff --git a/src/app/schemas/schemas.component.ts b/src/app/schemas/schemas.component.ts index c2b9239..608ebad 100644 --- a/src/app/schemas/schemas.component.ts +++ b/src/app/schemas/schemas.component.ts @@ -29,7 +29,9 @@ export class SchemasComponent implements OnInit { } setSchemaSelection(schema: string): void { - window.location.hash = '#' + schema + window.location.hash = '#' + schema; + var element = window.document.getElementById(schema); + element.scrollIntoView({behavior: 'smooth', block: 'start'}); } setSchemaSelectionFromLocation(): void { this.selectedSchema = window.location.hash.substr(1); From 0b799c578841cf92f33e7830c481d1fe2016f2f8 Mon Sep 17 00:00:00 2001 From: jrlambs Date: Mon, 24 Oct 2022 22:23:10 -0400 Subject: [PATCH 4/4] scroll element into view when opened. not working yet.. misses the mark a lot of times. --- src/app/channels/channels.component.ts | 3 ++- src/app/schemas/schemas.component.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/channels/channels.component.ts b/src/app/channels/channels.component.ts index dea27d7..791f66e 100644 --- a/src/app/channels/channels.component.ts +++ b/src/app/channels/channels.component.ts @@ -47,7 +47,8 @@ export class ChannelsComponent implements OnInit { setChannelSelection(channel: Channel): void { window.location.hash = channel.anchorIdentifier; var element = window.document.getElementById(channel.anchorIdentifier); - element.scrollIntoView({behavior: 'smooth', block: 'start'}); + let element2 = element.getElementsByClassName('mat-expansion-panel-content')[0]; + element2.scrollIntoView({behavior: 'smooth', block: 'start'}); } setChannelSelectionFromLocation(): void { const anchor = window.location.hash; diff --git a/src/app/schemas/schemas.component.ts b/src/app/schemas/schemas.component.ts index 5287fb5..33188aa 100644 --- a/src/app/schemas/schemas.component.ts +++ b/src/app/schemas/schemas.component.ts @@ -25,8 +25,9 @@ export class SchemasComponent implements OnInit { setSchemaSelection(schema: Schema): void { window.location.hash = schema.anchorIdentifier - var element = window.document.getElementById(schema.anchorIdentifier); - element.scrollIntoView({behavior: 'smooth', block: 'start'}); + let element = window.document.getElementById(schema.anchorIdentifier); + let element2 = element.getElementsByClassName('mat-expansion-panel-content')[0]; + element2.scrollIntoView({behavior: 'smooth', block: 'start'}); } setSchemaSelectionFromLocation(): void { this.selectedSchema = window.location.hash;