[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-ui] 100/459: warning if identity name already exists
From: |
gnunet |
Subject: |
[reclaim-ui] 100/459: warning if identity name already exists |
Date: |
Fri, 11 Jun 2021 23:23:12 +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 f0852655a01880cf175e5bdce2b3a93476aa6708
Author: Alexia Pagkopoulou <a.pagkopoulou@tum.de>
AuthorDate: Fri Jun 28 15:57:02 2019 +0200
warning if identity name already exists
---
src/app/identity-list/identity-list.component.html | 12 +++++++++++-
src/app/identity-list/identity-list.component.ts | 8 ++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/app/identity-list/identity-list.component.html
b/src/app/identity-list/identity-list.component.html
index ce8fa1f..4f63ff6 100644
--- a/src/app/identity-list/identity-list.component.html
+++ b/src/app/identity-list/identity-list.component.html
@@ -233,10 +233,19 @@
<div class="card-avatar-character text-dark">
Add Identity </div>
</div>
+
+ <!-- Identity creation -->
+
+ <!-- Invalid input -->
<div *ngIf="'' !== newIdentity.name && !canSave()" class="alert alert-danger
alert-dismissible fade show" role="alert">
Only Alphanumeric input. No spaces or special characters allowed.
</div>
- <div *ngIf="'' === newIdentity.name || canSave()" class="alert
alert-secondary alert-dismissible fade show" role="alert">
+ <!--Identity already exists -->
+ <div *ngIf="isDuplicate(newIdentity)" class="alert alert-warning
alert-dismissible fade show" role="alert">
+ An identity with this username already exists.
+ </div>
+ <!-- Input text -->
+ <div *ngIf="('' === newIdentity.name || canSave()) &&
!isDuplicate(newIdentity); else invalid_identity_name" class="alert
alert-secondary alert-dismissible fade show" role="alert">
Enter a username for your new identity
</div>
<div class="card-body">
@@ -251,6 +260,7 @@
</button>
</div>
</div>
+
<div *ngIf="0 != identities.length && !isAddIdentity() && (null ==
identityInEdit)" style="margin-top: 1em; text-align: center;">
<button class="btn btn-primary" (click)="addIdentity()">
<span class="fa fa-plus"></span> Add identity
diff --git a/src/app/identity-list/identity-list.component.ts
b/src/app/identity-list/identity-list.component.ts
index d9d1413..9241143 100644
--- a/src/app/identity-list/identity-list.component.ts
+++ b/src/app/identity-list/identity-list.component.ts
@@ -160,6 +160,14 @@ export class IdentityListComponent implements OnInit {
isAddIdentity() { return null != this.newIdentity; }
+ isDuplicate(identity)
+ {
+ for (let i = 0; i < this.identities.length; i++) {
+ if (this.identities[i].name === this.newIdentity.name) {
+ return true;
+ }
+ }
+ }
canSave()
{
if (this.newIdentity.name == null) {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-ui] 91/459: fix html, (continued)
- [reclaim-ui] 91/459: fix html, gnunet, 2021/06/11
- [reclaim-ui] 89/459: actually display info, gnunet, 2021/06/11
- [reclaim-ui] 96/459: openid logo fix, gnunet, 2021/06/11
- [reclaim-ui] 84/459: fix client name check, gnunet, 2021/06/11
- [reclaim-ui] 105/459: add reclaim watermark, gnunet, 2021/06/11
- [reclaim-ui] 92/459: layout fixes, gnunet, 2021/06/11
- [reclaim-ui] 81/459: identity card, gnunet, 2021/06/11
- [reclaim-ui] 97/459: open id logo: removed float altogether, gnunet, 2021/06/11
- [reclaim-ui] 98/459: openid hotfix, gnunet, 2021/06/11
- [reclaim-ui] 118/459: add unkown name, gnunet, 2021/06/11
- [reclaim-ui] 100/459: warning if identity name already exists,
gnunet <=
- [reclaim-ui] 101/459: minor update to last fix, gnunet, 2021/06/11
- [reclaim-ui] 103/459: disable button on duplicate ID name, gnunet, 2021/06/11
- [reclaim-ui] 102/459: Merge branch 'master' into 'master', gnunet, 2021/06/11
- [reclaim-ui] 107/459: Merge branch 'master' of https://gitlab.com/reclaimid/ui, gnunet, 2021/06/11
- [reclaim-ui] 99/459: Merge branch 'openid_logo_fix' into 'master', gnunet, 2021/06/11
- [reclaim-ui] 109/459: authentication screen minor updates + search bar for indentities, gnunet, 2021/06/11
- [reclaim-ui] 104/459: indicate disabled button properly, gnunet, 2021/06/11
- [reclaim-ui] 110/459: reverted minor false changes, gnunet, 2021/06/11
- [reclaim-ui] 95/459: update deps, gnunet, 2021/06/11
- [reclaim-ui] 108/459: Merge branch 'master' into 'master', gnunet, 2021/06/11