@phren/cli 0.1.38 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/memory-ui-graph.browser.js +363 -293
- package/dist/memory-ui-graph.runtime.js +363 -293
- package/dist/ui/scripts.js +35 -14
- package/package.json +1 -1
package/dist/ui/scripts.js
CHANGED
|
@@ -2683,20 +2683,41 @@ export function renderGraphHostScript() {
|
|
|
2683
2683
|
deleteNode(currentNode);
|
|
2684
2684
|
}
|
|
2685
2685
|
|
|
2686
|
-
//
|
|
2687
|
-
|
|
2686
|
+
// Persist edits made directly inside the project pane. The pane owns the
|
|
2687
|
+
// editor; the host only performs the mutation and updates the rendered node.
|
|
2688
|
+
function saveInlineFromPane(node) {
|
|
2688
2689
|
if (!node || (node.kind !== 'finding' && node.kind !== 'task')) return;
|
|
2689
|
-
var
|
|
2690
|
-
if (
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
if (
|
|
2698
|
-
|
|
2699
|
-
|
|
2690
|
+
var nextText = (node.editedText || '').trim();
|
|
2691
|
+
if (!nextText) return;
|
|
2692
|
+
if (node.kind === 'finding') {
|
|
2693
|
+
graphRequest('/api/findings/' + encodeURIComponent(node.projectName), 'PUT', {
|
|
2694
|
+
old_text: node.tooltipLabel || node.fullLabel || '',
|
|
2695
|
+
new_text: nextText,
|
|
2696
|
+
score_key: node.scoreKey || ''
|
|
2697
|
+
}).then(function(result) {
|
|
2698
|
+
if (!result || !result.ok) throw new Error(result && result.error ? result.error : 'Save failed');
|
|
2699
|
+
var api = graphApi();
|
|
2700
|
+
if (api && api.updateNode) api.updateNode(node.id, { text: nextText });
|
|
2701
|
+
graphToast('Finding updated', 'ok');
|
|
2702
|
+
}).catch(function(err) { graphToast('Update failed: ' + err.message, 'err'); });
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
graphRequest('/api/tasks/update', 'POST', {
|
|
2706
|
+
project: node.projectName,
|
|
2707
|
+
item: node.stableId || node.id || node.tooltipLabel || node.fullLabel || node.displayLabel || '',
|
|
2708
|
+
text: nextText,
|
|
2709
|
+
section: node.editedSection || node.section || 'Queue',
|
|
2710
|
+
priority: typeof node.editedPriority === 'string' ? node.editedPriority : (node.priority || '')
|
|
2711
|
+
}).then(function(result) {
|
|
2712
|
+
if (!result || !result.ok) throw new Error(result && result.error ? result.error : 'Save failed');
|
|
2713
|
+
var api = graphApi();
|
|
2714
|
+
if (api && api.updateNode) api.updateNode(node.id, {
|
|
2715
|
+
text: nextText,
|
|
2716
|
+
section: node.editedSection || node.section || 'Queue',
|
|
2717
|
+
priority: typeof node.editedPriority === 'string' ? node.editedPriority : (node.priority || '')
|
|
2718
|
+
});
|
|
2719
|
+
graphToast('Task updated', 'ok');
|
|
2720
|
+
}).catch(function(err) { graphToast('Update failed: ' + err.message, 'err'); });
|
|
2700
2721
|
}
|
|
2701
2722
|
|
|
2702
2723
|
function completeCurrentTask() {
|
|
@@ -2818,7 +2839,7 @@ export function renderGraphHostScript() {
|
|
|
2818
2839
|
api.onItemAction(function(payload, action) {
|
|
2819
2840
|
if (action === 'delete') deleteNode(payload);
|
|
2820
2841
|
else if (action === 'delete-batch') deleteNodes(payload);
|
|
2821
|
-
else if (action === '
|
|
2842
|
+
else if (action === 'save-inline') saveInlineFromPane(payload);
|
|
2822
2843
|
else if (action === 'merge') mergeNodes(payload);
|
|
2823
2844
|
});
|
|
2824
2845
|
}
|