mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 11:27:50 +08:00
feat: remove unused openapi action button
This commit is contained in:
@@ -34,7 +34,10 @@ class DashbotActionWidgetFactory {
|
||||
case ChatActionType.applyCurl:
|
||||
return DashbotApplyCurlButton(action: action);
|
||||
case ChatActionType.applyOpenApi:
|
||||
return DashbotApplyOpenApiButton(action: action);
|
||||
if (action.action == 'import_now_openapi') {
|
||||
return DashbotImportNowButton(action: action);
|
||||
}
|
||||
return null;
|
||||
case ChatActionType.downloadDoc:
|
||||
return DashbotDownloadDocButton(action: action);
|
||||
case ChatActionType.noAction:
|
||||
@@ -70,9 +73,6 @@ class DashbotActionWidgetFactory {
|
||||
if (action.action == 'apply_curl') {
|
||||
return DashbotApplyCurlButton(action: action);
|
||||
}
|
||||
if (action.action == 'apply_openapi') {
|
||||
return DashbotApplyOpenApiButton(action: action);
|
||||
}
|
||||
if (action.action.contains('update') ||
|
||||
action.action.contains('add') ||
|
||||
action.action.contains('delete')) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
export 'dashbot_add_test_button.dart';
|
||||
export 'dashbot_apply_curl_button.dart';
|
||||
export 'dashbot_apply_openapi_button.dart';
|
||||
export 'dashbot_auto_fix_button.dart';
|
||||
export 'dashbot_download_doc_button.dart';
|
||||
export 'dashbot_generate_codeblock.dart';
|
||||
|
||||
@@ -233,34 +233,6 @@ class OpenApiImportService {
|
||||
op: op,
|
||||
);
|
||||
|
||||
/// Build an action message asking whether to apply to selected/new
|
||||
/// for a single chosen operation.
|
||||
static Map<String, dynamic> buildActionMessageFromPayload(
|
||||
Map<String, dynamic> actionPayload,
|
||||
{String? title}) {
|
||||
final buf = StringBuffer(
|
||||
title ?? 'Parsed the OpenAPI operation. Where should I apply it?');
|
||||
return {
|
||||
'explnation': buf.toString(),
|
||||
'actions': [
|
||||
{
|
||||
'action': 'apply_openapi',
|
||||
'target': 'httpRequestModel',
|
||||
'field': 'apply_to_new',
|
||||
'path': null,
|
||||
'value': actionPayload,
|
||||
},
|
||||
{
|
||||
'action': 'apply_openapi',
|
||||
'target': 'httpRequestModel',
|
||||
'field': 'apply_to_selected',
|
||||
'path': null,
|
||||
'value': actionPayload,
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
static Map<String, dynamic> buildOperationPicker(OpenApi spec,
|
||||
{String? insights}) {
|
||||
final servers = spec.servers ?? const [];
|
||||
|
||||
Reference in New Issue
Block a user