Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/java/teammates/ui/output/ConfigData.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@
public class ConfigData implements ApiOutput {
private final Set<LoginMethod> loginMethods;
private final String frontendUrl;
private final String supportEmail;

public ConfigData() {
this.loginMethods = Config.getSupportedLoginMethods();
this.frontendUrl = Config.APP_FRONTEND_URL;
this.supportEmail = Config.SUPPORT_EMAIL;
}

public Set<LoginMethod> getLoginMethods() {
return loginMethods;
}

public String getSupportEmail() {
return supportEmail;
}

public String getFrontendUrl() {
return frontendUrl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`ErrorReportComponent > should snap with default view 1`] = `
<tm-error-report
configService={[Function _ConfigService]}
content=""
csrfErrorMessages={[Function Array]}
errorMessage=""
Expand All @@ -13,7 +14,7 @@ exports[`ErrorReportComponent > should snap with default view 1`] = `
sendButtonEnabled={[Function Boolean]}
statusMessageService={[Function _StatusMessageService]}
subject={[Function String]}
supportEmail={[Function String]}
supportEmail={[Function Function]}
>
<div
class="container error-container"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2>Uh oh! Something went wrong.</h2>
</p>
<p>
For further support, please contact our email address at
<a href="mailto:{{ supportEmail }}">{{ supportEmail }}</a
<a href="mailto:{{ supportEmail() }}">{{ supportEmail() }}</a
>.
</p>
</div>
Expand Down
9 changes: 7 additions & 2 deletions src/web/app/components/error-report/error-report.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Component, OnInit, inject } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { FormsModule } from '@angular/forms';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap/modal';
import { environment } from '../../../environments/environment';
import { map } from 'rxjs/operators';
import { ConfigService } from '../../../services/config.service';
import { ErrorReportService } from '../../../services/error-report.service';
import { StatusMessageService } from '../../../services/status-message.service';
import { ErrorReportRequest } from '../../../types/api-request';
Expand All @@ -20,6 +22,7 @@ export class ErrorReportComponent implements OnInit {
private errorReportService = inject(ErrorReportService);
private ngbActiveModal = inject(NgbActiveModal);
private statusMessageService = inject(StatusMessageService);
private configService = inject(ConfigService);

errorMessage = '';
subject = 'User-submitted Error Report';
Expand All @@ -29,7 +32,9 @@ export class ErrorReportComponent implements OnInit {
errorReportEnabled = true;
errorReportSubmitted = false;
csrfErrorMessages: string[] = ['Missing CSRF token.', 'Invalid CSRF token.'];
readonly supportEmail: string = environment.supportEmail;
readonly supportEmail = toSignal(this.configService.getConfig().pipe(map((config) => config.supportEmail)), {
initialValue: '',
});

ngOnInit(): void {
if (this.csrfErrorMessages.includes(this.errorMessage)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h5 class="modal-title">Reject Verification Request</h5>
}
<p class="mb-2">
If you believe this decision was made in error, or if you have additional information that may support your
request, please contact us at {{ supportEmail }}.
request, please contact us at {{ supportEmail() }}.
</p>
<p class="mb-2">Thank you for your understanding.</p>
<p class="mb-0">- The TEAMMATES Team</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { ChangeDetectionStrategy, Component, Input, computed, inject, signal } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { FormsModule } from '@angular/forms';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap/modal';
import { environment } from '../../../../environments/environment';
import { map } from 'rxjs/operators';
import { ConfigService } from '../../../../services/config.service';
import { AccountVerificationRequestRejectionType } from '../../../../types/api-request';

@Component({
Expand All @@ -12,6 +14,7 @@ import { AccountVerificationRequestRejectionType } from '../../../../types/api-r
})
export class RejectRequestModalComponent {
readonly activeModal = inject(NgbActiveModal);
private readonly configService = inject(ConfigService);

@Input() instituteName = '';

Expand Down Expand Up @@ -52,7 +55,9 @@ export class RejectRequestModalComponent {
return { reason, comments };
});

readonly supportEmail = environment.supportEmail;
readonly supportEmail = toSignal(this.configService.getConfig().pipe(map((config) => config.supportEmail)), {
initialValue: '',
});

confirm(): void {
const rejectionType = this.selectedRejectionType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ <h4>Managing Courses</h4>
<p>
The most likely reason for this is that the student has signed in with a different account. Please ask the student
to email
<a href="mailto:{{ supportEmail }}">{{ supportEmail }}</a> so that we help to rectify the problem.
<a href="mailto:{{ supportEmail() }}">{{ supportEmail() }}</a> so that we help to rectify the problem.
</p>
</tm-instructor-help-panel>
<!--Question-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, OnInit, Output, inject } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { CoursesSectionQuestions } from './courses-section-questions';
import { environment } from '../../../../environments/environment';
import { RouterLink } from '@angular/router';
import { map } from 'rxjs/operators';
import { ConfigService } from '../../../../services/config.service';
import { InstructorHelpPanelComponent } from '../instructor-help-panel/instructor-help-panel.component';
import { InstructorHelpSectionComponent } from '../instructor-help-section.component';
import { Sections } from '../sections';
Expand All @@ -16,11 +18,15 @@ import { Sections } from '../sections';
imports: [InstructorHelpPanelComponent, RouterLink],
})
export class InstructorHelpCoursesSectionComponent extends InstructorHelpSectionComponent implements OnInit {
private readonly configService = inject(ConfigService);

// enums
CoursesSectionQuestions!: typeof CoursesSectionQuestions;
Sections!: typeof Sections;

readonly supportEmail: string = environment.supportEmail;
readonly supportEmail = toSignal(this.configService.getConfig().pipe(map((config) => config.supportEmail)), {
initialValue: '',
});

readonly questionsOrder: string[] = [
CoursesSectionQuestions.COURSE_ADD_STUDENTS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ <h2 id="contact-us">6. Contact us</h2>
<div>
<p>
If you have doubts, comments, or questions about using TEAMMATES, just
<a href="mailto:{{ supportEmail }}">email us</a>. We usually respond within 24 hours.
<a href="mailto:{{ supportEmail() }}">email us</a>. We usually respond within 24 hours.
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Component, inject } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { ActivatedRoute } from '@angular/router';
import { environment } from '../../../../environments/environment';
import { map } from 'rxjs/operators';
import { CourseEditFormMode } from '../../../components/course-edit-form/course-edit-form-model';
import { CourseEditFormComponent } from '../../../components/course-edit-form/course-edit-form.component';
import { ConfigService } from '../../../../services/config.service';
import { PageScrollService } from '../../../../services/page-scroll.service';
import { RouterLink } from '@angular/router';
import { ExampleBoxComponent } from '../example-box/example-box.component';
Expand All @@ -24,6 +26,7 @@ import { Sections } from '../sections';
export class InstructorHelpGettingStartedComponent {
private readonly route = inject(ActivatedRoute);
private readonly pageScrollService = inject(PageScrollService);
private readonly configService = inject(ConfigService);

// enum
StudentsSectionQuestions!: typeof StudentsSectionQuestions;
Expand All @@ -33,7 +36,9 @@ export class InstructorHelpGettingStartedComponent {
CourseEditFormMode!: typeof CourseEditFormMode;
Sections!: typeof Sections;

readonly supportEmail: string = environment.supportEmail;
readonly supportEmail = toSignal(this.configService.getConfig().pipe(map((config) => config.supportEmail)), {
initialValue: '',
});
instructorHelpPath = '';

constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ <h1 class="color-orange">Help for Instructors</h1>
<br />
If you are new to TEAMMATES, our <a [routerLink]="instructorGettingStartedPath">Getting Started</a> guide
will introduce you to the basic functions of TEAMMATES. <br />
If you have any remaining questions, don't hesitate to <a href="mailto:{{ supportEmail }}">email us</a>. We
usually respond within 24 hours.
If you have any remaining questions, don't hesitate to <a href="mailto:{{ supportEmail() }}">email us</a>.
We usually respond within 24 hours.
</p>
<div class="row">
<div class="col-md-9">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AfterViewInit, Component, ViewChild, inject } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { FormsModule } from '@angular/forms';
import { ActivatedRoute, Data, Params } from '@angular/router';
import { InstructorHelpCoursesSectionComponent } from './instructor-help-courses-section/instructor-help-courses-section.component';
Expand All @@ -9,7 +10,8 @@ import { SessionsSectionQuestions } from './instructor-help-sessions-section/ses
import { InstructorHelpStudentsSectionComponent } from './instructor-help-students-section/instructor-help-students-section.component';
import { StudentsSectionQuestions } from './instructor-help-students-section/students-section-questions';
import { Sections } from './sections';
import { environment } from '../../../environments/environment';
import { map } from 'rxjs/operators';
import { ConfigService } from '../../../services/config.service';
import { PageScrollService } from '../../../services/page-scroll.service';
import { RouterLink } from '@angular/router';

Expand All @@ -33,10 +35,13 @@ import { RouterLink } from '@angular/router';
export class InstructorHelpPageComponent implements AfterViewInit {
private readonly route = inject(ActivatedRoute);
private readonly pageScrollService = inject(PageScrollService);
private readonly configService = inject(ConfigService);

// enum
Sections!: typeof Sections;
readonly supportEmail: string = environment.supportEmail;
readonly supportEmail = toSignal(this.configService.getConfig().pipe(map((config) => config.supportEmail)), {
initialValue: '',
});
instructorGettingStartedPath = '';
searchTerm = '';
key = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ <h4>Setting Up Sessions</h4>
spam box.
</li>
<li>
Failing all above, ask students to email us at <a href="mailto:{{ supportEmail }}">{{ supportEmail }}</a
Failing all above, ask students to email us at <a href="mailto:{{ supportEmail() }}">{{ supportEmail() }}</a
>. We can resend the email using an alternate means. When they email us, they should use the email address
currently registered in TEAMMATES (for identification).
</li>
Expand Down Expand Up @@ -460,7 +460,8 @@ <h4>Managing Session Responses</h4>
[(isPanelExpanded)]="questionsToCollapsed[SessionsSectionQuestions.STUDENT_ACCESS_SUBMISSION_PAGE]"
>
<p>
Not at the moment. If there is such a need, email us at <a href="mailto:{{ supportEmail }}">{{ supportEmail }}</a
Not at the moment. If there is such a need, email us at
<a href="mailto:{{ supportEmail() }}">{{ supportEmail() }}</a
>, and we'll try to find that information for you.
</p>
</tm-instructor-help-panel>
Expand Down Expand Up @@ -624,7 +625,7 @@ <h4>Managing Session Responses</h4>
specific students. Make sure the session results are published if you are unable to see the option.
</li>
<li>
Failing all above, ask students to email us at <a href="mailto:{{ supportEmail }}">{{ supportEmail }}</a
Failing all above, ask students to email us at <a href="mailto:{{ supportEmail() }}">{{ supportEmail() }}</a
>. We can resend the email using an alternate means. When they email us, they should use the email address
currently registered in TEAMMATES (for identification).
</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { NgbCollapse } from '@ng-bootstrap/ng-bootstrap/collapse';
import {
EXAMPLE_COMMENT_EDIT_FORM_MODEL,
Expand All @@ -16,7 +17,8 @@ import {
EXAMPLE_TEMPLATE_SESSIONS,
} from './instructor-help-sessions-data';
import { SessionsSectionQuestions } from './sessions-section-questions';
import { environment } from '../../../../environments/environment';
import { map } from 'rxjs/operators';
import { ConfigService } from '../../../../services/config.service';
import { Course, FeedbackSession, Instructor, ResponseOutput, Student } from '../../../../types/api-output';
import { AddingQuestionPanelComponent } from '../../../components/adding-question-panel/adding-question-panel.component';
import type { CommentEditFormModel } from '../../../components/comment-box/comment.model';
Expand Down Expand Up @@ -78,6 +80,8 @@ import { TemplateSession } from '../../../../data/template-sessions';
],
})
export class InstructorHelpSessionsSectionComponent extends InstructorHelpSectionComponent implements OnInit {
private readonly configService = inject(ConfigService);

// enums
CommentRowMode!: typeof CommentRowMode;
SessionEditFormMode!: typeof SessionEditFormMode;
Expand All @@ -86,7 +90,9 @@ export class InstructorHelpSessionsSectionComponent extends InstructorHelpSectio
SessionsSectionQuestions!: typeof SessionsSectionQuestions;
Sections!: typeof Sections;

readonly supportEmail: string = environment.supportEmail;
readonly supportEmail = toSignal(this.configService.getConfig().pipe(map((config) => config.supportEmail)), {
initialValue: '',
});
readonly exampleCommentEditFormModel: CommentEditFormModel = EXAMPLE_COMMENT_EDIT_FORM_MODEL;
readonly exampleSessionEditFormModel: SessionEditFormModel = EXAMPLE_SESSION_EDIT_FORM_MODEL;
readonly exampleResponse: ResponseOutput = EXAMPLE_RESPONSE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ <h4>Student Accounts</h4>
At the moment, there is no way for students to update their own (or instructors to update their students') account
emails.
<br />
Please ask the student to <a href="mailto:{{ supportEmail }}">contact us</a> for assistance changing his/her
Please ask the student to <a href="mailto:{{ supportEmail() }}">contact us</a> for assistance changing his/her
account email.
</p>
</tm-instructor-help-panel>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { NgbCollapse } from '@ng-bootstrap/ng-bootstrap/collapse';
import {
EXAMPLE_MULTIPLE_STUDENT_RESULT_TABLES,
EXAMPLE_SINGLE_STUDENT_RESULT_TABLES,
EXAMPLE_STUDENT_ATTRIBUTES,
} from './instructor-help-students-data';
import { StudentsSectionQuestions } from './students-section-questions';
import { environment } from '../../../../environments/environment';
import { map } from 'rxjs/operators';
import { ConfigService } from '../../../../services/config.service';
import { Student } from '../../../../types/api-output';
import { CourseRelatedInfoComponent } from '../../../components/course-related-info/course-related-info.component';
import { InstructorCourseStudentEditPageComponent } from '../../../pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component';
Expand Down Expand Up @@ -38,11 +40,15 @@ import { Sections } from '../sections';
],
})
export class InstructorHelpStudentsSectionComponent extends InstructorHelpSectionComponent implements OnInit {
private readonly configService = inject(ConfigService);

// enums
StudentsSectionQuestions!: typeof StudentsSectionQuestions;
Sections!: typeof Sections;

readonly supportEmail: string = environment.supportEmail;
readonly supportEmail = toSignal(this.configService.getConfig().pipe(map((config) => config.supportEmail)), {
initialValue: '',
});
readonly exampleStudentAttributes: Student = EXAMPLE_STUDENT_ATTRIBUTES;
readonly exampleSingleStudentResultTables: SearchStudentsListRowTable[] = EXAMPLE_SINGLE_STUDENT_RESULT_TABLES;
readonly exampleMultipleStudentResultTables: SearchStudentsListRowTable[] = EXAMPLE_MULTIPLE_STUDENT_RESULT_TABLES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ <h4 class="color-blue">Frequently Asked Questions</h4>
instead.
</li>
</ol>
Please email <a href="mailto:{{ supportEmail }}">{{ supportEmail }}</a> for assistance.
Please email <a href="mailto:{{ supportEmail() }}">{{ supportEmail() }}</a> for assistance.
</div>
</li>
<li>
<b>What should I do if I'm unable to submit my response?</b>
<div>
<a href="mailto:{{ supportEmail }}">Email us</a> so that we can assist you with your submission. Note that we
<a href="mailto:{{ supportEmail() }}">Email us</a> so that we can assist you with your submission. Note that we
cannot do much if the submission deadline is over. It is not up to us (the TEAMMATES team) to accept overdue
submissions.
</div>
Expand All @@ -61,7 +61,7 @@ <h4 class="color-blue">Frequently Asked Questions</h4>
you're unsure.
</li>
<li>
If none of the options above works, <a href="mailto:{{ supportEmail }}">email us</a> and we will resend the
If none of the options above works, <a href="mailto:{{ supportEmail() }}">email us</a> and we will resend the
email using an alternate means. For identification purpose, you should use the email address that was used to
enroll you in the course.
</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Component } from '@angular/core';
import { environment } from '../../../environments/environment';
import { Component, inject } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { RouterLink } from '@angular/router';
import { map } from 'rxjs/operators';
import { ConfigService } from '../../../services/config.service';

/**
* Student help page.
Expand All @@ -12,5 +14,9 @@ import { RouterLink } from '@angular/router';
imports: [RouterLink],
})
export class StudentHelpPageComponent {
readonly supportEmail: string = environment.supportEmail;
private readonly configService = inject(ConfigService);

readonly supportEmail = toSignal(this.configService.getConfig().pipe(map((config) => config.supportEmail)), {
initialValue: '',
});
}
Loading
Loading