All files / output zcl_abapgit_gui_page_template.clas.mjs

24.21% Statements 31/128
100% Branches 2/2
6.66% Functions 1/15
24.21% Lines 31/128

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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 1281x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x                     1x       1x     1x             1x                             1x                                   1x         1x         1x             1x                             1x                                   1x 1x 1x 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_template.clas.abap
class zcl_abapgit_gui_page_template extends zcl_abapgit_gui_component {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_GUI_PAGE_TEMPLATE';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GUI_PAGE_TITLE","ZIF_ABAPGIT_GUI_EVENT_HANDLER","ZIF_ABAPGIT_GUI_HOTKEYS","ZIF_ABAPGIT_GUI_MENU_PROVIDER","ZIF_ABAPGIT_GUI_RENDERABLE","ZIF_ABAPGIT_HTML_TABLE"];
  static ATTRIBUTES = {"C_ACTION": {"type": () => {return new abap.types.Structure({
  "refresh": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});}, "visibility": "I", "is_constant": "X", "is_class": "X"},
  "C_TITLE": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": "X", "is_class": "X"}};
  static METHODS = {"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": {}}};
  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,
    };
    this.c_action = zcl_abapgit_gui_page_template.c_action;
    this.c_title = zcl_abapgit_gui_page_template.c_title;
  }
  async constructor_(INPUT) {
    await super.constructor_();
    return this;
  }
  async create() {
    return zcl_abapgit_gui_page_template.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_TEMPLATE", RTTIName: "\\CLASS=ZCL_ABAPGIT_GUI_PAGE_TEMPLATE"});
    lo_component.set(await (new abap.Classes['ZCL_ABAPGIT_GUI_PAGE_TEMPLATE']()).constructor_());
    ri_page.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_HOC'].create({ii_child_component: lo_component})));
    return ri_page;
  }
  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); }
    let unique664 = ii_event.get().zif_abapgit_gui_event$mv_action;
    if (abap.compare.eq(unique664, zcl_abapgit_gui_page_template.c_action.get().refresh)) {
      rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().re_render);
    } else if (abap.compare.eq(unique664, abap.CharacterFactory.get(3, 'xyz'))) {
      abap.statements.assert(abap.compare.eq(abap.IntegerFactory.get(1), abap.IntegerFactory.get(1)));
    }
    return rs_handled;
  }
  async zif_abapgit_gui_hotkeys$get_hotkey_actions() {
    let rt_hotkey_actions = abap.types.TableFactory.construct(new abap.types.Structure({
    "ui_component": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEYS=>TY_HOTKEY_WITH_DESCR-UI_COMPONENT"}),
    "action": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEYS=>TY_HOTKEY_WITH_DESCR-ACTION"}),
    "hotkey": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEYS=>TY_HOTKEY_WITH_DESCR-HOTKEY"}),
    "description": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEYS=>TY_HOTKEY_WITH_DESCR-DESCRIPTION"})}, "zif_abapgit_gui_hotkeys=>ty_hotkey_with_descr", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"action","type":"SORTED","isUnique":true,"keyFields":["UI_COMPONENT","ACTION"]}]}, "zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr");
    let ls_hotkey_action = new abap.types.Structure({
    "ui_component": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEYS=>TY_HOTKEY_WITH_DESCR-UI_COMPONENT"}),
    "action": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEYS=>TY_HOTKEY_WITH_DESCR-ACTION"}),
    "hotkey": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEYS=>TY_HOTKEY_WITH_DESCR-HOTKEY"}),
    "description": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEYS=>TY_HOTKEY_WITH_DESCR-DESCRIPTION"})}, "zif_abapgit_gui_hotkeys=>ty_hotkey_with_descr", undefined, {}, {});
    ls_hotkey_action.get().ui_component.set(zcl_abapgit_gui_page_template.c_title);
    ls_hotkey_action.get().description.set(abap.CharacterFactory.get(7, 'Refresh'));
    ls_hotkey_action.get().action.set(zcl_abapgit_gui_page_template.c_action.get().refresh);
    ls_hotkey_action.get().hotkey.set(abap.CharacterFactory.get(1, 'r'));
    abap.statements.insertInternal({data: ls_hotkey_action, table: rt_hotkey_actions});
    return rt_hotkey_actions;
  }
  async zif_abapgit_gui_menu_provider$get_menu() {
    let ro_toolbar = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TOOLBAR", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TOOLBAR"});
    ro_toolbar.set((await (await abap.Classes['ZCL_ABAPGIT_HTML_TOOLBAR'].create({iv_id: abap.CharacterFactory.get(19, 'toolbar-template-id')})).get().add({iv_txt: abap.CharacterFactory.get(7, 'Refresh'), iv_act: zcl_abapgit_gui_page_template.c_action.get().refresh})));
    return ro_toolbar;
  }
  async zif_abapgit_gui_page_title$get_page_title() {
    let rv_title = new abap.types.String({qualifiedName: "STRING"});
    rv_title.set(zcl_abapgit_gui_page_template.c_title);
    return rv_title;
  }
  async zif_abapgit_gui_renderable$render() {
    let ri_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});
    await this.register_handlers();
    ri_html.set((await abap.Classes['ZCL_ABAPGIT_HTML'].create()));
    await ri_html.get().zif_abapgit_html$div({iv_class: abap.CharacterFactory.get(8, 'template'), iv_content: abap.CharacterFactory.get(6, 'Hello!')});
    return ri_html;
  }
  async zif_abapgit_html_table$get_row_attrs(INPUT) {
    let rs_attrs = new abap.types.Structure({
    "css_class": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_ROW_ATTRS-CSS_CLASS"}),
    "data": new abap.types.Structure({
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-NAME"}),
    "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-VALUE"})}, "zif_abapgit_html=>ty_data_attr", undefined, {}, {})}, "zif_abapgit_html_table=>ty_row_attrs", undefined, {}, {});
    let iv_table_id = INPUT?.iv_table_id;
    if (iv_table_id?.getQualifiedName === undefined || iv_table_id.getQualifiedName() !== "STRING") { iv_table_id = undefined; }
    if (iv_table_id === undefined) { iv_table_id = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_table_id); }
    let iv_row_index = INPUT?.iv_row_index;
    if (iv_row_index?.getQualifiedName === undefined || iv_row_index.getQualifiedName() !== "I") { iv_row_index = undefined; }
    if (iv_row_index === undefined) { iv_row_index = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_row_index); }
    let is_row = INPUT?.is_row;
    return rs_attrs;
  }
  async zif_abapgit_html_table$render_cell(INPUT) {
    let rs_render = new abap.types.Structure({
    "css_class": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_CELL_RENDER-CSS_CLASS"}),
    "content": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_CELL_RENDER-CONTENT"}),
    "html": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"})}, "zif_abapgit_html_table=>ty_cell_render", undefined, {}, {});
    let iv_table_id = INPUT?.iv_table_id;
    if (iv_table_id?.getQualifiedName === undefined || iv_table_id.getQualifiedName() !== "STRING") { iv_table_id = undefined; }
    if (iv_table_id === undefined) { iv_table_id = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_table_id); }
    let iv_row_index = INPUT?.iv_row_index;
    if (iv_row_index?.getQualifiedName === undefined || iv_row_index.getQualifiedName() !== "I") { iv_row_index = undefined; }
    if (iv_row_index === undefined) { iv_row_index = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_row_index); }
    let is_row = INPUT?.is_row;
    let iv_column_id = INPUT?.iv_column_id;
    if (iv_column_id?.getQualifiedName === undefined || iv_column_id.getQualifiedName() !== "STRING") { iv_column_id = undefined; }
    if (iv_column_id === undefined) { iv_column_id = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_column_id); }
    let iv_value = INPUT?.iv_value;
    return rs_render;
  }
}
abap.Classes['ZCL_ABAPGIT_GUI_PAGE_TEMPLATE'] = zcl_abapgit_gui_page_template;
zcl_abapgit_gui_page_template.c_action = new abap.types.Structure({
"refresh": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});
zcl_abapgit_gui_page_template.c_action.get().refresh.set('refresh');
zcl_abapgit_gui_page_template.c_title = new abap.types.String({qualifiedName: "STRING"});
zcl_abapgit_gui_page_template.c_title.set('Page Template');
export {zcl_abapgit_gui_page_template};