diff --git a/Scenes/bugbot_player.gd b/Scenes/bugbot_player.gd index 6c7b215..284649d 100644 --- a/Scenes/bugbot_player.gd +++ b/Scenes/bugbot_player.gd @@ -299,6 +299,7 @@ func __place_marker(_position:Vector3, _normal:Vector3): if __raycast_collision: var collider : Area3D = __raycast_collision["collider"] as Area3D if collider and collider.is_in_group("BugMarkerInfo"): + print("Pop up bug marker info here.") return var marker : BugMarker = (load(bug_marker) as PackedScene).instantiate() as BugMarker @@ -307,7 +308,12 @@ func __place_marker(_position:Vector3, _normal:Vector3): marker.set_rotation_to_normal(_normal) marker.marker_status = BugMarker.BugStatus.UNRESOLVED - __bugbot_server._send_form_data(func(data:Array):print(data)) + __bugbot_server._prepare_form(__bug_report_form_data_prepared) + +func __bug_report_form_data_prepared(tag_lists:Array): + var bug_report_form : Control = preload("res://addons/Bugbot/UI/bug_report_form.tscn").instantiate() + add_child(bug_report_form) + bug_report_form.fill_tags(tag_lists) func __place_dummy_marker(): diff --git a/Scripts/server_api.gd b/Scripts/server_api.gd index 74fe1f3..da36b15 100644 --- a/Scripts/server_api.gd +++ b/Scripts/server_api.gd @@ -1,7 +1,7 @@ class_name BugbotServerAPI extends Resource -enum BugbotServerError { OK, THREAD_NULL, THREAD_BUSY } +enum BugbotServerError { OK, THREAD_NULL, THREAD_BUSY, API_RESPONSE_ERROR } var __bugbot_server_thread : Thread @@ -41,8 +41,11 @@ func __connect_to_server(http_client:HTTPClient, default_server:String) -> int: var server_and_port : PackedStringArray = full_server.rsplit(":",true,1) var server : String = server_and_port[0] var port : int = int(server_and_port[1]) - var error : int = http_client.connect_to_host(server if port > 0 else full_server, port if port > 0 else -1) - return error + http_client.connect_to_host(server if port > 0 else full_server, port if port > 0 else -1) + + while http_client.get_status() == HTTPClient.STATUS_CONNECTING or http_client.get_status() == HTTPClient.STATUS_RESOLVING: + http_client.poll() + return http_client.get_status() func __get_http_client_chunk_response(http_client:HTTPClient) -> String: if http_client.has_response(): @@ -66,6 +69,9 @@ func __start_thread_with_callback(thread_function:Callable) -> int: __bugbot_server_thread.start(thread_function) return BugbotServerError.OK +func __validate_server_response(_response:Variant) -> int: + return Error.OK + func _current_server_api() -> String: return "" @@ -73,7 +79,7 @@ func _current_server_api() -> String: func __build_url_string(_api_suffix:String) -> String: return "" -func __create_header_data(mime_type:String, api_key:String, content_length:int = -1) -> Array: +func __create_header_data(content_length:int = -1) -> Array: return [] diff --git a/Scripts/server_gitea_api.gd b/Scripts/server_gitea_api.gd index 6974bea..72c03fe 100644 --- a/Scripts/server_gitea_api.gd +++ b/Scripts/server_gitea_api.gd @@ -9,6 +9,11 @@ const DEFAULT_REPO_NAME : StringName = &"ProjectName" const DEFAULT_API_KEY : StringName = &"0123456789abcdef0123456789abcdef01234567" const DEFAULT_BUG_LABEL : StringName = &"Kind/Bug" const DEFAULT_STATUS_LABEL : StringName = &"Status/Need More Info" +const DEFAULT_VERSION_LABEL_PREFIX : StringName = &"Version/" +const DEFAULT_HARDWARE_LABEL_PREFIX : StringName = &"Hardware/" +const DEFAULT_OS_LABEL_PREFIX : StringName = &"OS/" +const DEFAULT_COMPONENT_LABEL_PREFIX : StringName = &"Component/" +const DEFAULT_PRIORITY_LABEL_PREFIX : StringName = &"Priority/" const UNRESOLVED_TAG : StringName = &"Status/Unresolved" const IN_PROGRESS_TAG : StringName = &"Status/In Progress" @@ -20,8 +25,7 @@ func _return_list_of_bugs(callback:Callable) -> int: return __start_thread_with_callback(__return_list_of_bugs_thread.bind(callback)) func _prepare_form(callback:Callable) -> int: - print(_current_server_api(), " has not yet implemented this functionality.") - return BugbotServerError.OK + return __start_thread_with_callback(__prepare_form_thread.bind(callback)) func _send_form_data(callback:Callable) -> int: return __start_thread_with_callback(__send_form_data_thread.bind(callback)) @@ -29,136 +33,161 @@ func _send_form_data(callback:Callable) -> int: func __return_list_of_bugs_thread(callback:Callable) -> void: var http_client : HTTPClient = HTTPClient.new() - var error : int = __connect_to_server(http_client, DEFAULT_SERVER) - assert(error == Error.OK) - - while http_client.get_status() == HTTPClient.STATUS_CONNECTING or http_client.get_status() == HTTPClient.STATUS_RESOLVING: - http_client.poll() - assert(http_client.get_status() == HTTPClient.STATUS_CONNECTED) + if __connect_to_server(http_client, DEFAULT_SERVER) != HTTPClient.STATUS_CONNECTED: + printerr("Could not connect to server.") + return var api_url : String = __build_url_string("issues") api_url += "?state=all&labels=" + ProjectSettings.get_setting("bugbot/reporting/gitea/bug_label", DEFAULT_BUG_LABEL).uri_encode() - var header_data : Array = __create_header_data("application/json", ProjectSettings.get_setting("bugbot/reporting/gitea/API_key", DEFAULT_API_KEY)) - error = http_client.request(HTTPClient.METHOD_GET, api_url, header_data) + var header_data : Array = __create_header_data() + var error : int = http_client.request(HTTPClient.METHOD_GET, api_url, header_data) assert(error == Error.OK) while http_client.get_status() == HTTPClient.STATUS_REQUESTING: http_client.poll() assert(http_client.get_status() == HTTPClient.STATUS_BODY or http_client.get_status() == HTTPClient.STATUS_CONNECTED) var response_string : String = __get_http_client_chunk_response(http_client) - var response_array : Array var response_data := JSON.parse_string(response_string) + if __validate_server_response(response_data) != Error.OK: + return - # If the response is an array, we can make the assumption that this is - # a list of returned bugs. - if response_data is Array: - var resolved_labels : Array = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/resolved_statuses") - var in_progress_labels : Array = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/in_progress_statuses") - var unresolved_labels : Array = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/unresolved_statuses") - - var show_resolved : bool = ProjectSettings.get_setting("bugbot/markers/resolved/show_resolved_bugs") - var show_in_progress : bool = ProjectSettings.get_setting("bugbot/markers/in_progress/show_in_progress_bugs") - var show_unresolved : bool = ProjectSettings.get_setting("bugbot/markers/unresolved/show_unresolved_bugs") - - for bug_in:Dictionary in response_data: - var bug : BugbotBugData = BugbotBugData.new() - - var bug_labels : Array = [] - var resolved_tag_found : bool = false - var in_progress_tag_found : bool = false - var unresolved_tag_found : bool = false - - # Find which resolution statuses apply to this bug. - bug.is_open = (bug_in["state"] == "open") - if not bug.is_open: - resolved_tag_found = true - else: - for labels:Dictionary in bug_in["labels"]: - bug_labels.append(labels["name"] as String) - for label:String in resolved_labels: - if bug_labels.has(label): resolved_tag_found = true - for label:String in in_progress_labels: - if bug_labels.has(label): in_progress_tag_found = true - for label:String in unresolved_labels: - if bug_labels.has(label): unresolved_tag_found = true - - # Figure out which resolution tag to prioritise, and whether we should show the marker. - var show_marker : bool - if resolved_tag_found: - bug.resolution = RESOLVED_TAG - show_marker = show_resolved - elif in_progress_tag_found: - bug.resolution = IN_PROGRESS_TAG - show_marker = show_in_progress - elif unresolved_tag_found or unresolved_labels.is_empty(): - bug.resolution = UNRESOLVED_TAG - show_marker = show_unresolved - if not show_marker: continue - - bug.id = bug_in["id"] - bug.title = bug_in["title"] - bug.body = bug_in["body"] - bug.component = &"Unused" - bug.platform = &"Unused" - bug.operating_system = &"Unused" - bug.severity = "Severity will go here." - bug.status = bug_in["state"] - bug.duplicate_of = -1 - bug.map_name = "Map name will go here." - bug.marker_location = "Marker location will go here." - - response_array.append(bug) - elif response_data is Dictionary: - # If the response is a dictionary and not an array, make the assumption - # that this is because the response was an error code. - var error_data : BugbotErrorData = BugbotErrorData.new() - error_data.code = 1 - error_data.message = response_data["message"] - error_data.url = response_data["url"] - response_array.append(error_data) - printerr(error_data.message) + var bug_array : Array + var resolved_labels : Array = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/resolved_statuses") + var in_progress_labels : Array = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/in_progress_statuses") + var unresolved_labels : Array = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/unresolved_statuses") - callback.call_deferred(response_array) + var show_resolved : bool = ProjectSettings.get_setting("bugbot/markers/resolved/show_resolved_bugs") + var show_in_progress : bool = ProjectSettings.get_setting("bugbot/markers/in_progress/show_in_progress_bugs") + var show_unresolved : bool = ProjectSettings.get_setting("bugbot/markers/unresolved/show_unresolved_bugs") + + for bug_in:Dictionary in response_data: + var bug : BugbotBugData = BugbotBugData.new() + + var bug_labels : Array = [] + var resolved_tag_found : bool = false + var in_progress_tag_found : bool = false + var unresolved_tag_found : bool = false + + # Find which resolution statuses apply to this bug. + bug.is_open = (bug_in["state"] == "open") + if not bug.is_open: + resolved_tag_found = true + else: + for labels:Dictionary in bug_in["labels"]: + bug_labels.append(labels["name"] as String) + for label:String in resolved_labels: + if bug_labels.has(label): resolved_tag_found = true + for label:String in in_progress_labels: + if bug_labels.has(label): in_progress_tag_found = true + for label:String in unresolved_labels: + if bug_labels.has(label): unresolved_tag_found = true + + # Figure out which resolution tag to prioritise, and whether we should show the marker. + var show_marker : bool + if resolved_tag_found: + bug.resolution = RESOLVED_TAG + show_marker = show_resolved + elif in_progress_tag_found: + bug.resolution = IN_PROGRESS_TAG + show_marker = show_in_progress + elif unresolved_tag_found or unresolved_labels.is_empty(): + bug.resolution = UNRESOLVED_TAG + show_marker = show_unresolved + if not show_marker: continue + + bug.id = bug_in["id"] + bug.title = bug_in["title"] + bug.body = bug_in["body"] + bug.component = &"Unused" + bug.platform = &"Unused" + bug.operating_system = &"Unused" + bug.severity = "Severity will go here." + bug.status = bug_in["state"] + bug.duplicate_of = -1 + bug.map_name = "Map name will go here." + bug.marker_location = "Marker location will go here." + + bug_array.append(bug) + + callback.call_deferred(bug_array) + __bugbot_server_thread.call_deferred("wait_to_finish") + +func __prepare_form_thread(callback:Callable) -> void: + var http_client : HTTPClient = HTTPClient.new() + if __connect_to_server(http_client, DEFAULT_SERVER) != HTTPClient.STATUS_CONNECTED: + printerr("Could not connect to server.") + return + + # Pull a list of issue labels so we can get the ones we care about. + var api_url : String = __build_url_string("labels") + var header_data : Array = __create_header_data() + var error : int = http_client.request(HTTPClient.METHOD_GET, api_url, header_data) + assert(error == Error.OK) + while http_client.get_status() == HTTPClient.STATUS_REQUESTING: + http_client.poll() + assert(http_client.get_status() == HTTPClient.STATUS_BODY or http_client.get_status() == HTTPClient.STATUS_CONNECTED) + var response_string : String = __get_http_client_chunk_response(http_client) + + var response_data := JSON.parse_string(response_string) + if __validate_server_response(response_data) != Error.OK: + return + + var version_tags : Array + var hardware_tags : Array + var os_tags : Array + var component_tags : Array + var priority_tags : Array + var version_prefix : String = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/version_label_prefix", DEFAULT_VERSION_LABEL_PREFIX) + var hardware_prefix : String = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/hardware_label_prefix", DEFAULT_HARDWARE_LABEL_PREFIX) + var os_prefix : String = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/os_label_prefix", DEFAULT_OS_LABEL_PREFIX) + var component_prefix : String = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/component_label_prefix", DEFAULT_COMPONENT_LABEL_PREFIX) + var priority_prefix : String = ProjectSettings.get_setting("bugbot/reporting/gitea/status_labels/priority_label_prefix", DEFAULT_PRIORITY_LABEL_PREFIX) + for label_in:Dictionary in response_data: + if version_prefix and label_in["name"].begins_with(version_prefix): + version_tags.append(label_in) + if hardware_prefix and label_in["name"].begins_with(hardware_prefix): + hardware_tags.append(label_in) + if os_prefix and label_in["name"].begins_with(os_prefix): + os_tags.append(label_in) + if component_prefix and label_in["name"].begins_with(component_prefix): + component_tags.append(label_in) + if priority_prefix and label_in["name"].begins_with(priority_prefix): + priority_tags.append(label_in) + version_tags.sort_custom(func(a,b):return a["id"] < b["id"]) + hardware_tags.sort_custom(func(a,b):return a["id"] < b["id"]) + os_tags.sort_custom(func(a,b):return a["id"] < b["id"]) + component_tags.sort_custom(func(a,b):return a["id"] < b["id"]) + priority_tags.sort_custom(func(a,b): return a["id"] < b["id"]) + + var tag_lists : Array = [version_tags, hardware_tags, os_tags, component_tags, priority_tags] + callback.call_deferred(tag_lists) __bugbot_server_thread.call_deferred("wait_to_finish") func __send_form_data_thread(callback:Callable) -> void: var http_client : HTTPClient = HTTPClient.new() - var error : int = __connect_to_server(http_client, DEFAULT_SERVER) - assert(error == Error.OK) - - while http_client.get_status() == HTTPClient.STATUS_CONNECTING or http_client.get_status() == HTTPClient.STATUS_RESOLVING: - http_client.poll() - assert(http_client.get_status() == HTTPClient.STATUS_CONNECTED) + if __connect_to_server(http_client, DEFAULT_SERVER) != HTTPClient.STATUS_CONNECTED: + printerr("Could not connect to server.") + return var api_url : String = __build_url_string("labels") - var api_key : String = ProjectSettings.get_setting("bugbot/reporting/gitea/API_key", DEFAULT_API_KEY) - var header_data : Array = __create_header_data("application/json", api_key) - error = http_client.request(HTTPClient.METHOD_GET, api_url, header_data) + var header_data : Array = __create_header_data() + var error : int = http_client.request(HTTPClient.METHOD_GET, api_url, header_data) assert(error == Error.OK) while http_client.get_status() == HTTPClient.STATUS_REQUESTING: http_client.poll() assert(http_client.get_status() == HTTPClient.STATUS_BODY or http_client.get_status() == HTTPClient.STATUS_CONNECTED) var response_string : String = __get_http_client_chunk_response(http_client) - var response_array : Array var response_data := JSON.parse_string(response_string) - if response_data is Array: - # If the response is an array, we can make the assumption that this is - # a list of returned bugs. - var bug_label : String = ProjectSettings.get_setting("bugbot/reporting/gitea/bug_label", DEFAULT_BUG_LABEL) - var status_label : String = ProjectSettings.get_setting("bugbot/reporting/gitea/default_status_label", DEFAULT_STATUS_LABEL) - for label_in:Dictionary in response_data: - if label_in["name"] == bug_label or label_in["name"] == status_label: - response_array.append(label_in["id"]) - elif response_data is Dictionary: - # If the response is a dictionary and not an array, make the assumption - # that this is because the response was an error code. - var error_data : BugbotErrorData = BugbotErrorData.new() - error_data.code = 1 - error_data.message = response_data["message"] - error_data.url = response_data["url"] - response_array.append(error_data) - printerr(error_data.message) + if __validate_server_response(response_data) != Error.OK: + return + + var response_array : Array + var bug_label : String = ProjectSettings.get_setting("bugbot/reporting/gitea/bug_label", DEFAULT_BUG_LABEL) + var status_label : String = ProjectSettings.get_setting("bugbot/reporting/gitea/default_status_label", DEFAULT_STATUS_LABEL) + for label_in:Dictionary in response_data: + if label_in["name"] == bug_label or label_in["name"] == status_label: + response_array.append(label_in["id"]) api_url = __build_url_string("issues") var post_data : Dictionary = { @@ -167,7 +196,7 @@ func __send_form_data_thread(callback:Callable) -> void: "labels": response_array, } var post_data_string : String = JSON.stringify(post_data) - header_data = __create_header_data("application/json", api_key, post_data_string.length()) + header_data = __create_header_data(post_data_string.length()) error = http_client.request(HTTPClient.METHOD_POST, api_url, header_data, post_data_string) assert(error == Error.OK) while http_client.get_status() == HTTPClient.STATUS_REQUESTING: @@ -191,12 +220,26 @@ func __build_url_string(_api_suffix:String) -> String: ProjectSettings.get_setting("bugbot/reporting/gitea/repo_name", DEFAULT_REPO_NAME) + \ "/" + _api_suffix -func __create_header_data(mime_type:String, api_key:String, content_length:int = -1) -> Array: +func __create_header_data(content_length:int = -1) -> Array: var header : Array = [ "User-Agent: Pirulo/1.0 (Godot)", - "Accept: " + mime_type, - "Content-Type: " + mime_type, + "Accept: application/json", ] - if api_key: header.append("Authorization: token " + api_key) - if content_length >= 0: header.append("Content-Length: " + String.num_uint64(content_length)) + header.append("Authorization: token " + ProjectSettings.get_setting("bugbot/reporting/gitea/API_key", DEFAULT_API_KEY)) + if content_length >= 0: + header.append("Content-Type: application/json") + header.append("Content-Length: " + String.num_uint64(content_length)) return header + +func __validate_server_response(_response:Variant) -> int: + # If the response is a dictionary and not an array, make the assumption + # that this is because the response was an error code. + if _response is Dictionary: + var error_data : BugbotErrorData = BugbotErrorData.new() + error_data.code = 1 + error_data.message = _response["message"] + error_data.url = _response["url"] + printerr(error_data.message) + __bugbot_server_thread.call_deferred("wait_to_finish") + return Error.FAILED + return Error.OK diff --git a/UI/OpenSans-Regular.ttf b/UI/OpenSans-Regular.ttf new file mode 100644 index 0000000..67803bb Binary files /dev/null and b/UI/OpenSans-Regular.ttf differ diff --git a/UI/OpenSans-Regular.ttf.import b/UI/OpenSans-Regular.ttf.import new file mode 100644 index 0000000..069cec8 --- /dev/null +++ b/UI/OpenSans-Regular.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://c6kmp4h12yvqo" +path="res://.godot/imported/OpenSans-Regular.ttf-86254fbb6aac993f6e9803d3243471d1.fontdata" + +[deps] + +source_file="res://addons/Bugbot/UI/OpenSans-Regular.ttf" +dest_files=["res://.godot/imported/OpenSans-Regular.ttf-86254fbb6aac993f6e9803d3243471d1.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=true +multichannel_signed_distance_field=true +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=false +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/UI/RobotoMono-Regular.ttf b/UI/RobotoMono-Regular.ttf new file mode 100644 index 0000000..6df2b25 Binary files /dev/null and b/UI/RobotoMono-Regular.ttf differ diff --git a/UI/RobotoMono-Regular.ttf.import b/UI/RobotoMono-Regular.ttf.import new file mode 100644 index 0000000..5b63bef --- /dev/null +++ b/UI/RobotoMono-Regular.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://da7rc0rvin4l7" +path="res://.godot/imported/RobotoMono-Regular.ttf-be94330586b1027deda8b4a414498596.fontdata" + +[deps] + +source_file="res://addons/Bugbot/UI/RobotoMono-Regular.ttf" +dest_files=["res://.godot/imported/RobotoMono-Regular.ttf-be94330586b1027deda8b4a414498596.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=true +multichannel_signed_distance_field=true +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=false +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/UI/bug_report_form.gd b/UI/bug_report_form.gd new file mode 100644 index 0000000..f79a1ed --- /dev/null +++ b/UI/bug_report_form.gd @@ -0,0 +1,50 @@ +class_name BugReportForm +extends ColorRect + +@onready var __version_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/VersionButton +@onready var __hardware_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/HardwareButton +@onready var __os_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/OSButton +@onready var __component_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/ComponentButton +@onready var __severity_button : MenuButton = $Form/VBoxContainerLeft/GridContainer/SeverityButton + +var __version_items : Array +var __hardware_items : Array +var __os_items : Array +var __component_items : Array +var __severity_items : Array + +var __stored_mouse_mode : int + + +func _enter_tree(): + __stored_mouse_mode = Input.mouse_mode + Input.mouse_mode = Input.MOUSE_MODE_VISIBLE + +func _exit_tree(): + Input.mouse_mode = __stored_mouse_mode + +func fill_tags(tag_list:Array): + var version_menu : PopupMenu = __version_button.get_popup() + var version_list : Array = tag_list[0] + for i in version_list.size(): + version_menu.add_item(version_list[i]["name"], i) + + var hardware_menu : PopupMenu = __hardware_button.get_popup() + var hardware_list : Array = tag_list[1] + for i in hardware_list.size(): + hardware_menu.add_item(hardware_list[i]["name"], i) + + var os_menu : PopupMenu = __os_button.get_popup() + var os_list : Array = tag_list[2] + for i in os_list.size(): + os_menu.add_item(os_list[i]["name"], i) + + var component_menu : PopupMenu = __component_button.get_popup() + var component_list : Array = tag_list[3] + for i in component_list.size(): + component_menu.add_item(component_list[i]["name"], i) + + var severity_menu : PopupMenu = __severity_button.get_popup() + var severity_list : Array = tag_list[4] + for i in severity_list.size(): + severity_menu.add_item(severity_list[i]["name"], i) diff --git a/UI/bug_report_form.theme b/UI/bug_report_form.theme new file mode 100644 index 0000000..d3254de Binary files /dev/null and b/UI/bug_report_form.theme differ diff --git a/UI/bug_report_form.tscn b/UI/bug_report_form.tscn new file mode 100644 index 0000000..a0cca2f --- /dev/null +++ b/UI/bug_report_form.tscn @@ -0,0 +1,153 @@ +[gd_scene load_steps=3 format=3 uid="uid://bi8xv7a5k3wuu"] + +[ext_resource type="Theme" uid="uid://cw07kl24clcs0" path="res://addons/Bugbot/UI/bug_report_form.theme" id="1_rwv2x"] +[ext_resource type="Script" path="res://addons/Bugbot/UI/bug_report_form.gd" id="2_w8fc6"] + +[node name="BugReportForm" type="ColorRect"] +process_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_rwv2x") +color = Color(0, 0, 0, 0.25) +script = ExtResource("2_w8fc6") + +[node name="Form" type="HBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.1 +anchor_top = 0.45 +anchor_right = 0.9 +anchor_bottom = 0.9 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainerLeft" type="VBoxContainer" parent="Form"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.67 + +[node name="GridContainer" type="GridContainer" parent="Form/VBoxContainerLeft"] +layout_mode = 2 +size_flags_vertical = 3 +columns = 2 + +[node name="ProductNameLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +text = "Product Name:" +horizontal_alignment = 2 + +[node name="ProductName" type="Label" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "NameOfProductHere" +clip_text = true + +[node name="VersionLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +text = "Version:" +horizontal_alignment = 2 + +[node name="VersionButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +focus_mode = 2 +action_mode = 1 +text = "Select Version" +flat = false +alignment = 0 +clip_text = true + +[node name="HardwareLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +text = "Hardware:" +horizontal_alignment = 2 + +[node name="HardwareButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +focus_mode = 2 +action_mode = 1 +text = "Select Hardware" +flat = false +alignment = 0 +clip_text = true + +[node name="OSLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +text = "OS:" +horizontal_alignment = 2 + +[node name="OSButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +focus_mode = 2 +action_mode = 1 +text = "Select OS" +flat = false +alignment = 0 +clip_text = true + +[node name="ComponentLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +text = "Component:" +horizontal_alignment = 2 + +[node name="ComponentButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +focus_mode = 2 +action_mode = 1 +text = "Select Component" +flat = false +alignment = 0 +clip_text = true + +[node name="SeverityLabel" type="Label" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +text = "Severity:" +horizontal_alignment = 2 + +[node name="SeverityButton" type="MenuButton" parent="Form/VBoxContainerLeft/GridContainer"] +layout_mode = 2 +focus_mode = 2 +action_mode = 1 +text = "Select Severity" +flat = false +alignment = 0 +clip_text = true + +[node name="CancelButton" type="Button" parent="Form/VBoxContainerLeft"] +layout_mode = 2 +text = "Cancel" + +[node name="VBoxContainerRight" type="VBoxContainer" parent="Form"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="GridContainer" type="GridContainer" parent="Form/VBoxContainerRight"] +layout_mode = 2 +size_flags_vertical = 3 +columns = 2 + +[node name="SummaryLabel" type="Label" parent="Form/VBoxContainerRight/GridContainer"] +layout_mode = 2 +text = "Summary:" +horizontal_alignment = 2 + +[node name="SummaryText" type="LineEdit" parent="Form/VBoxContainerRight/GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="DescriptionLabel" type="Label" parent="Form/VBoxContainerRight/GridContainer"] +layout_mode = 2 +size_flags_vertical = 3 +text = "Description:" +horizontal_alignment = 2 + +[node name="DescriptionText" type="TextEdit" parent="Form/VBoxContainerRight/GridContainer"] +layout_mode = 2 +size_flags_vertical = 3 +wrap_mode = 1 + +[node name="SubmitButton" type="Button" parent="Form/VBoxContainerRight"] +layout_mode = 2 +text = "Submit" diff --git a/bugbot.gd b/bugbot.gd index e9c00ed..74647d5 100644 --- a/bugbot.gd +++ b/bugbot.gd @@ -58,6 +58,11 @@ func __initialise_project_settings(): __add_project_setting("bugbot/reporting/gitea/status_labels/unresolved_statuses", TYPE_ARRAY, Array(), PROPERTY_HINT_ARRAY_TYPE, &"21/:") __add_project_setting("bugbot/reporting/gitea/status_labels/in_progress_statuses", TYPE_ARRAY, Array(), PROPERTY_HINT_ARRAY_TYPE, &"21/:") __add_project_setting("bugbot/reporting/gitea/status_labels/resolved_statuses", TYPE_ARRAY, Array(), PROPERTY_HINT_ARRAY_TYPE, &"21/:") + __add_project_setting("bugbot/reporting/gitea/status_labels/version_label_prefix", TYPE_STRING, BugbotServerGiteaAPI.DEFAULT_VERSION_LABEL_PREFIX) + __add_project_setting("bugbot/reporting/gitea/status_labels/hardware_label_prefix", TYPE_STRING, BugbotServerGiteaAPI.DEFAULT_HARDWARE_LABEL_PREFIX) + __add_project_setting("bugbot/reporting/gitea/status_labels/os_label_prefix", TYPE_STRING, BugbotServerGiteaAPI.DEFAULT_OS_LABEL_PREFIX) + __add_project_setting("bugbot/reporting/gitea/status_labels/component_label_prefix", TYPE_STRING, BugbotServerGiteaAPI.DEFAULT_COMPONENT_LABEL_PREFIX) + __add_project_setting("bugbot/reporting/gitea/status_labels/priority_label_prefix", TYPE_STRING, BugbotServerGiteaAPI.DEFAULT_PRIORITY_LABEL_PREFIX) #endregion #region Jira __add_project_setting("bugbot/reporting/jira/server", TYPE_STRING, "https://jira.example.com")