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

Commit aac2859

Browse files
timonbackstavshamir
authored andcommitted
feat: minor sorting and anchorIdentifier improvement
1 parent 62425ba commit aac2859

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/app/channels/channels.component.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ export class ChannelsComponent implements OnInit {
2828

2929
private sortChannels(channels: Array<Channel>): Array<Channel> {
3030
return channels.sort((a, b) => {
31-
if (a?.operation?.protocol === b?.operation?.protocol) {
32-
if (a?.operation?.operation === b?.operation.operation) {
33-
return a.name?.localeCompare(b.name);
31+
if (a.operation.protocol === b.operation.protocol) {
32+
if (a.operation.operation === b.operation.operation) {
33+
if(a.name === b.name) {
34+
return a.operation.message.name.localeCompare(b.operation.message.name)
35+
} else {
36+
return a.name.localeCompare(b.name);
37+
}
3438
} else {
35-
return a?.operation?.operation?.localeCompare(b?.operation?.operation);
39+
return a.operation.operation.localeCompare(b.operation.operation);
3640
}
3741
} else {
38-
return a?.operation?.protocol?.localeCompare(b?.operation?.protocol);
42+
return a.operation.protocol.localeCompare(b.operation.protocol);
3943
}
4044
});
4145
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class AsyncApiMapperService {
109109
const operation = this.mapOperation(operationType, message, serverOperation.bindings)
110110
return {
111111
name: topicName,
112-
anchorIdentifier: CHANNEL_ANCHOR_PREFIX + [operation.protocol, topicName, operation.operation].join( "-"),
112+
anchorIdentifier: CHANNEL_ANCHOR_PREFIX + [operation.protocol, topicName, operation.operation, operation.message.title].join( "-"),
113113
description: description,
114114
operation: operation,
115115
}

0 commit comments

Comments
 (0)