[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-ui] 401/459: improve import logic and UI
From: |
gnunet |
Subject: |
[reclaim-ui] 401/459: improve import logic and UI |
Date: |
Fri, 11 Jun 2021 23:28:13 +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 b5a46724074109b87c449fc2f3e7d751cc39bf86
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sun Jan 3 20:54:25 2021 +0900
improve import logic and UI
---
src/app/edit-identity/edit-identity.component.html | 6 +++---
src/app/edit-identity/edit-identity.component.ts | 14 ++++++++++++--
src/locales/de/messages.json | 1 +
src/locales/en/messages.json | 1 +
4 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/app/edit-identity/edit-identity.component.html
b/src/app/edit-identity/edit-identity.component.html
index 652cb2c..a912457 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -50,12 +50,12 @@
</button>
</div>
</div>
+ <button class="ml-1 btn btn-primary" (click)="abortAttributeImport()">
+ <span class="fa fa-times"></span> {{getMessage("Abort") }}
+ </button>
<button class="ml-1 btn btn-primary" (click)="proceedAttributeImport()">
<span class="fa fa-download"></span> {{getMessage("import") }}
</button>
- <button class="ml-1 btn btn-primary" (click)="abortAttributeImport()">
- <span class="fa fa-download"></span> {{getMessage("Back") }}
- </button>
</div>
<div class="text-center card-body" *ngIf="importInProgress &&
attributesToOverwriteOnImport.length == 0">
<div class="text-center fa fa-4x">
diff --git a/src/app/edit-identity/edit-identity.component.ts
b/src/app/edit-identity/edit-identity.component.ts
index f221e19..9e128bd 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -671,6 +671,7 @@ export class EditIdentityComponent implements OnInit {
for (let overwriteInfo of this.attributesToOverwriteOnImport) {
overwriteInfo[1] = target;
}
+ this.proceedAttributeImport();
}
getAttrValue(attr: Attribute) {
@@ -710,6 +711,7 @@ export class EditIdentityComponent implements OnInit {
}
console.log("Trying to import " + cred.attributes.length + "
attributes");
+ var needsUserInteraction = false;
for (let attr of cred.attributes) {
if ((attr.name == "sub") ||
(attr.name == "nonce") ||
@@ -725,13 +727,21 @@ export class EditIdentityComponent implements OnInit {
continue;
}
console.log("Found conflicting attribute " + attr.name);
- this.attributesToOverwriteOnImport.push([attestation, false]);
+ this.attributesToOverwriteOnImport.push([attestation,
!this.isClaimCred(existAttr)]);
attestation.id = existAttr.id;
+ /* If the new attribute is attested, and the old wasn't, we
+ * override by default. Otherwise, we need to have the user
+ * make a decision
+ */
+ if (this.isClaimCred(existAttr)) {
+ needsUserInteraction = true;
+ }
break;
}
this.attributesToImport.push(attestation);
}
- if (this.attributesToOverwriteOnImport.length > 0) {
+ if ((this.attributesToOverwriteOnImport.length > 0) &&
+ needsUserInteraction) {
console.log("Wait for user input");
return;
}
diff --git a/src/locales/de/messages.json b/src/locales/de/messages.json
index 71d089e..663b4ea 100644
--- a/src/locales/de/messages.json
+++ b/src/locales/de/messages.json
@@ -10,6 +10,7 @@
"Save": "Speichern",
"Note": "Hinweis: ",
"Value": "Wert",
+ "Abort": "Abbrechen",
"keepAll": "Alle behalten",
"overwriteAll": "Alle überschreiben",
"import": "Importieren",
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index 21ca678..0ea8be8 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -10,6 +10,7 @@
"Save": "Save",
"Note": "Note: ",
"Value": "Value",
+ "Abort": "Abort",
"keepAll": "Keep all",
"overwriteAll": "Overwrite all",
"import": "Import",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-ui] 379/459: minor, (continued)
- [reclaim-ui] 379/459: minor, gnunet, 2021/06/11
- [reclaim-ui] 356/459: Merge branch 'master' of gitlab.com:reclaimid/ui, gnunet, 2021/06/11
- [reclaim-ui] 335/459: add template, gnunet, 2021/06/11
- [reclaim-ui] 391/459: fix requested attribute, gnunet, 2021/06/11
- [reclaim-ui] 363/459: fix radio button, gnunet, 2021/06/11
- [reclaim-ui] 362/459: missing credential source, gnunet, 2021/06/11
- [reclaim-ui] 403/459: update state loading, gnunet, 2021/06/11
- [reclaim-ui] 361/459: authorization request dialog in identity list, gnunet, 2021/06/11
- [reclaim-ui] 370/459: build fix, gnunet, 2021/06/11
- [reclaim-ui] 364/459: fine tuning authorization, gnunet, 2021/06/11
- [reclaim-ui] 401/459: improve import logic and UI,
gnunet <=
- [reclaim-ui] 320/459: works on chrome, gnunet, 2021/06/11
- [reclaim-ui] 342/459: Translated using Weblate (German), gnunet, 2021/06/11
- [reclaim-ui] 349/459: fix translations, gnunet, 2021/06/11
- [reclaim-ui] 387/459: update, gnunet, 2021/06/11
- [reclaim-ui] 358/459: clean up, gnunet, 2021/06/11
- [reclaim-ui] 386/459: fix import for browser plugin, other import may be broken, gnunet, 2021/06/11
- [reclaim-ui] 394/459: fix default selection, gnunet, 2021/06/11
- [reclaim-ui] 369/459: add code for straight attribute import, gnunet, 2021/06/11
- [reclaim-ui] 407/459: use share icon, gnunet, 2021/06/11
- [reclaim-ui] 397/459: fix address handling, gnunet, 2021/06/11