Complete working PUT
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user