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

View File

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

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

View File

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

View File

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

View File

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

View File

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