Production release February 2024 [CONNECT] #34

Merged
konstantina.galouni merged 168 commits from develop into master 2024-02-15 11:04:20 +01:00
4 changed files with 32 additions and 12 deletions
Showing only changes of commit 48ce09e400 - Show all commits

View File

@ -27,7 +27,6 @@ export class UserComponent {
public errorCode: string = "";
public redirectUrl: string = "";
public routerHelper: RouterHelper = new RouterHelper();
public loginUrl;
public properties: EnvProperties = properties;
@Input() mainComponent = true;
@ -40,7 +39,6 @@ export class UserComponent {
}
ngOnInit() {
this.loginUrl = this.properties.loginUrl;
if (typeof document !== 'undefined') {
this.server = false;
this.userManagementsService.updateUserInfo( () => {

View File

@ -1,10 +1,10 @@
import {AfterViewInit, ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewChild} from "@angular/core";
import {AfterViewInit, ChangeDetectorRef, Component, Input, OnInit, ViewChild} from "@angular/core";
import {Role, User} from "../login/utils/helper.class";
import {ActivatedRoute, Router} from "@angular/router";
import {UserManagementService} from "../services/user-management.service";
import {UserRegistryService} from "../services/user-registry.service";
import {LoginErrorCodes} from "../login/utils/guardHelper.class";
import {Subscriber, Subscription} from "rxjs";
import {Subscription} from "rxjs";
import {UntypedFormBuilder, UntypedFormControl, Validators} from "@angular/forms";
import {AlertModal} from "../utils/modal/alert";
import {properties} from "../../../environments/environment";
@ -88,7 +88,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
@Input()
public name: string;
@Input()
public service: "connect" | "monitor" = "monitor";
public service: "connect" | "monitor" | "irish" = "monitor";
@Input()
public userInfoLinkPrefix = '';
@Input()
@ -216,7 +216,10 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
if (this.paramsSubscription instanceof Subscription) {
this.paramsSubscription.unsubscribe();
}
if (this.service === "monitor" ) {
if(this.service === "irish") {
this.loading = false;
this.userManagementService.login(properties.domain + '/admin/' + this.verification.entity);
} else if (this.service === "monitor" ) {
this.loading = false;
this._router.navigate(['/admin/' + this.verification.entity]);
} else {

View File

@ -7,6 +7,7 @@ import {properties} from "../../../environments/environment";
import {StringUtils} from "../utils/string-utils.class";
import {CustomOptions} from "./servicesUtils/customOptions.class";
import {AdvancedAsyncSubject} from "../utils/AdvancedAsyncSubject";
import {isArray} from "rxjs/internal-compatibility";
@Injectable({
providedIn: 'root'
@ -80,18 +81,36 @@ export class UserManagementService {
}
}
public login() {
if (this.fixRedirectURL) {
public login(redirect: string = null) {
if(redirect) {
this.redirectUrl = redirect;
} else if (this.fixRedirectURL) {
this.setRedirectUrl(this.fixRedirectURL);
} else {
this.setRedirectUrl();
}
window.location.href = properties.loginUrl + "?redirect=" + this.redirectUrl;
window.location.href = this.setURL(properties.loginUrl) + encodeURIComponent(this.redirectUrl);
}
public logout() {
this.setRedirectUrl();
Session.removeUser();
window.location.href = properties.logoutUrl + "?redirect=" + this.redirectUrl;
window.location.href = this.setURL(properties.logoutUrl) + encodeURIComponent(this.redirectUrl);
}
setURL(url: string | string[]) {
if(isArray(url)) {
let redirectURL = '';
url.forEach((url, index) => {
if(index === 0) {
redirectURL = url + "?redirect=";
} else {
redirectURL += encodeURIComponent(url + "?redirect=");
}
});
return redirectURL;
} else {
return url + "?redirect=";
}
}
}

View File

@ -57,9 +57,9 @@ export interface EnvProperties {
vocabulariesAPI?: string;
piwikBaseUrl?: string;
piwikSiteId?: string;
loginUrl?: string;
loginUrl?: string | string[];
registryUrl?: string;
logoutUrl?: string;
logoutUrl?: string | string[];
userInfoUrl?: string;
developersApiUrl?: string,
cookieDomain?: string;