pending
diff --git a/src/app/user/contacts/user-contact/user-contact.component.scss b/src/app/user/contacts/user-contact/user-contact.component.scss
index 50c37c0..ca1a15c 100644
--- a/src/app/user/contacts/user-contact/user-contact.component.scss
+++ b/src/app/user/contacts/user-contact/user-contact.component.scss
@@ -7,6 +7,8 @@ $trust-diameter: 1em;
$trust-color-1: green;
$trust-color-2: yellow;
+$content-padding: ($contact-width - $avatar-size)/2;
+
.user-contact-wrapper {
width: $contact-width;
border: 3px solid $darker;
@@ -18,12 +20,13 @@ $trust-color-2: yellow;
width: $avatar-size;
height: $avatar-size;
display: block;
- margin: ($contact-width - $avatar-size)/2 auto;
+ margin: $content-padding auto;
}
.contact-username-trust {
text-align: center;
display: block;
+ padding-bottom: $content-padding;
}
.contact-trust-1 {
@@ -42,6 +45,10 @@ $trust-color-2: yellow;
color: $trust-color-1;
}
+.contact-trust {
+ cursor: default;
+}
+
.contact-username {
color: gray;
}
@@ -49,3 +56,25 @@ $trust-color-2: yellow;
.contact-actions {
text-align: center;
}
+
+.contact-reference-toggle {
+ cursor: pointer;
+
+ mat-icon {
+ height: 1em;
+ width: 1em;
+ font-size: 1em;
+ vertical-align: middle;
+ }
+}
+
+.contact-reference {
+ font-size: small;
+ text-align: justify;
+ padding: 0 $content-padding $content-padding;
+
+ .reference-label {
+ color: grey;
+ font-style: italic;
+ }
+}
diff --git a/src/app/user/contacts/user-contact/user-contact.component.spec.ts b/src/app/user/contacts/user-contact/user-contact.component.spec.ts
index 06611d9..1d1f6b5 100644
--- a/src/app/user/contacts/user-contact/user-contact.component.spec.ts
+++ b/src/app/user/contacts/user-contact/user-contact.component.spec.ts
@@ -1,11 +1,11 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
+import { RouterTestingModule } from '@angular/router/testing';
import { Input, Component } from '@angular/core';
import { UserContactComponent } from './user-contact.component';
-
-import { Contact } from '../../../shared/types';
-import { RouterLinkStubDirective } from '../../../../testing/router-stubs';
+import { Contact } from 'app/shared/types';
+import { EditorOutputComponent } from 'app/shared/editor-output/editor-output.component';
+import { MaterialModule } from 'app/material.module';
@Component({ selector: 'app-avatar', template: '' })
class AvatarStubComponent {
@@ -19,10 +19,14 @@ describe('UserContactComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
- UserContactComponent,
- RouterLinkStubDirective,
- AvatarStubComponent
+ AvatarStubComponent,
+ EditorOutputComponent,
+ UserContactComponent
],
+ imports: [
+ MaterialModule,
+ RouterTestingModule
+ ]
})
.compileComponents();
}));
diff --git a/src/app/user/contacts/user-contact/user-contact.component.ts b/src/app/user/contacts/user-contact/user-contact.component.ts
index eb7a46f..752afa0 100644
--- a/src/app/user/contacts/user-contact/user-contact.component.ts
+++ b/src/app/user/contacts/user-contact/user-contact.component.ts
@@ -15,9 +15,40 @@ export class UserContactComponent implements OnInit {
@Input()
public contact: Contact;
+ public referenceVisibility = false;
+
+ // TODO this should be dried
+ public trustLevels = [
+ {
+ value: 1,
+ label: 'some trust: not met in reality'
+ },
+ {
+ value: 2,
+ label: 'trust: acquaintance, friend, ...'
+ },
+ {
+ value: 4,
+ label: 'high trust: good friend, collaborator, ...'
+ },
+ {
+ value: 8,
+ label: 'full trust: close friend, family, long term collaborator, ...'
+ }
+ ];
+
constructor() { }
ngOnInit() {
}
+ get trustLevelDescription(): string {
+ const level = this.trustLevels.find(lvl => lvl.value === this.contact.trust);
+ return level.label;
+ }
+
+ public toggleReferenceVisibility() {
+ this.referenceVisibility = !this.referenceVisibility;
+ }
+
}
diff --git a/src/app/verify-email-code/verify-email-code.component.html b/src/app/verify-email-code/verify-email-code.component.html
index e69de29..bd6bfef 100644
--- a/src/app/verify-email-code/verify-email-code.component.html
+++ b/src/app/verify-email-code/verify-email-code.component.html
@@ -0,0 +1,5 @@
+
+ verifying...
+
+
+
diff --git a/src/app/verify-email-code/verify-email-code.component.spec.ts b/src/app/verify-email-code/verify-email-code.component.spec.ts
index 5309782..2ae7111 100644
--- a/src/app/verify-email-code/verify-email-code.component.spec.ts
+++ b/src/app/verify-email-code/verify-email-code.component.spec.ts
@@ -3,10 +3,11 @@ import { ActivatedRoute, Router } from '@angular/router';
import { VerifyEmailCodeComponent } from './verify-email-code.component';
-import { AuthService } from '../auth.service';
-import { HeaderControlService } from '../header-control.service';
-import { ModelService } from '../model.service';
-import { NotificationsService } from '../notifications/notifications.service';
+import { AuthService } from 'app/auth.service';
+import { FofComponent } from 'app/fof/fof.component';
+import { HeaderControlService } from 'app/header-control.service';
+import { ModelService } from 'app/model.service';
+import { NotificationsService } from 'app/notifications/notifications.service';
class ActivatedRouteStub {
snapshot = {
@@ -52,7 +53,10 @@ describe('VerifyEmailCodeComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
- declarations: [ VerifyEmailCodeComponent ],
+ declarations: [
+ FofComponent,
+ VerifyEmailCodeComponent
+ ],
providers: [
{ provide: AuthService, useValue: authStubService },
{ provide: ActivatedRoute, useClass: ActivatedRouteStub },
@@ -92,7 +96,10 @@ describe('VerifyEmailCodeComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
- declarations: [ VerifyEmailCodeComponent ],
+ declarations: [
+ FofComponent,
+ VerifyEmailCodeComponent
+ ],
providers: [
{ provide: AuthService, useClass: AuthStubService },
{ provide: ActivatedRoute, useClass: ActivatedRouteStub },
@@ -143,7 +150,10 @@ describe('VerifyEmailCodeComponent', () => {
describe('failed verification', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
- declarations: [ VerifyEmailCodeComponent ],
+ declarations: [
+ FofComponent,
+ VerifyEmailCodeComponent
+ ],
providers: [
{ provide: AuthService, useClass: AuthStubService },
{ provide: ActivatedRoute, useClass: ActivatedRouteStub },
diff --git a/src/app/verify-email-code/verify-email-code.component.ts b/src/app/verify-email-code/verify-email-code.component.ts
index c576543..4d6fd33 100644
--- a/src/app/verify-email-code/verify-email-code.component.ts
+++ b/src/app/verify-email-code/verify-email-code.component.ts
@@ -16,6 +16,7 @@ export class VerifyEmailCodeComponent implements OnInit, OnDestroy {
public verifying = true;
public failed = false;
+ public errorMessage = '';
// this is used to launch the after-success part of the page and hide the form
public verificationSuccess: boolean;
@@ -68,13 +69,12 @@ export class VerifyEmailCodeComponent implements OnInit, OnDestroy {
// on success
// inform
this.notify.info(`your email ${email} was successfully verified`);
- // TODO login, when we get jwt token
this.auth.login(token);
// redirect to /home
await this.router.navigate(['/']);
} catch (e) {
this.failed = true;
- // TODO better error reporting
+ this.errorMessage = `verification error: ${e.message}`;
this.notify.error(`there was an error: ${e.message}`);
} finally {
this.verifying = false;