Skip to content
This repository was archived by the owner on Jun 18, 2023. It is now read-only.

Commit 60ff15d

Browse files
timonbackstavshamir
authored andcommitted
feat: Move hash symbol to anchorIdentifier
1 parent e3a71fe commit 60ff15d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/app/channels/channels.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ export class ChannelsComponent implements OnInit {
4141
}
4242

4343
setChannelSelection(channel: Channel): void {
44-
window.location.hash = '#' + channel.anchorIdentifier
44+
window.location.hash = channel.anchorIdentifier
4545
}
4646
setChannelSelectionFromLocation(): void {
47-
const anchor = window.location.hash.substr(1);
47+
const anchor = window.location.hash;
4848
if (anchor.startsWith(CHANNEL_ANCHOR_PREFIX)) {
4949
this.selectedChannel = anchor;
5050
}

src/app/schemas/schemas.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export class SchemasComponent implements OnInit {
2424
}
2525

2626
setSchemaSelection(schema: Schema): void {
27-
window.location.hash = '#' + schema.anchorIdentifier
27+
window.location.hash = schema.anchorIdentifier
2828
}
2929
setSchemaSelectionFromLocation(): void {
30-
this.selectedSchema = window.location.hash.substr(1);
30+
this.selectedSchema = window.location.hash;
3131
}
3232
}

src/app/shared/asyncapi-mapper.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class AsyncApiMapperService {
145145
const example = schema.example !== undefined ? new Example(schema.example) : undefined
146146
return {
147147
description: schema.description,
148-
anchorIdentifier: schemaName,
148+
anchorIdentifier: '#' + schemaName,
149149
type: schema.type,
150150
format: schema.format,
151151
enum: schema.enum,

src/app/shared/models/channel.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const CHANNEL_ANCHOR_PREFIX = "channel-"
1+
export const CHANNEL_ANCHOR_PREFIX = "#channel-"
22
export interface Channel {
33
name: string;
44
anchorIdentifier: string;

0 commit comments

Comments
 (0)