mirror of
https://github.com/google/nomulus.git
synced 2025-07-26 04:28:34 +02:00
Pass name/email/phone info to the new console front end (#2180)
This commit is contained in:
parent
4f53ae0e89
commit
779da518df
6 changed files with 49 additions and 13 deletions
|
@ -5,21 +5,23 @@
|
||||||
<mat-icon class="console-app__widget-icon">call</mat-icon>
|
<mat-icon class="console-app__widget-icon">call</mat-icon>
|
||||||
<h1 class="console-app__widget-title">Contact Support</h1>
|
<h1 class="console-app__widget-title">Contact Support</h1>
|
||||||
<h4 class="secondary-text text-center">
|
<h4 class="secondary-text text-center">
|
||||||
View Google Registry support email and phone information
|
Let us know if you have any questions
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="console-app__widget_right">
|
<div class="console-app__widget_right">
|
||||||
<button mat-button color="primary" class="console-app__widget-link">
|
<div class="console-app__widget-section-header">Give us a Call</div>
|
||||||
Give us a Call
|
|
||||||
</button>
|
|
||||||
<p class="secondary-text">
|
<p class="secondary-text">
|
||||||
Call Google Registry support at <b>+1 (404) 978 8419</b>
|
Call {{ userDataService.userData?.productName }} support at
|
||||||
|
<a href="tel:{{ userDataService.userData?.supportPhoneNumber }}">{{
|
||||||
|
userDataService.userData?.supportPhoneNumber
|
||||||
|
}}</a>
|
||||||
</p>
|
</p>
|
||||||
<button mat-button color="primary" class="console-app__widget-link">
|
<div class="console-app__widget-section-header">Send us an Email</div>
|
||||||
Send us an Email
|
|
||||||
</button>
|
|
||||||
<p class="secondary-text">
|
<p class="secondary-text">
|
||||||
Email Google Registry at <b>support@google.com</b>
|
Email {{ userDataService.userData?.productName }} at
|
||||||
|
<a href="mailto:{{ userDataService.userData?.supportEmail }}">{{
|
||||||
|
userDataService.userData?.supportEmail
|
||||||
|
}}</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,11 +13,12 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { UserDataService } from 'src/app/shared/services/userData.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: '[app-contact-widget]',
|
selector: '[app-contact-widget]',
|
||||||
templateUrl: './contact-widget.component.html',
|
templateUrl: './contact-widget.component.html',
|
||||||
})
|
})
|
||||||
export class ContactWidgetComponent {
|
export class ContactWidgetComponent {
|
||||||
constructor() {}
|
constructor(public userDataService: UserDataService) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,11 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
import { GlobalLoader, GlobalLoaderService } from './globalLoader.service';
|
import { GlobalLoader, GlobalLoaderService } from './globalLoader.service';
|
||||||
|
|
||||||
export interface UserData {
|
export interface UserData {
|
||||||
isAdmin: boolean;
|
|
||||||
globalRole: string;
|
globalRole: string;
|
||||||
|
isAdmin: boolean;
|
||||||
|
productName: string;
|
||||||
|
supportEmail: string;
|
||||||
|
supportPhoneNumber: string;
|
||||||
technicalDocsUrl: string;
|
technicalDocsUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,10 @@ body {
|
||||||
min-width: auto !important;
|
min-width: auto !important;
|
||||||
height: min-content !important;
|
height: min-content !important;
|
||||||
}
|
}
|
||||||
|
&-section-header {
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--primary) !important;
|
||||||
|
}
|
||||||
&-title {
|
&-title {
|
||||||
color: var(--primary) !important;
|
color: var(--primary) !important;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
|
@ -40,15 +40,24 @@ public class ConsoleUserDataAction implements JsonGetAction {
|
||||||
|
|
||||||
private final AuthResult authResult;
|
private final AuthResult authResult;
|
||||||
private final Response response;
|
private final Response response;
|
||||||
|
private final String productName;
|
||||||
|
private final String supportPhoneNumber;
|
||||||
|
private final String supportEmail;
|
||||||
private final String technicalDocsUrl;
|
private final String technicalDocsUrl;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ConsoleUserDataAction(
|
public ConsoleUserDataAction(
|
||||||
AuthResult authResult,
|
AuthResult authResult,
|
||||||
Response response,
|
Response response,
|
||||||
|
@Config("productName") String productName,
|
||||||
|
@Config("supportEmail") String supportEmail,
|
||||||
|
@Config("supportPhoneNumber") String supportPhoneNumber,
|
||||||
@Config("technicalDocsUrl") String technicalDocsUrl) {
|
@Config("technicalDocsUrl") String technicalDocsUrl) {
|
||||||
this.response = response;
|
this.response = response;
|
||||||
this.authResult = authResult;
|
this.authResult = authResult;
|
||||||
|
this.productName = productName;
|
||||||
|
this.supportEmail = supportEmail;
|
||||||
|
this.supportPhoneNumber = supportPhoneNumber;
|
||||||
this.technicalDocsUrl = technicalDocsUrl;
|
this.technicalDocsUrl = technicalDocsUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +83,10 @@ public class ConsoleUserDataAction implements JsonGetAction {
|
||||||
// auth checks.
|
// auth checks.
|
||||||
"isAdmin", user.getUserRoles().isAdmin(),
|
"isAdmin", user.getUserRoles().isAdmin(),
|
||||||
"globalRole", user.getUserRoles().getGlobalRole(),
|
"globalRole", user.getUserRoles().getGlobalRole(),
|
||||||
|
// Include static contact resources in this call to minimize round trips
|
||||||
|
"productName", productName,
|
||||||
|
"supportEmail", supportEmail,
|
||||||
|
"supportPhoneNumber", supportPhoneNumber,
|
||||||
// Is used by UI to construct a link to registry resources
|
// Is used by UI to construct a link to registry resources
|
||||||
"technicalDocsUrl", technicalDocsUrl));
|
"technicalDocsUrl", technicalDocsUrl));
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,19 @@ class ConsoleUserDataActionTest {
|
||||||
assertThat(response.getStatus()).isEqualTo(HttpStatusCodes.STATUS_CODE_OK);
|
assertThat(response.getStatus()).isEqualTo(HttpStatusCodes.STATUS_CODE_OK);
|
||||||
Map jsonObject = GSON.fromJson(response.getPayload(), Map.class);
|
Map jsonObject = GSON.fromJson(response.getPayload(), Map.class);
|
||||||
assertThat(jsonObject)
|
assertThat(jsonObject)
|
||||||
.containsExactly("isAdmin", false, "technicalDocsUrl", "test", "globalRole", "FTE");
|
.containsExactly(
|
||||||
|
"isAdmin",
|
||||||
|
false,
|
||||||
|
"technicalDocsUrl",
|
||||||
|
"test",
|
||||||
|
"globalRole",
|
||||||
|
"FTE",
|
||||||
|
"productName",
|
||||||
|
"Nomulus",
|
||||||
|
"supportPhoneNumber",
|
||||||
|
"+1 (212) 867 5309",
|
||||||
|
"supportEmail",
|
||||||
|
"support@example.com");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -71,6 +83,7 @@ class ConsoleUserDataActionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private ConsoleUserDataAction createAction(AuthResult authResult) throws IOException {
|
private ConsoleUserDataAction createAction(AuthResult authResult) throws IOException {
|
||||||
return new ConsoleUserDataAction(authResult, response, "test");
|
return new ConsoleUserDataAction(
|
||||||
|
authResult, response, "Nomulus", "support@example.com", "+1 (212) 867 5309", "test");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue