Skip to content

Commit 90f26b9

Browse files
authored
Merge pull request #174 from VisActor/feat/vchart_editor_merge_spec
Feat/vchart editor merge spec
2 parents 8db1843 + d9749d1 commit 90f26b9

File tree

11 files changed

+1376
-184
lines changed

11 files changed

+1376
-184
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 191 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/vmind/__tests__/experiment/src/pages/ChartDialogueQA/qaPairRag.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,7 @@ export function QARag() {
244244
{
245245
spec: spec,
246246
appendSpec: {
247-
leafSpec: dslRes,
248-
parentKeyPath,
249-
aliasKeyPath
247+
spec: dslRes
250248
}
251249
},
252250
true
@@ -478,28 +476,30 @@ export function QARag() {
478476

479477
<div className="one-content">
480478
<div>KeyPath Recall:</div>
481-
{keyPathResult.map((item, index) => (
482-
<Card key={index} className="qa-card">
483-
<div className="qa-div">
484-
<span className="title">Score:</span>
485-
<span>{item.scores.toFixed(2)}</span>
486-
</div>
487-
<div className="qa-div">
488-
<div className="title">content:</div>
489-
<span>{item.text}</span>
490-
</div>
491-
{ragOption.type === 'qa' && (
492-
<div className="qa-div">
493-
<div className="title">Answer:</div>
494-
<span>{item.answer}</span>
495-
</div>
496-
)}
497-
<div className="qa-div">
498-
<div className="title">key:</div>
499-
<span>{item.key}</span>
500-
</div>
501-
</Card>
502-
))}
479+
{keyPathResult && keyPathResult.length
480+
? keyPathResult.map((item, index) => (
481+
<Card key={index} className="qa-card">
482+
<div className="qa-div">
483+
<span className="title">Score:</span>
484+
<span>{item.scores.toFixed(2)}</span>
485+
</div>
486+
<div className="qa-div">
487+
<div className="title">content:</div>
488+
<span>{item.text}</span>
489+
</div>
490+
{ragOption.type === 'qa' ? (
491+
<div className="qa-div">
492+
<div className="title">Answer:</div>
493+
<span>{JSON.stringify(item.answer)}</span>
494+
</div>
495+
) : null}
496+
<div className="qa-div">
497+
<div className="title">key:</div>
498+
<span>{item.key}</span>
499+
</div>
500+
</Card>
501+
))
502+
: null}
503503
</div>
504504
</div>
505505
</div>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { set } from '../../../src/utils/set';
2+
3+
describe('set', () => {
4+
it('should set value correctly', () => {
5+
const spec = { padding: { top: 0, left: 0 } };
6+
set(spec, 'padding', 10);
7+
8+
expect(spec).toEqual({ padding: 10 });
9+
});
10+
11+
it('should handle nested object correctly', () => {
12+
const spec = { label: { a: 1 } };
13+
set(spec, 'label.visible', false);
14+
expect(spec).toEqual({ label: { a: 1, visible: false } });
15+
});
16+
});

0 commit comments

Comments
 (0)