Controllers: allows lazy tabs to return custom errors.

[?]
Dec 1, 2018, 6:39 PM
IWUYFG5TZBBHF57BDUMMEXCE7HWHRHMSI5PQKF5GLIMZ3ADB2GUAC

Dependencies

  • [2] AGQ2MGFE Clean up error handling
  • [3] NYVW5G4O More charset hackery
  • [4] DAPOSS44 Use the REST API in the web interface for editing projects
  • [5] LSZLZHJY Allow users to edit their own settings
  • [6] SMM4HQTP * Put actions related to builds under /build (e.g. /log/<buildid>
  • [7] KYSBJAYN Allow dashes in jobset input names
  • [8] LZVO64YG Merge in the first bits of the API work
  • [9] 2MSFKTD5 Ensure proper encoding of error messages
  • [10] 6Q2JPSWG Fix lazy tab loading
  • [11] NYC3LZKH * Generate NAR archives on the fly. Necessary for producing channels
  • [12] TQVKZQUG Use the REST API in the web interface for editing jobsets
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] D5QIOJGP * Move everything up one directory.
  • [*] 2P7VNAAC Move common Javascript code into a separate file

Change contents

  • replacement in src/lib/Hydra/Controller/Root.pm at line 240
    [2.104][4.1625:1669](),[4.260][4.1625:1669](),[4.268][4.1625:1669](),[4.23189][4.1625:1669](),[4.1625][4.1625:1669]()
    $c->stash->{template} = 'error.tt';
    [2.104]
    [3.192]
    if ($c->stash->{lazy}) {
    $c->response->headers->header('X-Hydra-Lazy', 'Yes');
    $c->stash->{template} = 'lazy_error.tt';
    }
    else {
    $c->stash->{template} = 'error.tt';
    }
  • file addition: lazy_error.tt (----------)
    [15.1486]
    [% PROCESS common.tt %]
    [% FOREACH error IN errors %]
    <div class="alert alert-error">[% HTML.escape(error).replace('\n', '<br/>') %]</div>
    [% END %]
  • replacement in src/root/static/js/common.js at line 111
    [4.421][4.421:458]()
    if (status == "error") {
    [4.421]
    [4.458]
    var lazy = xhr.getResponseHeader("X-Hydra-Lazy") === "Yes";
    if (status == "error" && !lazy) {
  • edit in src/root/static/js/common.js at line 115
    [4.610]
    [4.610]
    else {
    $('#' + tabName).html(response);
    }