72541: Renamed end-user-agreement-guard and -service; Add metadata on registry; privacy statement component

This commit is contained in:
Kristof De Langhe
2020-08-21 11:22:02 +02:00
parent d46355e274
commit ecf75efe99
27 changed files with 227 additions and 54 deletions

View File

@@ -14,6 +14,10 @@ import { AuthenticateAction } from '../../core/auth/auth.actions';
import { NotificationsService } from '../../shared/notifications/notifications.service';
import { environment } from '../../../environments/environment';
import { isEmpty } from '../../shared/empty.util';
import {
END_USER_AGREEMENT_METADATA_FIELD,
EndUserAgreementService
} from '../../core/end-user-agreement/end-user-agreement.service';
/**
* Component that renders the create profile page to be used by a user registering through a token
@@ -41,7 +45,8 @@ export class CreateProfileComponent implements OnInit {
private router: Router,
private route: ActivatedRoute,
private formBuilder: FormBuilder,
private notificationsService: NotificationsService
private notificationsService: NotificationsService,
private endUserAgreementService: EndUserAgreementService
) {
}
@@ -137,6 +142,16 @@ export class CreateProfileComponent implements OnInit {
requireCertificate: false
};
// If the End User Agreement cookie is accepted, add end-user agreement metadata to the user
if (this.endUserAgreementService.isCookieAccepted()) {
values.metadata[END_USER_AGREEMENT_METADATA_FIELD] = [
{
value: String(true)
}
];
this.endUserAgreementService.removeCookieAccepted();
}
const eperson = Object.assign(new EPerson(), values);
this.ePersonDataService.createEPersonForToken(eperson, this.token).subscribe((response) => {
if (response.isSuccessful) {