mocha/python/mocha/web/ui/pages/BaseWebPage.py

58 lines
1.7 KiB
Python

from ...WebScript import WebScript
from ...WebPage import WebPage
from ....oms import Oms
from ...WebStyleSheetReference import WebStyleSheetReference
class BaseWebPage (WebPage):
def __init__(self):
WebPage.__init__(self)
self._oms = None
def on_initializing(self):
self.get_style_sheet().add_rule('table', { 'width': '100%' })
self.get_head().add(self.get_client_config_script())
self.get_head().add(WebStyleSheetReference("/madi/asset/ui-html/2024.03.09/css/main.css"))
def get_oms(self):
return self._oms
def set_oms(self, oms : Oms):
self._oms = oms
def get_client_config_script(self):
return WebScript("text/javascript", content="""
// Add properties to mocha
window.mocha = window.mocha || {};
mocha.tenant = '""" + self.get_oms().get_tenant_name() + """';
mocha.clientOrigin = 'https://wd5-impl.workday.com';
mocha.language = 'en_US';
mocha.clientVersion = '0';
mocha.systemConfidenceLevel = 'PROD';
mocha.oauthAuthorizationPending = false;
mocha.proxyLoginEnabled = false;
mocha.maintenancePageUrl = 'https://wd5-impl.workday.com/wday/drs/outage?t=cityoforlando3';
mocha.deviceTrustDetailsUrl = '';
mocha.pendingAuthDetailsUrl = '';
mocha.webAuthnDetailsUrl = '';
mocha.enableBluePrimaryButtons = 'false';
// Construct init params for GWT app
mocha.initParams = {
authGatewayPath: '/wday/authgwy',
baseDir: '/wday/asset/ui-html/',
systemConfidenceLevel: 'PROD',
cdn: {
endpoint: 'wd5-impl.workdaycdn.com',
enabled: true,
allowed: true
},
proxyEnabled: false,
currentVersion: '20.0.04.045',
serviceType: 'authgwy',
loginAuthURL: '/cityoforlando3/login-auth.xml',
environment: 'Implementation - cityoforlando3',
environmentType: 'IMPL'
};
""")