Pay off technical debt with ConsoleUiServlet

1. Turn ConsoleUiServlet into an action
2. Remove AbstractUiServlet, which fixes its threading bug
3. Use type-safe soy template parameters when rendering console

A follow-up change will add a new template parameter that renders the
payment page link on the navigation bar.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117969638
This commit is contained in:
jart
2016-03-23 22:38:08 -04:00
committed by Justine Tunney
parent 79b2d5a990
commit b6b13333dd
22 changed files with 265 additions and 365 deletions
@@ -54,7 +54,8 @@
* Happy little googley bar.
*/
{template .googlebar}
{@param user: map<string, ?>}
{@param username: string}
{@param logoutUrl: string}
<div id="kd-googlebar" role="banner">
<a class="{css logo}" href="/registrar">
<img src="/assets/images/glogo_black.png" alt="Google">Registry
@@ -79,16 +80,10 @@
</p>
</div>
<div id="kd-social" class="{css kd-buttonbar} {css right}">
{if isNonnull($user['id'])}
<span class="{css kd-name} {css mobile-hide} {css x-crush-hide}">
{$user['name']}{sp}
<a href="{$user['actionHref']}" tabindex="-1">{$user['actionName']}</a>
</span>
{else}
<a href="{$user['actionHref']}"
class="{css kd-button} {css kd-button-submit}"
tabindex="-1">{$user['actionName']}</a>
{/if}
<span class="{css kd-name} {css mobile-hide} {css x-crush-hide}">
{$username}{sp}
<a href="{$logoutUrl}" tabindex="-1">Sign out</a>
</span>
</div>
</div>
{/template}
@@ -7,9 +7,11 @@
* and other templates within it.
*/
{template .main}
{@param user: map<string, ?>} /** Passed to googlebar. */
{@param xsrfToken: string} /** Security token. */
{@param clientId: string} /** App Engine user ID. */
{@param clientId: string} /** Registrar client identifier. */
{@param username: string} /** Arbitrary username to display. */
{@param isAdmin: bool} /** Is this user an App Engine account admin? */
{@param logoutUrl: string} /** Generated URL for logging out of Google. */
{call registry.soy.console.header}
{param app: 'registrar' /}
{param subtitle: 'Registrar Console' /}
@@ -27,7 +29,7 @@
</div>
{switch DEBUG}
{case com.google.domain.registry.ui.ConsoleDebug.PRODUCTION}
{if $user['isAdmin']}
{if $isAdmin}
<script src="/assets/js/registrar_bin_map.js"></script>
{else}
<script src="/assets/js/registrar_bin.js"></script>
@@ -92,11 +94,13 @@
</div>
{/template}
/**
* Who goes thar?!
*/
{template .whoareyou}
{@param user: map<string, string>}
{@param username: string} /** Arbitrary username to display. */
{@param logoutUrl: string} /** Generated URL for logging out of Google. */
{call registry.soy.console.header}
{param app: 'registrar' /}
{param subtitle: 'Please Login' /}
@@ -110,13 +114,12 @@
The account you are logged in as is not associated with Google
Registry. Please contact your customer service representative or
switch to an account associated with Google Registry.
{if isNonnull($user['name'])}
<p>You are signed in as <strong>{$user['name']}</strong>.
{/if}
<p>
You are signed in as <strong>{$username}</strong>.
<div>
<a href="{$user['actionHref']}"
<a href="{$logoutUrl}"
class="{css kd-button} {css kd-button-submit}"
tabindex="-1">{$user['actionName']}</a>
tabindex="-1">Logout and switch to another account</a>
</div>
</div>
{/template}