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

Commit f5130c3

Browse files
committed
feat: First run of formatter
1 parent da34f1d commit f5130c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+557
-464
lines changed

src/app/app.component.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
app-header {
2-
position: fixed;
3-
z-index: 100;
4-
width: 100%;
2+
position: fixed;
3+
z-index: 100;
4+
width: 100%;
55
}
66

77
main {
8-
margin: 0 64px;
9-
padding: 64px 0;
10-
}
8+
margin: 0 64px;
9+
padding: 64px 0;
10+
}

src/app/app.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<app-header></app-header>
22
<main fxLayout="column" fxLayoutGap="24px">
3-
<app-info></app-info>
4-
<app-servers></app-servers>
5-
<app-channels></app-channels>
6-
<app-schemas></app-schemas>
3+
<app-info></app-info>
4+
<app-servers></app-servers>
5+
<app-channels></app-channels>
6+
<app-schemas></app-schemas>
77
</main>

src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Component } from '@angular/core';
33
@Component({
44
selector: 'app-root',
55
templateUrl: './app.component.html',
6-
styleUrls: ['./app.component.css']
6+
styleUrls: ['./app.component.css'],
77
})
88
export class AppComponent {
99
title = 'springwolf';

src/app/app.module.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ import { JsonComponent } from './shared/components/json/json.component';
4141
HighlightModule,
4242
HttpClientModule,
4343
FormsModule,
44-
environment.production ? [] : HttpClientInMemoryWebApiModule.forRoot(MockServer, { delay: 100 })
44+
environment.production
45+
? []
46+
: HttpClientInMemoryWebApiModule.forRoot(MockServer, { delay: 100 }),
4547
],
4648
providers: [
4749
AsyncApiService,
@@ -50,11 +52,13 @@ import { JsonComponent } from './shared/components/json/json.component';
5052
provide: HIGHLIGHT_OPTIONS,
5153
useValue: {
5254
languages: function () {
53-
return { typescript: () => import('highlight.js/lib/languages/typescript') };
54-
}
55-
}
56-
}
55+
return {
56+
typescript: () => import('highlight.js/lib/languages/typescript'),
57+
};
58+
},
59+
},
60+
},
5761
],
58-
bootstrap: [AppComponent]
62+
bootstrap: [AppComponent],
5963
})
60-
export class AppModule { }
64+
export class AppModule {}
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
textarea {
2-
margin-top: 16px;
3-
padding: 8px;
4-
border-radius: 4px;
5-
border-width: 0;
6-
line-height: 24px;
7-
background-color: #282c34;
8-
color: #abb2bf;
2+
margin-top: 16px;
3+
padding: 8px;
4+
border-radius: 4px;
5+
border-width: 0;
6+
line-height: 24px;
7+
background-color: #282c34;
8+
color: #abb2bf;
99
}
1010

1111
button {
12-
margin-top: 8px;
12+
margin-top: 8px;
1313
}
1414

1515
.property-badge {
16-
background-color: #C5CAE9;
17-
border-radius: 4px;
18-
padding: 6px;
19-
font-size: small;
20-
font-weight: bold;
16+
background-color: #c5cae9;
17+
border-radius: 4px;
18+
padding: 6px;
19+
font-size: small;
20+
font-weight: bold;
2121
}
2222

