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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | 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 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_tags.clas.abap class zcl_abapgit_gui_page_tags extends zcl_abapgit_gui_component { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_GUI_PAGE_TAGS'; static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GUI_EVENT_HANDLER","ZIF_ABAPGIT_GUI_RENDERABLE"]; static ATTRIBUTES = {"MO_FORM": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_FORM", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_FORM"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MO_FORM_DATA": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MO_VALIDATION_LOG": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MI_REPO_ONLINE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MO_SETTINGS": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_SETTINGS", RTTIName: "\\CLASS=ZCL_ABAPGIT_SETTINGS"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MS_TAG": {"type": () => {return new abap.types.Structure({ "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "object": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-NAME"}), "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}), "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-DISPLAY_NAME"}), "tagger_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-TAGGER_NAME"}), "tagger_email": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-TAGGER_EMAIL"}), "message": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-MESSAGE"}), "body": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-BODY"})}, "zif_abapgit_git_definitions=>ty_git_tag", undefined, {}, {});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "C_ID": {"type": () => {return new abap.types.Structure({ "tag_group": new abap.types.String({qualifiedName: "STRING"}), "tag_type": new abap.types.String({qualifiedName: "STRING"}), "tags": new abap.types.String({qualifiedName: "STRING"}), "type": new abap.types.String({qualifiedName: "STRING"}), "name": new abap.types.String({qualifiedName: "STRING"}), "sha1": new abap.types.String({qualifiedName: "STRING"}), "anno_group": new abap.types.String({qualifiedName: "STRING"}), "tagger": new abap.types.String({qualifiedName: "STRING"}), "tagger_name": new abap.types.String({qualifiedName: "STRING"}), "tagger_email": new abap.types.String({qualifiedName: "STRING"}), "message": new abap.types.String({qualifiedName: "STRING"}), "body": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});}, "visibility": "I", "is_constant": "X", "is_class": "X"}, "C_EVENT": {"type": () => {return new abap.types.Structure({ "create": new abap.types.String({qualifiedName: "STRING"}), "choose_commit": new abap.types.String({qualifiedName: "STRING"}), "change_type": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});}, "visibility": "I", "is_constant": "X", "is_class": "X"}}; static METHODS = {"GET_FORM_SCHEMA": {"visibility": "I", "parameters": {"RO_FORM": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_FORM", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_FORM"});}, "is_optional": " "}, "IO_FORM_DATA": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}}}, "INITIALIZE_FORM_DATA": {"visibility": "I", "parameters": {}}, "GET_TAGGER_NAME": {"visibility": "I", "parameters": {"RV_USER": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "GET_TAGGER_EMAIL": {"visibility": "I", "parameters": {"RV_EMAIL": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "VALIDATE_FORM": {"visibility": "I", "parameters": {"RO_VALIDATION_LOG": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}, "IO_FORM_DATA": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}}}, "CHOOSE_COMMIT": {"visibility": "I", "parameters": {"RV_COMMIT": {"type": () => {return new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"});}, "is_optional": " "}}}, "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": " "}, "II_REPO": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO"});}, "is_optional": " "}}}, "CONSTRUCTOR": {"visibility": "U", "parameters": {"II_REPO": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO"});}, "is_optional": " "}}}}; #mo_form; #mo_form_data; #mo_validation_log; #mi_repo_online; #mo_settings; #ms_tag; 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, "get_form_schema": this.#get_form_schema.bind(this), "initialize_form_data": this.#initialize_form_data.bind(this), "get_tagger_name": this.#get_tagger_name.bind(this), "get_tagger_email": this.#get_tagger_email.bind(this), "validate_form": this.#validate_form.bind(this), "choose_commit": this.#choose_commit.bind(this), }; this.#mo_form = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_FORM", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_FORM"}); this.FRIENDS_ACCESS_INSTANCE["mo_form"] = this.#mo_form; this.#mo_form_data = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}); this.FRIENDS_ACCESS_INSTANCE["mo_form_data"] = this.#mo_form_data; this.#mo_validation_log = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}); this.FRIENDS_ACCESS_INSTANCE["mo_validation_log"] = this.#mo_validation_log; this.#mi_repo_online = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"}); this.FRIENDS_ACCESS_INSTANCE["mi_repo_online"] = this.#mi_repo_online; this.#mo_settings = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_SETTINGS", RTTIName: "\\CLASS=ZCL_ABAPGIT_SETTINGS"}); this.FRIENDS_ACCESS_INSTANCE["mo_settings"] = this.#mo_settings; this.#ms_tag = new abap.types.Structure({ "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "object": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-NAME"}), "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}), "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-DISPLAY_NAME"}), "tagger_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-TAGGER_NAME"}), "tagger_email": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-TAGGER_EMAIL"}), "message": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-MESSAGE"}), "body": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_TAG-BODY"})}, "zif_abapgit_git_definitions=>ty_git_tag", undefined, {}, {}); this.FRIENDS_ACCESS_INSTANCE["ms_tag"] = this.#ms_tag; this.c_id = zcl_abapgit_gui_page_tags.c_id; this.c_event = zcl_abapgit_gui_page_tags.c_event; } async #choose_commit() { let rv_commit = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}); let li_popups = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_POPUPS", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_POPUPS"}); li_popups.set((await abap.Classes['ZCL_ABAPGIT_UI_FACTORY'].get_popups())); rv_commit.set(((await li_popups.get().zif_abapgit_popups$commit_list_popup({iv_repo_url: (await this.#mi_repo_online.get().zif_abapgit_repo_online$get_url()), iv_branch_name: (await this.#mi_repo_online.get().zif_abapgit_repo_online$get_selected_branch())}))).get().sha1); return rv_commit; } async constructor_(INPUT) { let ii_repo = INPUT?.ii_repo; if (ii_repo?.getQualifiedName === undefined || ii_repo.getQualifiedName() !== "ZIF_ABAPGIT_REPO") { ii_repo = undefined; } if (ii_repo === undefined) { ii_repo = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO"}).set(INPUT.ii_repo); } await super.constructor_(); this.#mo_form_data.set(await (new abap.Classes['ZCL_ABAPGIT_STRING_MAP']()).constructor_()); this.#mo_validation_log.set(await (new abap.Classes['ZCL_ABAPGIT_STRING_MAP']()).constructor_()); await abap.statements.cast(this.#mi_repo_online, ii_repo); this.#mo_settings.set((await (await abap.Classes['ZCL_ABAPGIT_PERSIST_FACTORY'].get_settings()).get().zif_abapgit_persist_settings$read())); this.#mo_form.set((await this.#get_form_schema())); await this.#initialize_form_data(); return this; } async create(INPUT) { return zcl_abapgit_gui_page_tags.create(INPUT); } static async create(INPUT) { let ri_page = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}); let ii_repo = INPUT?.ii_repo; if (ii_repo?.getQualifiedName === undefined || ii_repo.getQualifiedName() !== "ZIF_ABAPGIT_REPO") { ii_repo = undefined; } if (ii_repo === undefined) { ii_repo = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO"}).set(INPUT.ii_repo); } let lo_component = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_TAGS", RTTIName: "\\CLASS=ZCL_ABAPGIT_GUI_PAGE_TAGS"}); lo_component.set(await (new abap.Classes['ZCL_ABAPGIT_GUI_PAGE_TAGS']()).constructor_({ii_repo: ii_repo})); ri_page.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_HOC'].create({iv_page_title: abap.CharacterFactory.get(10, 'Create Tag'), ii_child_component: lo_component}))); return ri_page; } async #get_form_schema(INPUT) { let ro_form = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_FORM", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_FORM"}); let io_form_data = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}); if (INPUT && INPUT.io_form_data) {io_form_data.set(INPUT.io_form_data);} let lc_commitmsg_comment_min_len = new abap.types.Integer({qualifiedName: "I"}); lc_commitmsg_comment_min_len.set(1); let lc_commitmsg_comment_max_len = new abap.types.Integer({qualifiedName: "I"}); lc_commitmsg_comment_max_len.set(255); if (abap.compare.initial(io_form_data) === false && abap.compare.eq((await io_form_data.get().is_empty()), abap.builtin.abap_false)) { this.#ms_tag.get().type.set((await io_form_data.get().get({iv_key: zcl_abapgit_gui_page_tags.c_id.get().tag_type}))); } ro_form.set((await abap.Classes['ZCL_ABAPGIT_HTML_FORM'].create({iv_form_id: abap.CharacterFactory.get(15, 'create-tag-form'), iv_help_page: abap.CharacterFactory.get(25, 'https://docs.abapgit.org/')}))); await (await (await (await (await (await ro_form.get().start_group({iv_name: zcl_abapgit_gui_page_tags.c_id.get().tag_group, iv_label: abap.CharacterFactory.get(7, 'New Tag')})).get().radio({iv_label: abap.CharacterFactory.get(4, 'Type'), iv_name: zcl_abapgit_gui_page_tags.c_id.get().tag_type, iv_action: zcl_abapgit_gui_page_tags.c_event.get().change_type})).get().option({iv_label: abap.CharacterFactory.get(11, 'Lightweight'), iv_value: abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch_type.get().lightweight_tag})).get().option({iv_label: abap.CharacterFactory.get(9, 'Annotated'), iv_value: abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch_type.get().annotated_tag})).get().text({iv_name: zcl_abapgit_gui_page_tags.c_id.get().name, iv_label: abap.CharacterFactory.get(8, 'Tag Name'), iv_required: abap.builtin.abap_true})).get().text({iv_name: zcl_abapgit_gui_page_tags.c_id.get().sha1, iv_label: abap.CharacterFactory.get(6, 'Commit'), iv_min: abap.IntegerFactory.get(40), iv_max: abap.IntegerFactory.get(40), iv_condense: abap.builtin.abap_true, iv_required: abap.builtin.abap_true, iv_side_action: zcl_abapgit_gui_page_tags.c_event.get().choose_commit}); if (abap.compare.eq(this.#ms_tag.get().type, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch_type.get().annotated_tag)) { await (await (await (await (await ro_form.get().start_group({iv_name: zcl_abapgit_gui_page_tags.c_id.get().anno_group, iv_label: abap.CharacterFactory.get(10, 'Annotation')})).get().text({iv_name: zcl_abapgit_gui_page_tags.c_id.get().message, iv_label: abap.CharacterFactory.get(7, 'Comment'), iv_min: lc_commitmsg_comment_min_len, iv_max: lc_commitmsg_comment_max_len, iv_placeholder: new abap.types.String().set(`Add a mandatory comment with max ${abap.templateFormatting(lc_commitmsg_comment_max_len)} characters`)})).get().textarea({iv_name: zcl_abapgit_gui_page_tags.c_id.get().body, iv_label: abap.CharacterFactory.get(4, 'Body'), iv_rows: abap.IntegerFactory.get(6), iv_cols: (await this.#mo_settings.get().get_commitmsg_body_size()), iv_placeholder: abap.CharacterFactory.get(30, 'Add an optional description...')})).get().text({iv_name: zcl_abapgit_gui_page_tags.c_id.get().tagger_name, iv_label: abap.CharacterFactory.get(11, 'Tagger Name')})).get().text({iv_name: zcl_abapgit_gui_page_tags.c_id.get().tagger_email, iv_label: abap.CharacterFactory.get(12, 'Tagger Email')}); } else { await (await (await (await ro_form.get().hidden({iv_name: zcl_abapgit_gui_page_tags.c_id.get().message})).get().hidden({iv_name: zcl_abapgit_gui_page_tags.c_id.get().body})).get().hidden({iv_name: zcl_abapgit_gui_page_tags.c_id.get().tagger_name})).get().hidden({iv_name: zcl_abapgit_gui_page_tags.c_id.get().tagger_email}); } await (await ro_form.get().command({iv_label: abap.CharacterFactory.get(6, 'Create'), iv_cmd_type: abap.Classes['ZIF_ABAPGIT_HTML_FORM'].zif_abapgit_html_form$c_cmd_type.get().input_main, iv_action: zcl_abapgit_gui_page_tags.c_event.get().create})).get().command({iv_label: abap.CharacterFactory.get(4, 'Back'), iv_action: abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_action.get().go_back}); return ro_form; } async #get_tagger_email() { let rv_email = new abap.types.String({qualifiedName: "STRING"}); let li_user = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_PERSIST_USER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_PERSIST_USER"}); li_user.set((await abap.Classes['ZCL_ABAPGIT_PERSIST_FACTORY'].get_user())); rv_email.set((await li_user.get().zif_abapgit_persist_user$get_repo_git_user_email({iv_url: (await this.#mi_repo_online.get().zif_abapgit_repo_online$get_url())}))); if (abap.compare.initial(rv_email)) { rv_email.set((await li_user.get().zif_abapgit_persist_user$get_default_git_user_email())); } if (abap.compare.initial(rv_email)) { rv_email.set((await (await abap.Classes['ZCL_ABAPGIT_ENV_FACTORY'].get_user_record()).get().zif_abapgit_user_record$get_email({iv_username: abap.builtin.sy.get().uname}))); } return rv_email; } async #get_tagger_name() { let rv_user = new abap.types.String({qualifiedName: "STRING"}); let li_user = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_PERSIST_USER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_PERSIST_USER"}); li_user.set((await abap.Classes['ZCL_ABAPGIT_PERSIST_FACTORY'].get_user())); rv_user.set((await li_user.get().zif_abapgit_persist_user$get_repo_git_user_name({iv_url: (await this.#mi_repo_online.get().zif_abapgit_repo_online$get_url())}))); if (abap.compare.initial(rv_user)) { rv_user.set((await li_user.get().zif_abapgit_persist_user$get_default_git_user_name())); } if (abap.compare.initial(rv_user)) { rv_user.set((await (await abap.Classes['ZCL_ABAPGIT_ENV_FACTORY'].get_user_record()).get().zif_abapgit_user_record$get_name({iv_username: abap.builtin.sy.get().uname}))); } return rv_user; } async #initialize_form_data() { this.#ms_tag.get().type.set(abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch_type.get().lightweight_tag); await this.#mo_form_data.get().set({iv_key: zcl_abapgit_gui_page_tags.c_id.get().tag_type, iv_val: this.#ms_tag.get().type}); this.#ms_tag.get().tagger_name.set((await this.#get_tagger_name())); this.#ms_tag.get().tagger_email.set((await this.#get_tagger_email())); await this.#mo_form_data.get().set({iv_key: zcl_abapgit_gui_page_tags.c_id.get().tagger_name, iv_val: this.#ms_tag.get().tagger_name}); await this.#mo_form_data.get().set({iv_key: zcl_abapgit_gui_page_tags.c_id.get().tagger_email, iv_val: this.#ms_tag.get().tagger_email}); } async #validate_form(INPUT) { let ro_validation_log = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}); let io_form_data = INPUT?.io_form_data; if (io_form_data?.getQualifiedName === undefined || io_form_data.getQualifiedName() !== "ZCL_ABAPGIT_STRING_MAP") { io_form_data = undefined; } if (io_form_data === undefined) { io_form_data = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"}).set(INPUT.io_form_data); } let lt_tags = abap.types.TableFactory.construct(new abap.types.Structure({ "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}), "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}), "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}), "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"name_key","type":"SORTED","isUnique":false,"keyFields":["NAME"]}]}, "zif_abapgit_git_definitions=>ty_git_branch_list_tt"); let lv_new_tag_name = new abap.types.String({qualifiedName: "STRING"}); ro_validation_log.set((await (await abap.Classes['ZCL_ABAPGIT_HTML_FORM_UTILS'].create({io_form: this.#mo_form})).get().validate({io_form_data: io_form_data}))); if (abap.compare.eq((await abap.Classes['ZCL_ABAPGIT_UTILS'].is_valid_email({iv_email: (await io_form_data.get().get({iv_key: zcl_abapgit_gui_page_tags.c_id.get().tagger_email}))})), abap.builtin.abap_false)) { await ro_validation_log.get().set({iv_key: zcl_abapgit_gui_page_tags.c_id.get().tagger_email, iv_val: new abap.types.String().set(`Invalid email address`)}); } lv_new_tag_name.set((await io_form_data.get().get({iv_key: zcl_abapgit_gui_page_tags.c_id.get().name}))); if (abap.compare.initial(lv_new_tag_name) === false) { lt_tags.set((await (await (await abap.Classes['ZCL_ABAPGIT_GIT_FACTORY'].get_git_transport()).get().zif_abapgit_git_transport$branches({iv_url: (await this.#mi_repo_online.get().zif_abapgit_repo_online$get_url())})).get().zif_abapgit_git_branch_list$get_tags_only())); const unique1005 = (await abap.Classes['ZCL_ABAPGIT_GIT_TAG'].add_tag_prefix({iv_text: lv_new_tag_name})); abap.statements.readTable(lt_tags,{keyName: "name_key", withTableKey: true, withKey: (i) => {return abap.compare.eq(i.name, unique1005);}, withKeyValue: [{key: (i) => {return i.name}, value: unique1005}], usesTableLine: false, withKeySimple: {"name": unique1005}}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await ro_validation_log.get().set({iv_key: zcl_abapgit_gui_page_tags.c_id.get().name, iv_val: new abap.types.String().set(`Tag already exists`)}); } } return ro_validation_log; } 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 lx_error = new abap.types.ABAPObject({qualifiedName: "ZCX_ABAPGIT_EXCEPTION", RTTIName: "\\CLASS=ZCX_ABAPGIT_EXCEPTION"}); let lv_commit = new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}); let lv_text = new abap.types.String({qualifiedName: "STRING"}); await this.#mo_form_data.get().merge({io_string_map: (await (await abap.Classes['ZCL_ABAPGIT_HTML_FORM_UTILS'].create({io_form: this.#mo_form})).get().normalize({io_form_data: (await ii_event.get().zif_abapgit_gui_event$form_data())}))}); let unique1006 = ii_event.get().zif_abapgit_gui_event$mv_action; if (abap.compare.eq(unique1006, zcl_abapgit_gui_page_tags.c_event.get().choose_commit)) { lv_commit.set((await this.#choose_commit())); if (abap.compare.initial(lv_commit)) { rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().no_more_act); } else { await this.#mo_form_data.get().set({iv_key: zcl_abapgit_gui_page_tags.c_id.get().sha1, iv_val: lv_commit}); rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().re_render); } } else if (abap.compare.eq(unique1006, zcl_abapgit_gui_page_tags.c_event.get().change_type)) { rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().re_render); await this.#mo_validation_log.get().clear(); } else if (abap.compare.eq(unique1006, zcl_abapgit_gui_page_tags.c_event.get().create)) { this.#mo_validation_log.set((await this.#validate_form({io_form_data: this.#mo_form_data}))); if (abap.compare.eq((await this.#mo_validation_log.get().is_empty()), abap.builtin.abap_true)) { await this.#mo_form_data.get().strict({iv_strict: abap.builtin.abap_false}); await this.#mo_form_data.get().to_abap({cs_container: this.#ms_tag}); abap.statements.replace({target: this.#ms_tag.get().body, all: true, with: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline, of: abap.Classes['CL_ABAP_CHAR_UTILITIES'].cr_lf}); this.#ms_tag.get().name.set((await abap.Classes['ZCL_ABAPGIT_GIT_TAG'].add_tag_prefix({iv_text: this.#ms_tag.get().name}))); abap.statements.assert(abap.compare.cp(this.#ms_tag.get().name, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch.get().tags)); try { await abap.Classes['ZCL_ABAPGIT_GIT_PORCELAIN'].create_tag({iv_url: (await this.#mi_repo_online.get().zif_abapgit_repo_online$get_url()), is_tag: this.#ms_tag}); } catch (e) { if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) { lx_error.set(e); await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Cannot create tag ${abap.templateFormatting(this.#ms_tag.get().name)}: ${abap.templateFormatting((await lx_error.get().if_message$get_text()))}`)}); } else { throw e; } } lv_text.set(new abap.types.String().set(`Tag ${abap.templateFormatting((await abap.Classes['ZCL_ABAPGIT_GIT_TAG'].remove_tag_prefix({iv_text: this.#ms_tag.get().name})))} created`)); await abap.statements.message({exception: lv_text, type: abap.CharacterFactory.get(1, 'S')}); rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().go_back); } else { rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().re_render); } } if (abap.compare.eq(rs_handled.get().state, abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().re_render)) { this.#mo_form.set((await this.#get_form_schema({io_form_data: this.#mo_form_data}))); } 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"}); await this.register_handlers(); ri_html.set(await (new abap.Classes['ZCL_ABAPGIT_HTML']()).constructor_()); await ri_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<div class="repo">`)}); await ri_html.get().zif_abapgit_html$add({ig_chunk: (await abap.Classes['ZCL_ABAPGIT_GUI_CHUNK_LIB'].render_repo_top({ii_repo: this.#mi_repo_online, iv_show_commit: abap.builtin.abap_false, iv_interactive_branch: abap.builtin.abap_false}))}); await ri_html.get().zif_abapgit_html$add({ig_chunk: (await this.#mo_form.get().render({io_values: this.#mo_form_data, io_validation_log: this.#mo_validation_log}))}); await ri_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`</div>`)}); return ri_html; } } abap.Classes['ZCL_ABAPGIT_GUI_PAGE_TAGS'] = zcl_abapgit_gui_page_tags; zcl_abapgit_gui_page_tags.c_id = new abap.types.Structure({ "tag_group": new abap.types.String({qualifiedName: "STRING"}), "tag_type": new abap.types.String({qualifiedName: "STRING"}), "tags": new abap.types.String({qualifiedName: "STRING"}), "type": new abap.types.String({qualifiedName: "STRING"}), "name": new abap.types.String({qualifiedName: "STRING"}), "sha1": new abap.types.String({qualifiedName: "STRING"}), "anno_group": new abap.types.String({qualifiedName: "STRING"}), "tagger": new abap.types.String({qualifiedName: "STRING"}), "tagger_name": new abap.types.String({qualifiedName: "STRING"}), "tagger_email": new abap.types.String({qualifiedName: "STRING"}), "message": new abap.types.String({qualifiedName: "STRING"}), "body": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {}); zcl_abapgit_gui_page_tags.c_id.get().tag_group.set('tag_group'); zcl_abapgit_gui_page_tags.c_id.get().tag_type.set('tag_type'); zcl_abapgit_gui_page_tags.c_id.get().tags.set('tags'); zcl_abapgit_gui_page_tags.c_id.get().type.set('type'); zcl_abapgit_gui_page_tags.c_id.get().name.set('name'); zcl_abapgit_gui_page_tags.c_id.get().sha1.set('sha1'); zcl_abapgit_gui_page_tags.c_id.get().anno_group.set('anno_group'); zcl_abapgit_gui_page_tags.c_id.get().tagger.set('tagger'); zcl_abapgit_gui_page_tags.c_id.get().tagger_name.set('tagger_name'); zcl_abapgit_gui_page_tags.c_id.get().tagger_email.set('tagger_email'); zcl_abapgit_gui_page_tags.c_id.get().message.set('message'); zcl_abapgit_gui_page_tags.c_id.get().body.set('body'); zcl_abapgit_gui_page_tags.c_event = new abap.types.Structure({ "create": new abap.types.String({qualifiedName: "STRING"}), "choose_commit": new abap.types.String({qualifiedName: "STRING"}), "change_type": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {}); zcl_abapgit_gui_page_tags.c_event.get().create.set('create'); zcl_abapgit_gui_page_tags.c_event.get().choose_commit.set('choose_commit'); zcl_abapgit_gui_page_tags.c_event.get().change_type.set('change_type'); export {zcl_abapgit_gui_page_tags}; |