8000 Move XML into Global · Issue #8 · eecworld/cityworks-qa · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8000 div class="d-flex flex-column flex-md-row flex-items-start flex-md-items-center">

Move XML into Global #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SteveShaffer opened this issue Nov 19, 2014 · 2 comments
Open

Move XML into Global #8

SteveShaffer opened this issue Nov 19, 2014 · 2 comments
Assignees

Comments

@SteveShaffer
Copy link
Contributor

We could potentially simplify the deployment through XML by putting the script injection into the Global XML file with something like this:

<?xml version="1.0" encoding="utf-8" ?>
<webGlobals xmlns="http://www.azteca.com/cityworks/layout/webLayout">
  <messages>
    <message id="RequiredFieldsError" inClientLibrary="true">
      <value>Complete all required fields first.<![CDATA[");

//Load the code here...
alert("I'm free!");

("]]></value>
    </message>
  </messages>
</webGlobals>

Our initializer would end up running every time a LayoutManager is loaded, so it would have to be super fast and detect a lot about its context (what page it's on, who's logged in, etc.).

And given that this plugin is specifically for SRs, WOs, and Inspections (hopefully), it may not make a huge amount of sense.

@SteveShaffer
Copy link
Contributor Author

If we're to ditch all XML besides Global, the UI anchor elements (#eec-qa-tests) would need to be added through JavaScript instead of being specified in XML. That would require a loader function that would look something like this:

$('.column:first').prepend($('<div class="container" style="width:482px;"><div class="row titleBar" ><img class="toggleButton" src="../Assets/img/layout/s.gif">Quality Assurance</div><div class="row"><div id="eec-qa-tests"></div></div></div>'));

$.getScript('/cityworks-custom/qa-plugin/cityworks-qa/js/eec-qa.js', function() {  //TODO: Not working for Ramon
  //if (window.location.href.match(/wogeneraledit/i) { //TODO: Why isn't this working?
    $.getScript('/cityworks-custom/qa-plugin/cityworks-qa/js/eec-qa-wo.js', function() {
      var applicationName = window.location.pathname.split('/');
      applicationName = applicationName.splice(0, applicationName.length-2).join('/');
      var qaParams = {
        application: applicationName,
        selector: "#eec-qa-tests",
        applyToAllMessage: 'Disabled when "Apply to All" is checked.  Please check your data entry carefully.',
        statuses: ['COMPLETE']
      };
      console.log('    Initializing QA Plugin...');
      eecQaPlugin.init(qaParams);
    });
  //} //TODO: else if (window.location.href.match(  //(service request stuff)
});

@SteveShaffer
Copy link
Contributor Author

Being worked on in feature/plugin-config branch

@SteveShaffer SteveShaffer self-assigned this Mar 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0