2323
.payload-name {
24-
background-color: #E0E0E0;
25-
border-radius: 4px;
26-
padding: 6px;
27-
font-weight: normal;
24+
background-color: #e0e0e0;
25+
border-radius: 4px;
26+
padding: 6px;
27+
font-weight: normal;
2828
}
Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,54 @@
11
<section>
2+
<mat-divider></mat-divider>
3+
<div *ngIf="operation.message.description">
4+
<h4>{{ operation.message.description }}</h4>
25
<mat-divider></mat-divider>
3-
<div *ngIf="operation.message.description">
4-
<h4>{{ operation.message.description }}</h4>
5-
<mat-divider></mat-divider>
6-
</div>
7-
<mat-tab-group animationDuration="0ms">
8-
<mat-tab label="Example">
9-
<div fxLayout="column">
10-
<textarea spellcheck="false"
11-
#exampleTextArea
12-
[rows]="exampleTextAreaLineCount"
13-
[value]="defaultExample?.value"
14-
(keyup)="recalculateLineCount(exampleTextArea.value)"
15-
></textarea>
16-
<div fxLayout fxLayoutGap="8px">
17-
<button mat-raised-button color="primary" (click)="publish(exampleTextArea.value)">
18-
Publish
19-
</button>
20-
<button mat-raised-button color="primary"
21-
(click)="exampleTextArea.value = defaultExample.value; exampleTextAreaLineCount=defaultExample.lineCount">
22-
Default
23-
</button>
24-
<button mat-raised-button color="primary" [cdkCopyToClipboard]="exampleTextArea.value">Copy</button>
25-
</div>
6+
</div>
7+
<mat-tab-group animationDuration="0ms">
8+
<mat-tab label="Example">
9+
<div fxLayout="column">
10+
<textarea
11+
spellcheck="false"
12+
#exampleTextArea
13+
[rows]="exampleTextAreaLineCount"
14+
[value]="defaultExample?.value"
15+
(keyup)="recalculateLineCount(exampleTextArea.value)"
16+
></textarea>
17+
<div fxLayout fxLayoutGap="8px">
18+
<button
19+
mat-raised-button
20+
color="primary"
21+
(click)="publish(exampleTextArea.value)"
22+
>
23+
Publish
24+
</button>
25+
<button
26+
mat-raised-button
27+
color="primary"
28+
(click)="
29+
exampleTextArea.value = defaultExample.value;
30+
exampleTextAreaLineCount = defaultExample.lineCount
31+
"
32+
>
33+
Default
34+
</button>
35+
<button
36+
mat-raised-button
37+
color="primary"
38+
[cdkCopyToClipboard]="exampleTextArea.value"
39+
>
40+
Copy
41+
</button>
2642
</div>
27-
</mat-tab>
28-
<mat-tab label="Schema">
29-
<h4>{{ operation.message.title }} </h4>
30-
<div class="payload-name">{{ operation.message.name }}</div>
31-
<app-schema *ngIf="schema" [schema]="schema"></app-schema>
32-
</mat-tab>
33-
<mat-tab label="Bindings">
34-
<app-json [data]="operation.bindings[protocolName]"></app-json>
35-
</mat-tab>
36-
</mat-tab-group>
43+
</div>
44+
</mat-tab>
45+
<mat-tab label="Schema">
46+
<h4>{{ operation.message.title }}</h4>
47+
<div class="payload-name">{{ operation.message.name }}</div>
48+
<app-schema *ngIf="schema" [schema]="schema"></app-schema>
49+
</mat-tab>
50+
<mat-tab label="Bindings">
51+
<app-json [data]="operation.bindings[protocolName]"></app-json>
52+
</mat-tab>
53+
</mat-tab-group>
3754
</section>

src/app/channels/channel-main/channel-main.component.ts

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import { STATUS } from 'angular-in-memory-web-api';
1111
@Component({
1212
selector: 'app-channel-main',
1313
templateUrl: './channel-main.component.html',
14-
styleUrls: ['./channel-main.component.css']
14+
styleUrls: ['./channel-main.component.css'],
1515
})
1616
export class ChannelMainComponent implements OnInit {
17-
1817
@Input() docName: string;
1918
@Input() channelName: string;
2019
@Input() operation: Operation;
@@ -29,17 +28,16 @@ export class ChannelMainComponent implements OnInit {
2928
private asyncApiService: AsyncApiService,
3029
private publisherService: PublisherService,
3130
private snackBar: MatSnackBar
32-
) { }
31+
) {}
3332

3433
ngOnInit(): void {
35-
this.asyncApiService.getAsyncApis().subscribe(
36-
asyncapi => {
37-
let schemas: Map<string, Schema> = asyncapi.get(this.docName).components.schemas;
38-
this.schema = schemas[this.operation.message.title];
39-
this.defaultExample = new Example(this.schema.example);
40-
this.exampleTextAreaLineCount = this.defaultExample.lineCount;
41-
}
42-
);
34+
this.asyncApiService.getAsyncApis().subscribe((asyncapi) => {
35+
let schemas: Map<string, Schema> = asyncapi.get(this.docName).components
36+
.schemas;
37+
this.schema = schemas[this.operation.message.title];
38+
this.defaultExample = new Example(this.schema.example);
39+
this.exampleTextAreaLineCount = this.defaultExample.lineCount;
40+
});
4341

4442
this.protocolName = Object.keys(this.operation.bindings)[0];
4543
}
@@ -52,32 +50,37 @@ export class ChannelMainComponent implements OnInit {
5250
try {
5351
const json = JSON.parse(example);
5452

55-
this.publisherService.publish(this.protocolName, this.channelName, json).subscribe(
56-
_ => this.handlePublishSuccess(),
57-
err => this.handlePublishError(err)
58-
);
59-
} catch(error) {
53+
this.publisherService
54+
.publish(this.protocolName, this.channelName, json)
55+
.subscribe(
56+
(_) => this.handlePublishSuccess(),
57+
(err) => this.handlePublishError(err)
58+
);
59+
} catch (error) {
6060
this.snackBar.open('Example payload is not valid', 'ERROR', {
61-
duration: 3000
62-
})
61+
duration: 3000,
62+
});
6363
}
6464
}
6565

