gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 189/459: experimental switch added


From: gnunet
Subject: [reclaim-ui] 189/459: experimental switch added
Date: Fri, 11 Jun 2021 23:24:41 +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 52dbb22f2295fe09c0b64fc7cc501aad34608836
Author: Schanzenbach, Martin <mschanzenbach@posteo.de>
AuthorDate: Fri Feb 14 10:00:31 2020 +0100

    experimental switch added
---
 src/app/edit-identity/edit-identity.component.html |  3 +--
 src/app/edit-identity/edit-identity.component.ts   | 18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index 8fb500b..0e40c6c 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -141,7 +141,7 @@
         <li>IDs and values may not be empty!</li>
       </ul>
     </div>
-    <button class="btn btn-primary mb-4 fhg-link" 
(click)="getFhGAttestation()">
+    <button *ngIf="isExperimental()" class="btn btn-primary mb-4 fhg-link" 
(click)="getFhGAttestation()">
       <span class="fa fa-user"></span> Link Fraunhofer Account
     </button>
     <hr/>
@@ -163,4 +163,3 @@
     </div>
   </div>
 </div>
-
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index 8a6f63a..fff2499 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -46,7 +46,10 @@ export class EditIdentityComponent implements OnInit {
     this.identity = new Identity('','');
     this.newAttribute = new Attribute('', '', '', '', 'STRING', '');
     this.newAttested = new Attribute('', '', '', '', 'STRING', '');
-      this.activatedRoute.params.subscribe(p => {
+    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;
       }
@@ -614,4 +617,17 @@ export class EditIdentityComponent implements OnInit {
     window.location.href = 
"http://localhost:4567/authorize?redirect_uri=http%3A%2F%2Flocalhost:4200%2Findex.html&client_id=reclaimid&response_type=code&scopes=openid";;
   }
 
+  setExperimental(set) {
+    if (set) {
+      localStorage.setItem('reclaimExperiments', 'enabled');
+    } else {
+      localStorage.setItem('reclaimExperiments', '');
+    }
+  }
+
+  isExperimental() {
+    var exp = localStorage.getItem('reclaimExperiments');
+    return ((undefined !== exp) && ("" !== exp));
+  }
+
 }

-- 
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]