fix(ui): some uxt f

This commit is contained in:
nick-delirium 2023-12-11 13:07:39 +01:00
parent a7684156fe
commit 101b8ea62b
3 changed files with 10 additions and 5 deletions

View file

@ -21,7 +21,7 @@ function StepsModal({
onAdd({
title: title,
description: description || '',
allowTyping: isAnswerEnabled,
allowTyping: Boolean(isAnswerEnabled),
});
onHide();
};

View file

@ -74,7 +74,7 @@ function TestEdit() {
const onSave = (isPreview?: boolean) => {
setHasChanged(false);
if (testId && testId !== 'new') {
uxtestingStore.updateTest(uxtestingStore.instance!).then((testId) => {
uxtestingStore.updateTest(uxtestingStore.instance!, isPreview).then((testId) => {
if (isPreview) {
window.open(`${uxtestingStore.instance!.startingPath}?oruxt=${testId}`, '_blank', 'noopener,noreferrer');
} else {
@ -428,17 +428,19 @@ export function Step({
hover ? 'bg-white hover:' : ''
}bg-active-blue flex items-start gap-2`}
>
<div className={'w-6 h-6 bg-white rounded-full border flex items-center justify-center'}>
<div style={{ minWidth: '1.5rem' }} className={'w-6 h-6 bg-white rounded-full border flex items-center justify-center'}>
{ind + 1}
</div>
<div>
<div className={'overflow-hidden overflow-ellipsis'}>
<Typography.Text>{safeTitle}</Typography.Text>
<div className={'text-disabled-text'}>{safeDescription}</div>
</div>
<div className={'ml-auto'} />
<div className={'flex items-center gap-2'} style={{ minWidth: '4rem' }}>
{buttons}
</div>
</div>
);
}

View file

@ -116,10 +116,13 @@ export default class UxtestingStore {
}
};
updateTest = async (test: UxTestInst) => {
updateTest = async (test: UxTestInst, isPreview?: boolean) => {
if (!this.instance) return;
this.setLoading(true);
try {
if (!isPreview) {
this.instance.setProperty('status', 'in-progress');
}
await this.client.updateTest(this.instance.testId!, test);
return test.testId;
} catch (e) {