mirror of
https://github.com/google/nomulus.git
synced 2025-05-06 06:57:50 +02:00
We have several "consoles" ("views" in the registrar console). They all affect the same resource - the registrar itself. Currently, each view creates its own "RESTful resource", even though it's the same resource for all of them, meaning we have copied code and copied "URL endpoint" across multiple files. I assume this was made so that IF one day we have a "view" to another resource, we can easily add it. But we currently don't have any such view, nor plans to add any. So according to the YAGNI paradigm, it's better to move the resource creation outside of the console. Also, IF we do add a view to a different resource - it'll still be more readable to have a map from the "view" to the "resource URL endpoint" alongside the existing map from the "view" to the "console"... ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=213992967
46 lines
1.6 KiB
JavaScript
46 lines
1.6 KiB
JavaScript
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
goog.provide('registry.registrar.ContactUs');
|
|
|
|
goog.require('goog.dom');
|
|
goog.require('registry.Resource');
|
|
goog.require('registry.ResourceComponent');
|
|
goog.require('registry.soy.registrar.console');
|
|
|
|
goog.forwardDeclare('registry.registrar.Console');
|
|
|
|
|
|
|
|
/**
|
|
* Contact Us page.
|
|
* @param {!registry.registrar.Console} console
|
|
* @param {!registry.Resource} resource the RESTful resource for the registrar.
|
|
* @constructor
|
|
* @extends {registry.ResourceComponent}
|
|
* @final
|
|
*/
|
|
registry.registrar.ContactUs = function(console, resource) {
|
|
registry.registrar.ContactUs.base(
|
|
this, 'constructor', console, resource,
|
|
registry.soy.registrar.console.contactUs, null);
|
|
};
|
|
goog.inherits(registry.registrar.ContactUs, registry.ResourceComponent);
|
|
|
|
|
|
/** @override */
|
|
registry.registrar.ContactUs.prototype.bindToDom = function(id) {
|
|
registry.registrar.ContactUs.base(this, 'bindToDom', '');
|
|
goog.dom.removeChildren(goog.dom.getRequiredElement('reg-app-buttons'));
|
|
};
|