Skip to content

Commit

Permalink
UI nitpicks 11 and 12 (hyperledger-archives#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
samjsmith authored Mar 27, 2017
1 parent ad393e9 commit 593be8c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/composer-playground/src/app/test/test.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="registries">
<span>Participants</span>
<section class="side-bar-nav">
<ul>
<ul class="registry">
<li *ngFor="let participantRegistry of participantRegistries"
[class.active]="chosenRegistry.id === participantRegistry.id"
(click)="setChosenRegistry(participantRegistry)">
Expand All @@ -13,7 +13,7 @@ <h3>{{participantRegistry.displayName}}</h3>

<span>Assets</span>
<section class="side-bar-nav">
<ul>
<ul class="registry">
<li *ngFor="let assetRegistry of assetRegistries"
[class.active]="chosenRegistry.id === assetRegistry.id"
(click)="setChosenRegistry(assetRegistry)">
Expand All @@ -24,7 +24,7 @@ <h3>{{assetRegistry.displayName}}</h3>

<span>Transactions</span>
<section class="side-bar-nav">
<ul>
<ul class="registry">
<li
[class.active]="chosenRegistry === transactionRegistry"
(click)="setChosenRegistry(transactionRegistry)">
Expand Down
3 changes: 3 additions & 0 deletions packages/composer-playground/src/app/test/test.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ app-test {
padding: 0;
}

ul.registry {
cursor: pointer;
}

}

Expand Down
15 changes: 14 additions & 1 deletion packages/composer-playground/src/app/test/test.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,22 @@ export class TestComponent implements OnInit {

return this.clientService.getBusinessNetworkConnection().getTransactionRegistry()
})
.then((transactionRegistry) =>{
.then((transactionRegistry) => {
this.transactionRegistry = transactionRegistry;
if(this.transactionRegistry) {
this.chosenRegistry = this.transactionRegistry;
}

// set the default registry selection
if(this.participantRegistries.length != 0) {
this.chosenRegistry = this.participantRegistries[0];
} else if(this.assetRegistries.length != 0) {
this.chosenRegistry = this.assetRegistries[0];
} else {
this.chosenRegistry = this.transactionRegistry;
}
});

})
.catch((error) => {
this.alertService.errorStatus$.next(error);
Expand Down

0 comments on commit 593be8c

Please sign in to comment.