All files / output zcl_abapgit_gui_page_run_bckg.clas.mjs

6.45% Statements 6/93
66.66% Branches 2/3
33.33% Functions 1/3
6.45% Lines 6/93

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 931x 1x 1x             1x                                                                                                                                                                   1x 1x
const {zcl_abapgit_gui_component} = await import("./zcl_abapgit_gui_component.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_gui_page_run_bckg.clas.abap
class zcl_abapgit_gui_page_run_bckg extends zcl_abapgit_gui_component {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_GUI_PAGE_RUN_BCKG';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GUI_EVENT_HANDLER","ZIF_ABAPGIT_GUI_RENDERABLE"];
  static ATTRIBUTES = {"MT_TEXT": {"type": () => {return abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": " "}};
  static METHODS = {"RUN": {"visibility": "I", "parameters": {}},
  "CREATE": {"visibility": "U", "parameters": {"RI_PAGE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});}, "is_optional": " "}}},
  "CONSTRUCTOR": {"visibility": "U", "parameters": {}}};
  #mt_text;
  constructor() {
    const sup = super();
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "SUPER": sup.FRIENDS_ACCESS_INSTANCE,
      "run": this.#run.bind(this),
    };
    this.#mt_text = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    this.FRIENDS_ACCESS_INSTANCE["mt_text"] = this.#mt_text;
  }
  async constructor_(INPUT) {
    await super.constructor_();
    return this;
  }
  async create() {
    return zcl_abapgit_gui_page_run_bckg.create();
  }
  static async create() {
    let ri_page = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});
    let lo_component = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_RUN_BCKG", RTTIName: "\\CLASS=ZCL_ABAPGIT_GUI_PAGE_RUN_BCKG"});
    lo_component.set(await (new abap.Classes['ZCL_ABAPGIT_GUI_PAGE_RUN_BCKG']()).constructor_());
    ri_page.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_HOC'].create({iv_page_title: abap.CharacterFactory.get(14, 'Background Run'), io_page_menu: (await abap.Classes['ZCL_ABAPGIT_GUI_MENUS'].back()), ii_child_component: lo_component})));
    return ri_page;
  }
  async #run() {
    let lx_error = new abap.types.ABAPObject({qualifiedName: "ZCX_ABAPGIT_EXCEPTION", RTTIName: "\\CLASS=ZCX_ABAPGIT_EXCEPTION"});
    let lv_text = new abap.types.String({qualifiedName: "STRING"});
    let lv_line = new abap.types.Integer({qualifiedName: "I"});
    lv_line.set(1);
    try {
      await abap.Classes['ZCL_ABAPGIT_BACKGROUND'].run();
      const indexBackup1 = abap.builtin.sy.get().index.get();
      let unique984 = 1;
      while (true) {
        abap.builtin.sy.get().index.set(unique984++);
        throw new Error("ReadLine, transpiler todo");
        if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
          break;
        }
        abap.statements.append({source: lv_text, target: this.#mt_text});
        lv_line.set(abap.operators.add(lv_line,abap.IntegerFactory.get(1)));
      }
      abap.builtin.sy.get().index.set(indexBackup1);
    } catch (e) {
      if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) {
        lx_error.set(e);
        abap.statements.append({source: (await lx_error.get().if_message$get_text()), target: this.#mt_text});
      } else {
        throw e;
      }
    }
  }
  async zif_abapgit_gui_event_handler$on_event(INPUT) {
    let rs_handled = new abap.types.Structure({
    "page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
    "state": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER=>TY_HANDLING_RESULT-STATE"})}, "zif_abapgit_gui_event_handler=>ty_handling_result", undefined, {}, {});
    let ii_event = INPUT?.ii_event;
    if (ii_event?.getQualifiedName === undefined || ii_event.getQualifiedName() !== "ZIF_ABAPGIT_GUI_EVENT") { ii_event = undefined; }
    if (ii_event === undefined) { ii_event = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT"}).set(INPUT.ii_event); }
    rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().go_back);
    return rs_handled;
  }
  async zif_abapgit_gui_renderable$render() {
    let ri_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});
    let lv_text = new abap.types.String({qualifiedName: "STRING"});
    await this.register_handlers();
    await this.#run();
    ri_html.set(await (new abap.Classes['ZCL_ABAPGIT_HTML']()).constructor_());
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(14, '<div id="toc">')});
    for await (const unique985 of abap.statements.loop(this.#mt_text)) {
      lv_text.set(unique985);
      await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.operators.concat(abap.CharacterFactory.get(5, '<pre>'),abap.operators.concat(lv_text,abap.CharacterFactory.get(10, '</pre><br>')))});
    }
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(6, '</div>')});
    return ri_html;
  }
}
abap.Classes['ZCL_ABAPGIT_GUI_PAGE_RUN_BCKG'] = zcl_abapgit_gui_page_run_bckg;
export {zcl_abapgit_gui_page_run_bckg};