gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[reclaim-ui] 241/459: formatting


From: gnunet
Subject: [reclaim-ui] 241/459: formatting
Date: Fri, 11 Jun 2021 23:25:33 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository reclaim-ui.

commit 84abf17db885b07d5b753404973a0204b395b0f4
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Thu Jul 16 10:52:39 2020 +0200

    formatting
---
 src/app/app.component.html                         |  4 ++++
 src/app/app.component.ts                           | 16 +++++++++++++++-
 src/app/config.ts                                  |  2 +-
 src/app/edit-identity/edit-identity.component.html | 20 ++++++++++----------
 src/app/edit-identity/edit-identity.component.ts   | 20 +++-----------------
 src/assets/config.json                             |  3 ++-
 src/styles.scss                                    |  5 +++++
 7 files changed, 40 insertions(+), 30 deletions(-)

diff --git a/src/app/app.component.html b/src/app/app.component.html
index 183735d..10bb6fa 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1,2 +1,6 @@
 <div class="logo"><img src="assets/reclaim_icon.png"/></div>
 <router-outlet></router-outlet>
+<div style="margin: 1em" (click)="toggleExperimental()">
+  <i [className]="isExperimental() ? 'fa fa-toggle-on' : 'fa 
fa-toggle-off'"></i>
+  Exerimental features <b *ngIf="isExperimental()">enabled</b><span 
*ngIf="!isExperimental()">disabled</span>
+</div>
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 3a4be2b..616fb43 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -1,5 +1,5 @@
 import { Component } from '@angular/core';
-
+import { ConfigService } from './config.service';
 
 @Component({
   selector: 'app-root',
@@ -8,4 +8,18 @@ import { Component } from '@angular/core';
 })
 export class AppComponent {
   title = 'app';
+  configService: any;
+
+  constructor(private _configService: ConfigService) {
+    this.configService = _configService;
+  }
+
+  isExperimental() {
+    return this.configService.get().experimental;
+  }
+
+  toggleExperimental() {
+    this.configService.get().experimental = 
!this.configService.get().experimental;
+  }
+
 }
diff --git a/src/app/config.ts b/src/app/config.ts
index 338b51b..218c4de 100644
--- a/src/app/config.ts
+++ b/src/app/config.ts
@@ -1,3 +1,3 @@
 export class Config {
-    constructor(public apiUrl: string, public webfingerUrl: string) { }
+    constructor(public apiUrl: string, public experiments: boolean) { }
 }
diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index 050ce37..a6fb0fb 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -29,17 +29,17 @@
           <tr [class.openid]="inOpenIdFlow()" 
[class.alert-danger]="newAttested.name === missing.name" class="text-primary" 
*ngFor="let missing of missingAttested">
             <td><div style="min-width: 15em">{{missing.name}}</div></td>
             <td>
-              <select (change)="missing.attestation=$event.target.value; ">
-                <option value="">Attestation</option>
+              <select class="custom-select" 
(change)="missing.attestation=$event.target.value; ">
+                <option value="">Select attestation source</option>
                 <option *ngFor="let attest of attestations" 
value={{attest.id}}>
                   {{attest.name}}
                 </option>
               </select>
 
-              <select *ngIf="missing.attestation !== ''" 
(change)="missing.value=$event.target.value">
-                <option value="">Source</option>
+              <select class="custom-select" *ngIf="missing.attestation !== ''" 
(change)="missing.value=$event.target.value">
+                <option value="">Select claim</option>
                 <option *ngFor="let claim of 
attestationValuesForAttested(missing)" value={{claim.name}}>
-                  {{claim.name}}
+                  {{claim.value}} <i>({{claim.name}})</i>
                 </option>
               </select>
             </td>
@@ -93,17 +93,17 @@
               <input [class.text-danger]="!attestedNameValid(newAttested)" 
placeholder="Attested attribute" [(ngModel)]="newAttested.name">
             </td>
             <td>
-              <select (change)="newAttested.attestation=$event.target.value; ">
-                <option value="">(-)</option>
+              <select class="custom-select" 
(change)="newAttested.attestation=$event.target.value; ">
+                <option value="">Select attestation source</option>
                 <option *ngFor="let attest of attestations" 
value={{attest.id}}>
                 {{attest.name}}
                 </option>
               </select>
 
-              <select *ngIf="newAttested.attestation !== ''" 
(change)="newAttested.value=$event.target.value">
-                <option value="">(-)</option>
+              <select class="custom-select" *ngIf="newAttested.attestation !== 
''" (change)="newAttested.value=$event.target.value">
+                <option value="">Select claim</option>
                 <option *ngFor="let claim of 
attestationValuesForAttested(newAttested)" value={{claim.name}}>
-                  {{claim.name}}
+                {{claim.value}} <i>({{claim.name}})</i>
                 </option>
               </select>
             </td>
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index b76395d..45e9c51 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -12,6 +12,7 @@ import { finalize } from 'rxjs/operators';
 import { from, forkJoin, EMPTY } from 'rxjs';
 import { Authorization } from '../authorization';
 import { IdProvider } from '../idProvider';
+import { ConfigService } from '../config.service';
 
 
 @Component({
@@ -44,6 +45,7 @@ export class EditIdentityComponent implements OnInit {
               private oidcService: OpenIdService,
               private namestoreService: NamestoreService,
               private activatedRoute: ActivatedRoute,
+              private configService: ConfigService,
               private router: Router,) {}
 
   ngOnInit() {
@@ -59,11 +61,6 @@ export class EditIdentityComponent implements OnInit {
     this.newAttribute = new Attribute('', '', '', '', 'STRING', '');
     this.newAttested = new Attribute('', '', '', '', 'STRING', '');
     this.newAttestation = new Attestation('', '', '', 'JWT', '', null, []);
-
-
-    if (undefined !== this.activatedRoute.snapshot.queryParams["experiments"]) 
{
-      this.setExperimental("true" === 
this.activatedRoute.snapshot.queryParams["experiments"]);
-    }
     this.activatedRoute.params.subscribe(p => {
       if (p['id'] === undefined) {
         return;
@@ -647,24 +644,13 @@ export class EditIdentityComponent implements OnInit {
           newAuthorization[key] = value;
         }
           )
-  
         this.authorizations.push(newAuthorization);
       }
-      
     });
   }
 
-  setExperimental(set) {
-    if (set) {
-      localStorage.setItem('reclaimExperiments', 'enabled');
-    } else {
-      localStorage.setItem('reclaimExperiments', '');
-    }
-  }
-
   isExperimental() {
-    var exp = localStorage.getItem('reclaimExperiments');
-    return ((undefined !== exp) && ("" !== exp));
+    return this.configService.get().experimental;
   }
 
 }
diff --git a/src/assets/config.json b/src/assets/config.json
index c46d4fa..9245d6d 100644
--- a/src/assets/config.json
+++ b/src/assets/config.json
@@ -1,3 +1,4 @@
 {
-    "apiUrl": "http://localhost:7776";
+    "apiUrl": "http://localhost:7776";,
+    "experiments": false
 }
diff --git a/src/styles.scss b/src/styles.scss
index 6638235..600ef4a 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -23,10 +23,15 @@ div.card {
   background-color: lightgray;
 }
 
+.custom-select {
+  width: auto;
+}
+
 button.btn, a.btn {
   box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.5);
   border-radius: 10rem;
   background-image: none;
+  margin: 0.5em;
 }
 
 button.btn:hover, a.button:hover {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]