All files / output zcl_abapgit_popup_code_insp.clas.mjs

33.89% Statements 20/59
100% Branches 2/2
10% Functions 1/10
33.89% Lines 20/59

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 591x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x               1x       1x     1x         1x             1x                         1x         1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_popup_code_insp.clas.abap
class zcl_abapgit_popup_code_insp {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_POPUP_CODE_INSP';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GUI_RENDER_ITEM","ZIF_ABAPGIT_HTML_POPUP"];
  static ATTRIBUTES = {};
  static METHODS = {"FETCH_LIST": {"visibility": "I", "parameters": {"RT_LIST": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "name": new abap.types.Character(30, {"qualifiedName":"SCI_CHKV","ddicName":"SCI_CHKV","description":"SCI_CHKV"}),
  "description": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_CODE_INSPECTOR=>TY_VARIANT-DESCRIPTION"})}, "zif_abapgit_code_inspector=>ty_variant", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_code_inspector=>ty_variants");}, "is_optional": " "}}},
  "CREATE": {"visibility": "U", "parameters": {"RI_POPUP": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_POPUP", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_POPUP"});}, "is_optional": " "}}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "fetch_list": this.#fetch_list.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async create() {
    return zcl_abapgit_popup_code_insp.create();
  }
  static async create() {
    let ri_popup = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_POPUP", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_POPUP"});
    ri_popup.set(await (new abap.Classes['ZCL_ABAPGIT_POPUP_CODE_INSP']()).constructor_());
    return ri_popup;
  }
  async #fetch_list() {
    let rt_list = abap.types.TableFactory.construct(new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"SCI_CHKV","ddicName":"SCI_CHKV","description":"SCI_CHKV"}),
    "description": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_CODE_INSPECTOR=>TY_VARIANT-DESCRIPTION"})}, "zif_abapgit_code_inspector=>ty_variant", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_code_inspector=>ty_variants");
    rt_list.set((await (await abap.Classes['ZCL_ABAPGIT_CODE_INSPECTOR'].get_code_inspector({iv_package: abap.CharacterFactory.get(4, '$TMP')})).get().zif_abapgit_code_inspector$list_global_variants()));
    return rt_list;
  }
  async zif_abapgit_gui_render_item$render(INPUT) {
    let ri_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});
    let iv_item = INPUT?.iv_item;
    let iv_index = INPUT?.iv_index;
    if (iv_index?.getQualifiedName === undefined || iv_index.getQualifiedName() !== "I") { iv_index = undefined; }
    if (iv_index === undefined) { iv_index = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_index); }
    let fs_ls_item_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"SCI_CHKV","ddicName":"SCI_CHKV","description":"SCI_CHKV"}),
    "description": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_CODE_INSPECTOR=>TY_VARIANT-DESCRIPTION"})}, "zif_abapgit_code_inspector=>ty_variant", undefined, {}, {}));
    abap.statements.assign({target: fs_ls_item_, source: iv_item});
    ri_html.set((await abap.Classes['ZCL_ABAPGIT_HTML'].create({iv_initial_chunk: new abap.types.String().set(`<b>${abap.templateFormatting(fs_ls_item_.get().name)}</b> - ${abap.templateFormatting(fs_ls_item_.get().description)}`)})));
    return ri_html;
  }
  async zif_abapgit_html_popup$create_picklist() {
    let ro_picklist = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_GUI_PICKLIST", RTTIName: "\\CLASS=ZCL_ABAPGIT_GUI_PICKLIST"});
    ro_picklist.set(await (new abap.Classes['ZCL_ABAPGIT_GUI_PICKLIST']()).constructor_({iv_title: abap.CharacterFactory.get(14, 'Choose Variant'), it_list: (await this.#fetch_list()), ii_item_renderer: this.me}));
    return ro_picklist;
  }
}
abap.Classes['ZCL_ABAPGIT_POPUP_CODE_INSP'] = zcl_abapgit_popup_code_insp;
export {zcl_abapgit_popup_code_insp};