diff --git a/public/app/features/explore/QueryLibrary/QueryTemplateForm.tsx b/public/app/features/explore/QueryLibrary/QueryTemplateForm.tsx index 643ca5427a9..7ee55018f35 100644 --- a/public/app/features/explore/QueryLibrary/QueryTemplateForm.tsx +++ b/public/app/features/explore/QueryLibrary/QueryTemplateForm.tsx @@ -83,9 +83,7 @@ export const QueryTemplateForm = ({ onCancel, onSave, queryToAdd, templateData } .then(() => { getAppEvents().publish({ type: AppEvents.alertSuccess.name, - payload: [ - t('explore.query-library.query-template-added', 'Query template successfully added to the library'), - ], + payload: [t('explore.query-library.query-template-edited', 'Query template successfully edited')], }); return true; }) @@ -106,7 +104,10 @@ export const QueryTemplateForm = ({ onCancel, onSave, queryToAdd, templateData } data.description || t('explore.query-library.default-description', 'Public', { timestamp: timestamp }); if (templateData?.fullSpec) { - handleEditQueryTemplate(templateData.fullSpec).then((isSuccess) => { + handleEditQueryTemplate({ + ...templateData.fullSpec, + spec: { ...templateData.fullSpec.spec, title: data.description }, + }).then((isSuccess) => { onSave(isSuccess); }); } else if (queryToAdd) { diff --git a/public/app/features/explore/QueryLibrary/QueryTemplatesTable/ActionsCell.tsx b/public/app/features/explore/QueryLibrary/QueryTemplatesTable/ActionsCell.tsx index 900de252591..b2d50c27552 100644 --- a/public/app/features/explore/QueryLibrary/QueryTemplatesTable/ActionsCell.tsx +++ b/public/app/features/explore/QueryLibrary/QueryTemplatesTable/ActionsCell.tsx @@ -83,8 +83,8 @@ function ActionsCell({ queryTemplate, rootDatasourceUid, queryUid }: ActionsCell setEditFormOpen(false)} templateData={queryTemplate} - onSave={(data) => { - console.log(data); + onSave={() => { + setEditFormOpen(false); }} /> diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index cf1b1cbcd15..c67c30914ac 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -578,6 +578,7 @@ "optional-description": "An optional description of what the query does.", "query-comment-label": "Query comment", "query-template-added": "Query template successfully added to the library", + "query-template-edited": "Query template successfully edited", "query-text-label": "Query text", "save-comment": "Save comment", "star-query-tooltip": "Star query",