Complete working PUT

This commit is contained in:
Kristina Durivage
2024-07-03 11:21:30 -05:00
parent 216d34375d
commit c1e4c91514
3 changed files with 8 additions and 6 deletions
@@ -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) {
@@ -83,8 +83,8 @@ function ActionsCell({ queryTemplate, rootDatasourceUid, queryUid }: ActionsCell
<QueryTemplateForm
onCancel={() => setEditFormOpen(false)}
templateData={queryTemplate}
onSave={(data) => {
console.log(data);
onSave={() => {
setEditFormOpen(false);
}}
/>
</Modal>
+1
View File
@@ -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",