[develop | DONE | ADDED]: Add quick contact for loggedin users.

This commit is contained in:
Konstantinos Triantafyllou 2023-10-25 10:40:25 +03:00
parent e700de2450
commit 79c198518b
7 changed files with 24 additions and 12 deletions

View File

@ -67,7 +67,6 @@ export class AppComponent implements OnInit, OnDestroy {
/* Contact */
public showQuickContact: boolean;
public showGetStarted: boolean = true;
public contactForm: UntypedFormGroup;
public sending = false;
@ViewChild('quickContact') quickContact: QuickContactComponent;
@ -83,7 +82,6 @@ export class AppComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.reset();
this.subscriptions.push(this.layoutService.hasSidebar.subscribe(hasSidebar => {
this.hasSidebar = hasSidebar;
this.cdr.detectChanges();
@ -98,6 +96,9 @@ export class AppComponent implements OnInit, OnDestroy {
} else if (this.user) {
this.user = user;
}
if(this.user) {
this.reset();
}
this.buildMenu();
this.layoutService.setOpen(true);
this.loading = false;
@ -161,7 +162,7 @@ export class AppComponent implements OnInit, OnDestroy {
private sendMail(admins: string[]) {
this.sending = true;
this.subscriptions.push(this.emailService.contact(this.properties,
Composer.composeEmailForDevelop(this.contactForm.value, admins),
Composer.composeEmailForDevelop(this.contactForm.value, admins, this.user),
this.contactForm.value.recaptcha).subscribe(
res => {
if (res) {

View File

@ -12,6 +12,7 @@ import {SideBarModule} from "./openaireLibrary/dashboard/sharedComponents/sideba
import {NavigationBarModule} from "./openaireLibrary/sharedComponents/navigationBar.module";
import {HttpClientModule} from "@angular/common/http";
import {QuickContactModule} from './openaireLibrary/sharedComponents/quick-contact/quick-contact.module';
import {AlertModalModule} from "./openaireLibrary/utils/modal/alertModal.module";
@NgModule({
declarations: [
@ -28,7 +29,8 @@ import {QuickContactModule} from './openaireLibrary/sharedComponents/quick-conta
ErrorModule,
SharedModule,
NavigationBarModule,
QuickContactModule
QuickContactModule,
AlertModalModule
],
providers: [],
bootstrap: [AppComponent]

@ -1 +1 @@
Subproject commit b69e19fa17a9684d51c68f34c40f632ddd86d94d
Subproject commit aebcb81c7b05d6605422e63ada164715d39b9c01

View File

@ -89,8 +89,8 @@ export class PersonalInfoComponent implements OnInit, OnDestroy {
initForm() {
if(this.info) {
this.form = this.fb.group({
name: this.fb.control(this.info.name, Validators.required),
surname: this.fb.control(this.info.surname, Validators.required),
name: this.fb.control({value: this.info.name, disabled: true}, Validators.required),
surname: this.fb.control({value: this.info.surname, disabled: true}, Validators.required),
email: this.fb.control({value: this.info.email, disabled: true}, Validators.required),
affiliation: this.fb.control(this.info.affiliation, Validators.required),
affiliationType: this.fb.control(this.info.affiliationType, Validators.required),
@ -98,8 +98,8 @@ export class PersonalInfoComponent implements OnInit, OnDestroy {
});
} else {
this.form = this.fb.group({
name: this.fb.control(this.user.firstname, Validators.required),
surname: this.fb.control(this.user.lastname, Validators.required),
name: this.fb.control({value: this.user.firstname, disabled: true}, Validators.required),
surname: this.fb.control({value: this.user.lastname, disabled: true}, Validators.required),
email: this.fb.control({value: this.user.email, disabled: true}, Validators.required),
affiliation: this.fb.control('', Validators.required),
affiliationType: this.fb.control(null, Validators.required),

View File

@ -4,12 +4,15 @@ export let properties: EnvProperties = {
environment: 'beta',
dashboard: 'developers',
useCache: false,
adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-admin-tools/",
loginUrl: "https://beta.services.openaire.eu/developers-api/openid_connect_login",
userInfoUrl: "https://beta.services.openaire.eu/developers-api/userInfo",
developersApiUrl: "https://beta.services.openaire.eu/developers-api",
logoutUrl: "https://beta.services.openaire.eu/developers-api/openid_logout",
domain: 'https://beta.develop.openaire.eu',
errorLink: '/error',
baseLink: ''
baseLink: '',
reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
admins: ["helpdesk@openaire.eu"]
};

View File

@ -4,12 +4,15 @@ export let properties: EnvProperties = {
environment: 'production',
dashboard: 'developers',
useCache: false,
adminToolsAPIURL: "https://services.openaire.eu/uoa-admin-tools/",
loginUrl: "https://services.openaire.eu/developers-api/openid_connect_login",
userInfoUrl: "https://services.openaire.eu/developers-api/userInfo",
developersApiUrl: "https://services.openaire.eu/developers-api",
logoutUrl: "https://services.openaire.eu/developers-api/openid_logout",
domain: 'https://develop.openaire.eu',
errorLink: '/error',
baseLink: ''
baseLink: '',
reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
admins: ["helpdesk@openaire.eu"]
};

View File

@ -9,11 +9,14 @@ export let properties: EnvProperties = {
environment: 'development',
dashboard: 'developers',
useCache: false,
adminToolsAPIURL: "http://duffy.di.uoa.gr:19280/uoa-admin-tools/",
loginUrl: "http://mpagasas.di.uoa.gr:19580/developers-api/openid_connect_login",
userInfoUrl: "http://mpagasas.di.uoa.gr:19580/developers-api/userInfo",
developersApiUrl: "http://mpagasas.di.uoa.gr:19580/developers-api",
logoutUrl: "http://mpagasas.di.uoa.gr:19580/developers-api/openid_logout",
domain: 'http://mpagasas.di.uoa.gr:5001',
errorLink: '/error',
baseLink: ''
baseLink: '',
reCaptchaSiteKey: "6LcVtFIUAAAAAB2ac6xYivHxYXKoUvYRPi-6_rLu",
admins: ["kostis30fylloy@gmail.com", "kiatrop@di.uoa.gr"]
};