-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
146 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...r-ide/components/openapi-specification-dialog/openapi-specification-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<h3 mat-dialog-title>OpenAPI Specification for endpoints</h3> | ||
|
||
<div mat-dialog-content> | ||
|
||
<div class="text-muted mb-2"> | ||
{{data.url}} | ||
</div> | ||
|
||
<pre | ||
class="mb-2 result" | ||
[highlight]="data.json"></pre> | ||
|
||
</div> | ||
|
||
<div mat-dialog-actions [align]="'end'"> | ||
|
||
<button | ||
mat-button | ||
(click)="copy()"> | ||
Copy | ||
</button> | ||
|
||
<button | ||
mat-flat-button | ||
color="primary" | ||
mat-dialog-close> | ||
Close | ||
</button> | ||
|
||
</div> |
10 changes: 10 additions & 0 deletions
10
...r-ide/components/openapi-specification-dialog/openapi-specification-dialog.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
pre.result { | ||
color: #fafafa; | ||
border-radius: 5px; | ||
box-shadow: 3px 3px 5px rgba(0,0,0,.2); | ||
height: 400px; | ||
margin: 0; | ||
text-wrap:wrap; | ||
padding: 1rem; | ||
overflow: auto; | ||
} |
37 changes: 37 additions & 0 deletions
37
...per-ide/components/openapi-specification-dialog/openapi-specification-dialog.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
/* | ||
* Copyright (c) 2023 Thomas Hansen - For license inquiries you can contact thomas@ainiro.io. | ||
*/ | ||
|
||
// Angular and system imports. | ||
import { Clipboard } from '@angular/cdk/clipboard'; | ||
import { Component, Inject, OnInit } from '@angular/core'; | ||
|
||
// Application specific imports. | ||
import { MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
import { GeneralService } from 'src/app/services/general.service'; | ||
|
||
/** | ||
* Modal dialog showing JSON JSON output encapsulating OpenAPI specification. | ||
*/ | ||
@Component({ | ||
selector: 'app-openapi-specification-dialog', | ||
templateUrl: './openapi-specification-dialog.component.html', | ||
styleUrls: ['./openapi-specification-dialog.component.scss'] | ||
}) | ||
export class OpenAPISpecifictionDialogComponent { | ||
|
||
/** | ||
* Creates an instance of your component. | ||
*/ | ||
constructor( | ||
private clipBoard: Clipboard, | ||
private generalService: GeneralService, | ||
@Inject(MAT_DIALOG_DATA) public data: any) { } | ||
|
||
copy() { | ||
|
||
this.clipBoard.copy(this.data.json); | ||
this.generalService.showFeedback('You can find the content on your clipboard', 'successMessage'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters