Skip to content

Commit

Permalink
please release me, let me go.
Browse files Browse the repository at this point in the history
because I feel another lovely patchy, oh so so!

Signed-off-by: Dave Shanley <dave@quobix.com>
  • Loading branch information
daveshanley committed Jun 21, 2023
1 parent caa8ccf commit f0e19b2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
14 changes: 12 additions & 2 deletions ui/src/components/transaction/transaction-view.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default css`
}
.chain-container {
background: var(--secondary-color-very-lowalpha);
max-height: 300px;
overflow-y: auto;
}
Expand All @@ -103,7 +103,17 @@ export default css`
background: var(--secondary-color-lowalpha);
}
.empty-data.no-chain {
margin-bottom: 20px;
}
.empty-data.select-chain {
margin-bottom: 20px;
color: var(--darker-font-color);
}
.chain-view-container {
border-top: 1px solid var(--secondary-color);
}
Expand Down
28 changes: 23 additions & 5 deletions ui/src/components/transaction/transaction-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export class HttpTransactionViewComponent extends LitElement {
@state()
private _currentLinks: LinkMatch[];

private _siblings: HttpTransactionItemComponent[];

constructor() {
super();
this._requestHeadersView = new KVViewComponent();
Expand Down Expand Up @@ -121,9 +123,7 @@ export class HttpTransactionViewComponent extends LitElement {
}

tabSelected(event: CustomEvent) {
console.log('tab selected');
this._selectedTab = event.detail.name;
//this.syncLinks();
}

render() {
Expand Down Expand Up @@ -248,7 +248,6 @@ export class HttpTransactionViewComponent extends LitElement {
this._chainTransactionView.linkCache = this._linkCache;
this._chainTransactionView.hideChain = true;
this._chainTransactionView._currentLinks = [];
console.log('a nice meal', event.detail);
this.requestUpdate();
}

Expand Down Expand Up @@ -276,11 +275,30 @@ export class HttpTransactionViewComponent extends LitElement {
siblings.push(siblingComponent);
}
})
return html`${!hideKv? paramKVComponent: null }${siblings}${siblings.length <= 0 ? 'no more requests in chain...': null}`
this._siblings = siblings;
return html`${!hideKv? paramKVComponent: null }${siblings}${siblings.length <= 0 ? this.noOtherLinks(): null}`
}

noOtherLinks(): TemplateResult {
return html`<div class="empty-data no-chain"> <sl-icon name="link-45deg" class="binary-icon"></sl-icon>
<br/>
There are no other requests in this chain yet.</div>`
}

renderChainTabPanel(): TemplateResult {

const selectChain = () =>{
if (this._siblings?.length > 0) {
return html`
<div class="empty-data select-chain">
<sl-icon name="link-45deg" class="binary-icon"></sl-icon>
<br/>
Select a request from the chain.
</div>`
}
return null;
}

if (!this.hideChain) {
return html`
<sl-tab-panel name="chain">
Expand All @@ -291,7 +309,7 @@ export class HttpTransactionViewComponent extends LitElement {
)}
</div>
<div class="chain-view-container">
${this._chainTransactionView}
${this._chainTransactionView? this._chainTransactionView: selectChain()}
</div>
</section>
</sl-tab-panel>`
Expand Down

0 comments on commit f0e19b2

Please sign in to comment.