mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
70504: Implement feedback
This commit is contained in:
@@ -45,6 +45,13 @@ export function getProfileModulePath() {
|
|||||||
return `/${PROFILE_MODULE_PATH}`;
|
return `/${PROFILE_MODULE_PATH}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const REGISTER_PATH = 'register';
|
||||||
|
|
||||||
|
export function getRegisterPath() {
|
||||||
|
return `/${REGISTER_PATH}`;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const WORKFLOW_ITEM_MODULE_PATH = 'workflowitems';
|
const WORKFLOW_ITEM_MODULE_PATH = 'workflowitems';
|
||||||
|
|
||||||
export function getWorkflowItemModulePath() {
|
export function getWorkflowItemModulePath() {
|
||||||
@@ -71,7 +78,7 @@ export function getDSOPath(dso: DSpaceObject): string {
|
|||||||
{ path: 'community-list', loadChildren: './community-list-page/community-list-page.module#CommunityListPageModule' },
|
{ path: 'community-list', loadChildren: './community-list-page/community-list-page.module#CommunityListPageModule' },
|
||||||
{ path: 'id', loadChildren: './+lookup-by-id/lookup-by-id.module#LookupIdModule' },
|
{ path: 'id', loadChildren: './+lookup-by-id/lookup-by-id.module#LookupIdModule' },
|
||||||
{ path: 'handle', loadChildren: './+lookup-by-id/lookup-by-id.module#LookupIdModule' },
|
{ path: 'handle', loadChildren: './+lookup-by-id/lookup-by-id.module#LookupIdModule' },
|
||||||
{ path: 'register', loadChildren: './register-page/register-page.module#RegisterPageModule' },
|
{ path: REGISTER_PATH, loadChildren: './register-page/register-page.module#RegisterPageModule' },
|
||||||
{ path: COMMUNITY_MODULE_PATH, loadChildren: './+community-page/community-page.module#CommunityPageModule' },
|
{ path: COMMUNITY_MODULE_PATH, loadChildren: './+community-page/community-page.module#CommunityPageModule' },
|
||||||
{ path: COLLECTION_MODULE_PATH, loadChildren: './+collection-page/collection-page.module#CollectionPageModule' },
|
{ path: COLLECTION_MODULE_PATH, loadChildren: './+collection-page/collection-page.module#CollectionPageModule' },
|
||||||
{ path: ITEM_MODULE_PATH, loadChildren: './+item-page/item-page.module#ItemPageModule' },
|
{ path: ITEM_MODULE_PATH, loadChildren: './+item-page/item-page.module#ItemPageModule' },
|
||||||
|
@@ -15,7 +15,7 @@ describe('ConfirmedValidator', () => {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should validate a language according to the iso-639-1 standard', fakeAsync(() => {
|
it('should validate that the password and confirm password match', fakeAsync(() => {
|
||||||
|
|
||||||
passwordForm.get('password').patchValue('test-password');
|
passwordForm.get('password').patchValue('test-password');
|
||||||
passwordForm.get('confirmPassword').patchValue('test-password-mismatch');
|
passwordForm.get('confirmPassword').patchValue('test-password-mismatch');
|
||||||
@@ -23,7 +23,7 @@ describe('ConfirmedValidator', () => {
|
|||||||
expect(passwordForm.valid).toBe(false);
|
expect(passwordForm.valid).toBe(false);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should invalidate a language that does not comply to the iso-639-1 standard', fakeAsync(() => {
|
it('should invalidate that the password and confirm password match', fakeAsync(() => {
|
||||||
passwordForm.get('password').patchValue('test-password');
|
passwordForm.get('password').patchValue('test-password');
|
||||||
passwordForm.get('confirmPassword').patchValue('test-password');
|
passwordForm.get('confirmPassword').patchValue('test-password');
|
||||||
|
|
||||||
|
@@ -142,11 +142,13 @@ export class CreateProfileComponent implements OnInit {
|
|||||||
const eperson = Object.assign(new EPerson(), values);
|
const eperson = Object.assign(new EPerson(), values);
|
||||||
this.ePersonDataService.createEPersonForToken(eperson, this.token).subscribe((response) => {
|
this.ePersonDataService.createEPersonForToken(eperson, this.token).subscribe((response) => {
|
||||||
if (response.isSuccessful) {
|
if (response.isSuccessful) {
|
||||||
this.notificationsService.success('register-page.create-profile.submit.success.head', 'register-page.create-profile.submit.success.content');
|
this.notificationsService.success(this.translateService.get('register-page.create-profile.submit.success.head'),
|
||||||
|
this.translateService.get('register-page.create-profile.submit.success.content'));
|
||||||
this.store.dispatch(new AuthenticateAction(this.email, this.password.value));
|
this.store.dispatch(new AuthenticateAction(this.email, this.password.value));
|
||||||
this.router.navigate(['/home']);
|
this.router.navigate(['/home']);
|
||||||
} else {
|
} else {
|
||||||
this.notificationsService.error('register-page.create-profile.submit.error.head', 'register-page.create-profile.submit.error.content');
|
this.notificationsService.error(this.translateService.get('register-page.create-profile.submit.error.head'),
|
||||||
|
this.translateService.get('register-page.create-profile.submit.error.content'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -8,6 +8,6 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="#">{{"login.form.new-user" | translate}}</a>
|
<a class="dropdown-item" [routerLink]="[getRegisterPath()]">{{"login.form.new-user" | translate}}</a>
|
||||||
<a class="dropdown-item" href="#">{{"login.form.forgot-password" | translate}}</a>
|
<a class="dropdown-item" href="#">{{"login.form.forgot-password" | translate}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { Store, StoreModule } from '@ngrx/store';
|
import { StoreModule } from '@ngrx/store';
|
||||||
|
|
||||||
import { LogInComponent } from './log-in.component';
|
import { LogInComponent } from './log-in.component';
|
||||||
import { authReducer } from '../../core/auth/auth.reducer';
|
import { authReducer } from '../../core/auth/auth.reducer';
|
||||||
@@ -13,11 +13,11 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|||||||
import { SharedModule } from '../shared.module';
|
import { SharedModule } from '../shared.module';
|
||||||
import { NativeWindowMockFactory } from '../mocks/mock-native-window-ref';
|
import { NativeWindowMockFactory } from '../mocks/mock-native-window-ref';
|
||||||
import { ActivatedRouteStub } from '../testing/active-router.stub';
|
import { ActivatedRouteStub } from '../testing/active-router.stub';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { RouterStub } from '../testing/router.stub';
|
|
||||||
import { NativeWindowService } from '../../core/services/window.service';
|
import { NativeWindowService } from '../../core/services/window.service';
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
import { createTestComponent } from '../testing/utils.test';
|
import { createTestComponent } from '../testing/utils.test';
|
||||||
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
|
|
||||||
describe('LogInComponent', () => {
|
describe('LogInComponent', () => {
|
||||||
|
|
||||||
@@ -46,6 +46,7 @@ describe('LogInComponent', () => {
|
|||||||
strictActionImmutability: false
|
strictActionImmutability: false
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
RouterTestingModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
TranslateModule.forRoot()
|
TranslateModule.forRoot()
|
||||||
],
|
],
|
||||||
@@ -55,7 +56,7 @@ describe('LogInComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: AuthService, useClass: AuthServiceStub },
|
{ provide: AuthService, useClass: AuthServiceStub },
|
||||||
{ provide: NativeWindowService, useFactory: NativeWindowMockFactory },
|
{ provide: NativeWindowService, useFactory: NativeWindowMockFactory },
|
||||||
{ provide: Router, useValue: new RouterStub() },
|
// { provide: Router, useValue: new RouterStub() },
|
||||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||||
provideMockStore({ initialState }),
|
provideMockStore({ initialState }),
|
||||||
LogInComponent
|
LogInComponent
|
||||||
|
@@ -8,6 +8,7 @@ import { AuthMethod } from '../../core/auth/models/auth.method';
|
|||||||
import { getAuthenticationMethods, isAuthenticated, isAuthenticationLoading } from '../../core/auth/selectors';
|
import { getAuthenticationMethods, isAuthenticated, isAuthenticationLoading } from '../../core/auth/selectors';
|
||||||
import { CoreState } from '../../core/core.reducers';
|
import { CoreState } from '../../core/core.reducers';
|
||||||
import { AuthService } from '../../core/auth/auth.service';
|
import { AuthService } from '../../core/auth/auth.service';
|
||||||
|
import { getRegisterPath } from '../../app-routing.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* /users/sign-in
|
* /users/sign-in
|
||||||
@@ -82,4 +83,7 @@ export class LogInComponent implements OnInit, OnDestroy {
|
|||||||
this.alive = false;
|
this.alive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getRegisterPath() {
|
||||||
|
return getRegisterPath();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2068,13 +2068,13 @@
|
|||||||
|
|
||||||
"register-page.create-profile.submit": "Complete Registration",
|
"register-page.create-profile.submit": "Complete Registration",
|
||||||
|
|
||||||
"register-page.create-profile.submit.error.content": "Registration failed",
|
"register-page.create-profile.submit.error.content": "Something went wrong while registering a new user.",
|
||||||
|
|
||||||
"register-page.create-profile.submit.error.head": "Something went wrong while registering a new user.",
|
"register-page.create-profile.submit.error.head": "Registration failed",
|
||||||
|
|
||||||
"register-page.create-profile.submit.success.content": "Registration completed",
|
"register-page.create-profile.submit.success.content": "The registration was successful. You have been logged in as the created user.",
|
||||||
|
|
||||||
"register-page.create-profile.submit.success.head": "The registration was successful. You have been logged in as the created user.",
|
"register-page.create-profile.submit.success.head": "Registration completed",
|
||||||
|
|
||||||
|
|
||||||
"register-page.registration.header": "New user registration",
|
"register-page.registration.header": "New user registration",
|
||||||
|
Reference in New Issue
Block a user