6666
private handlePublishSuccess() {
67-
return this.snackBar.open('Example payload sent to: ' + this.channelName, 'PUBLISHED', {
68-
duration: 3000
69-
});
67+
return this.snackBar.open(
68+
'Example payload sent to: ' + this.channelName,
69+
'PUBLISHED',
70+
{
71+
duration: 3000,
72+
}
73+
);
7074
}
7175

72-
private handlePublishError(err: {status?: number}) {
76+
private handlePublishError(err: { status?: number }) {
7377
let msg = 'Publish failed';
7478
if (err?.status === STATUS.NOT_FOUND) {
7579
msg += ': no publisher was provided for ' + this.protocolName;
7680
}
7781

7882
return this.snackBar.open(msg, 'ERROR', {
79-
duration: 4000
83+
duration: 4000,
8084
});
8185
}
82-
8386
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
.operation-badge {
2-
background-color: #CDDC39;
3-
border-radius: 4px;
4-
padding: 8px;
5-
font-size: small;
6-
font-weight: bold;
2+
background-color: #cddc39;
3+
border-radius: 4px;
4+
padding: 8px;
5+
font-size: small;
6+
font-weight: bold;
77
}
88

99
mat-divider {
10-
height: 20px;
10+
height: 20px;
1111
}
1212

1313
.payload-name {
14-
background-color: #E0E0E0;
15-
border-radius: 4px;
16-
padding: 4px;
17-
font-weight: normal;
18-
font-size: small;
14+
background-color: #e0e0e0;
15+
border-radius: 4px;
16+
padding: 4px;
17+
font-weight: normal;
18+
font-size: small;
1919
}
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<h1>Channels</h1>
22
<mat-accordion>
3-
<mat-expansion-panel *ngFor="let channel of channels">
4-
<mat-expansion-panel-header>
5-
<mat-panel-title fxLayout fxLayoutAlign="flex-start center" fxLayoutGap="16px">
6-
<div class="operation-badge">{{ channel.operation.type }}</div>
7-
<h3>{{ channel.name }}</h3>
8-
<div class="payload-name">{{ channel.operation.message.title }}</div>
9-
</mat-panel-title>
10-
</mat-expansion-panel-header>
11-
<app-channel-main
12-
[channelName]="channel.name"
13-
[operation]="channel.operation"
14-
[docName]="docName">
15-
</app-channel-main>
16-
</mat-expansion-panel>
3+
<mat-expansion-panel *ngFor="let channel of channels">
4+
<mat-expansion-panel-header>
5+
<mat-panel-title
6+
fxLayout
7+
fxLayoutAlign="flex-start center"
8+
fxLayoutGap="16px"
9+
>
10+
<div class="operation-badge">{{ channel.operation.type }}</div>
11+
<h3>{{ channel.name }}</h3>
12+
<div class="payload-name">{{ channel.operation.message.title }}</div>
13+
</mat-panel-title>
14+
</mat-expansion-panel-header>
15+
<app-channel-main
16+
[channelName]="channel.name"
17+
[operation]="channel.operation"
18+
[docName]="docName"
19+
>
20+
</app-channel-main>
21+
</mat-expansion-panel>
1722
</mat-accordion>

src/app/channels/channels.component.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,25 @@ import { Subscription } from 'rxjs';
77
@Component({
88
selector: 'app-channels',
99
templateUrl: './channels.component.html',
10-
styleUrls: ['./channels.component.css']
10+
styleUrls: ['./channels.component.css'],
1111
})
1212
export class ChannelsComponent implements OnInit {
13-
1413
channels: Channel[];
1514
nameSubscription: Subscription;
1615
docName: string;
1716

18-
constructor(private asyncApiService: AsyncApiService) { }
17+
constructor(private asyncApiService: AsyncApiService) {}
1918

2019
ngOnInit(): void {
21-
this.nameSubscription = this.asyncApiService.getCurrentAsyncApiName().subscribe(name => {
22-
this.docName = name;
23-
this.asyncApiService.getAsyncApis().subscribe(asyncapi => this.channels = asyncapi.get(name).channels);
24-
});
20+
this.nameSubscription = this.asyncApiService
21+
.getCurrentAsyncApiName()
22+
.subscribe((name) => {
23+
this.docName = name;
24+
this.asyncApiService
25+
.getAsyncApis()
26+
.subscribe(
27+
(asyncapi) => (this.channels = asyncapi.get(name).channels)
28+
);
29+
});
2530
}
26-
2731
}

0 commit comments

Comments
 (0)