forked from springwolf/springwolf-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add new tab with message binding to channel documentation and a… #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sam0r040
wants to merge
5
commits into
master
Choose a base branch
from
feature/add_message_binding_to_channel_documentation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
81c2c5d
feat: Add new tab with message binding to channel documentation and a…
sam0r040 30c1e7b
Add message binding to the request made by PublisherService so that t…
sam0r040 e6f4628
Improve mapping of message bindings to be more resilient if a backend…
sam0r040 92d8bf1
Rename Binding in example tab to Message Binding and add full payload…
sam0r040 967a029
Display raw message bindings
timonback File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -33,3 +33,7 @@ button { | |
| padding: 6px; | ||
| font-weight: normal; | ||
| } | ||
|
|
||
| [hidden] { | ||
| display: none !important; | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -7,21 +7,51 @@ <h4>{{ operation.message.description }}</h4> | |
| <mat-tab-group animationDuration="0ms"> | ||
| <mat-tab label="Example"> | ||
| <div fxLayout="column"> | ||
| <textarea spellcheck="false" | ||
| #exampleTextArea | ||
| [rows]="exampleTextAreaLineCount" | ||
| [value]="defaultExample?.value" | ||
| (keyup)="recalculateLineCount('example', exampleTextArea.value)" | ||
| ></textarea> | ||
| <div [hidden]="isEmptyObject(operation.message.bindings.get(protocolName))" fxLayout="column" fxLayoutGap="5px"> | ||
| <h4>Message Binding</h4> | ||
| <textarea spellcheck="false" | ||
| #bindingTextArea | ||
| [rows]="messageBindingExampleTextAreaLineCount" | ||
| [value]="createMessageBindingExample(operation.message.bindings.get(protocolName))?.value" | ||
| (keyup)="recalculateLineCount('massageBindingExample', bindingTextArea.value)" | ||
| ></textarea> | ||
| </div> | ||
| <div [hidden]="!(headersExample?.lineCount > 1)" fxLayout="column" fxLayoutGap="0px"> | ||
|
|
||
| <h4>Header</h4> | ||
| <textarea spellcheck="false" | ||
| #headersTextArea | ||
| [rows]="headersTextAreaLineCount" | ||
| [value]="headersExample?.value" | ||
| (keyup)="recalculateLineCount('headers', headersTextArea.value)" | ||
| ></textarea> | ||
|
|
||
| </div> | ||
| <div fxLayout="column" fxLayoutGap="5px"> | ||
| <h4>Message</h4> | ||
| <textarea spellcheck="false" | ||
| #messageTextArea | ||
| [rows]="exampleTextAreaLineCount" | ||
| [value]="defaultExample?.value" | ||
| (keyup)="recalculateLineCount('example', messageTextArea.value)" | ||
| ></textarea> | ||
| </div> | ||
| <div fxLayout fxLayoutGap="8px"> | ||
| <button mat-raised-button color="primary" (click)="publish(exampleTextArea.value, headersTextArea.value)"> | ||
| <button mat-raised-button color="primary" | ||
| (click)="publish(messageTextArea.value, headersTextArea?.value, bindingTextArea?.value)"> | ||
| Publish | ||
| </button> | ||
| <button mat-raised-button color="primary" | ||
| (click)="exampleTextArea.value = defaultExample.value; exampleTextAreaLineCount=defaultExample.lineCount"> | ||
| (click)=" | ||
| messageTextArea.value = defaultExample.value; | ||
| exampleTextAreaLineCount = defaultExample.lineCount || 0; | ||
| headersTextArea.value = headersExample?.value; | ||
| headersTextAreaLineCount = headersExample?.lineCount || 0; | ||
| bindingTextArea.value = createMessageBindingExample(operation.message.bindings.get(protocolName))?.value; | ||
| messageBindingExampleTextAreaLineCount = messageBindingExample?.lineCount || 0"> | ||
| Default | ||
| </button> | ||
| <button mat-raised-button color="primary" [cdkCopyToClipboard]="exampleTextArea.value">Copy</button> | ||
| <button mat-raised-button color="primary" [cdkCopyToClipboard]="messageTextArea.value">Copy</button> | ||
| </div> | ||
| </div> | ||
| </mat-tab> | ||
|
|
@@ -43,16 +73,14 @@ <h4> | |
| </h4> | ||
| <app-schema *ngIf="headers" [schema]="headers"></app-schema> | ||
| <div fxLayout="column"> | ||
| <textarea spellcheck="false" | ||
| #headersTextArea | ||
| [rows]="headersTextAreaLineCount" | ||
| [value]="headersExample?.value" | ||
| (keyup)="recalculateLineCount('headers', headersTextArea.value)" | ||
| ></textarea> | ||
| <app-json [json]="headersExample?.value"></app-json> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I switched the editable example to the message view and changed it to readonly here. |
||
| </div> | ||
| </mat-tab> | ||
| <mat-tab label="Bindings"> | ||
| <mat-tab label="Operation Bindings"> | ||
| <app-json [data]="operation.bindings[protocolName]"></app-json> | ||
| </mat-tab> | ||
| <mat-tab label="Message Bindings"> | ||
| <app-json [data]="operation.message.rawBindings[protocolName]"></app-json> | ||
| </mat-tab> | ||
| </mat-tab-group> | ||
| </section> | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it might be a good idea to hide elements if they are not part of the spec (for headers and message binding). [hidden] is used instead of *ngif because ngif will not even render the components, which will result in issues with other code (ie reseting to default values)