@tririga/tri-template
Version:
A simple tool for generating IBM TRIRIGA UX view skeletons from available templates.
52 lines (42 loc) • 1.82 kB
JavaScript
/*
@license
IBM Confidential - OCO Source Materials - (C) COPYRIGHT IBM CORP. 2015-2018 - The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has been deposited with the U.S. Copyright Office.
*/
/*
The @element.js and @element-ui.js are provided as a template to help the developer to define an alternate login page for UX applications.
Design Guidelines:
1) Use the triplat-login to authenticate the user.
2) Change the @element-ui by your own login ui.
Enabling the Alternate UX Login Feature:
1) In the Admin Console, go to the System Manager and edit the TRIRIGA Web Property File and define the following:
ALTERNATE_UX_LOGIN_VIEW = @element
2) Re-start the application server.
*/
import { Polymer } from "../@polymer/polymer/lib/legacy/polymer-fn.js";
import { html } from "../@polymer/polymer/lib/utils/html-tag.js";
import "./@element-ui.js";
import "../triplat-login/triplat-login.js";
Polymer({
_template: html`
<@element-ui class="body" id="loginUI" username="{{username}}" password="{{password}}" login-title="IBM TRIRIGA" on-login="_handleLogin" on-force-login="_handleForceLogin">
</@element-ui>
<triplat-login id="loginControl" username="[[username]]" password="[[password]]" on-unauthorized="_handleUnauthorized" on-already-logged="_handleAlreadyLogged" on-error="_handleError">
</triplat-login>
`,
is: "@element",
_handleLogin: function(e) {
this.$.loginControl.login();
},
_handleForceLogin: function(){
this.$.loginControl.forceLogin();
},
_handleUnauthorized: function(e) {
this.$.loginUI.showUnauthorizedMessage();
},
_handleAlreadyLogged: function(e) {
this.$.loginUI.showAlreadyLoggedMessage();
},
_handleError: function(e) {
this.$.loginUI.showErrorMessage();
}
});