Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
LatentDream committed Apr 20, 2024
1 parent f35faa3 commit ad14376
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def test_max():


def test_export_dataframe():

df = pd.DataFrame({'value': [6.15, 6.15, 6.15]})
df = pd.DataFrame({"value": [6.15, 6.15, 6.15]})
# Boolean and DataFrame values will be exported to the Cloud.
test_sequencer.export(df)

Expand All @@ -40,7 +39,7 @@ def test_export():
value = 6.15
# Always export as early as possible to avoid missing data.
test_sequencer.export(value)
assert 12 < value # <-- FAIL
assert 12 < value # <-- FAIL

# Only the last executed export statement will be exported to the Cloud and
# reported to the sequencer.
Expand Down
14 changes: 7 additions & 7 deletions src/renderer/hooks/useTestSequencerProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,19 @@ export const useImportSequences = () => {
return handleImport;
};


export const useImportAllSequencesInFolder = () => {
const manager = usePrepareStateManager();
const { isAdmin } = useWithPermission();

const handleImport = async (path: string, relative: boolean=false) => {
const handleImport = async (path: string, relative: boolean = false) => {
async function importSequences(): Promise<Result<void, Error>> {
// Confirmation if admin
if (!isAdmin()) {
return err(Error("Admin only, Connect to Flojoy Cloud and select a Test Profile"));
return err(
Error(
"Admin only, Connect to Flojoy Cloud and select a Test Profile",
),
);
}

// Find .tjoy files from the profile
Expand All @@ -137,9 +140,7 @@ export const useImportAllSequencesInFolder = () => {
relative,
);
if (result === undefined) {
return err(
Error(`Failed to find the directory ${path}`),
);
return err(Error(`Failed to find the directory ${path}`));
}
if (!result || result.length === 0) {
return err(Error("No .tjoy file found in the selected directory"));
Expand Down Expand Up @@ -172,7 +173,6 @@ export const useImportAllSequencesInFolder = () => {
return handleImport;
};


export const useLoadTestProfile = () => {
const manager = usePrepareStateManager();
const { isAdmin } = useWithPermission();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function DesignBar() {
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<SequencerGalleryModal
<SequencerGalleryModal
isGalleryOpen={isGalleryOpen}
setIsGalleryOpen={setIsGalleryOpen}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ export const SequencerGalleryModal = ({
const data = [
{
title: "Creating Sequences with Conditional",
description: "Learn how to create a simple sequence with conditional logic.",
description:
"Learn how to create a simple sequence with conditional logic.",
path: "conditional",
},
{
title: "Test Step with Expected and Exported Values",
description: "Learn how to inject the minimum and maximum expected values into a test and export the result. Right-click on a test to consult the code and edit the expected values!",
description:
"Learn how to inject the minimum and maximum expected values into a test and export the result. Right-click on a test to consult the code and edit the expected values!",
path: "expected_exported_values",
},
];
Expand Down Expand Up @@ -68,33 +70,38 @@ export const SequencerGalleryModal = ({
<ScrollArea className="">
{data.map((SeqExample) => (
<>
<Separator />
<div className="inline-flex items-center 1 min-h-20 w-full">
<div className="flex w-3/4">
<div className="flex grow flex-col items-start">
<div className="text-xl font-semibold">{SeqExample.title}</div>
<div className="text-sm font-thin">{SeqExample.description}</div>
<Separator />
<div className="1 inline-flex min-h-20 w-full items-center">
<div className="flex w-3/4">
<div className="flex grow flex-col items-start">
<div className="text-xl font-semibold">
{SeqExample.title}
</div>
<div className="text-sm font-thin">
{SeqExample.description}
</div>
</div>
</div>
<div className="grow" />
<Button
variant="outline"
size="sm"
className="ml-6 gap-2"
data-testid={SeqExample.title
.toLowerCase()
.split(" ")
.join("_")}
onClick={async () => {
await handleSequenceLoad(SeqExample.path);
}}
>
Load
</Button>
</div>
<div className="grow" />
<Button
variant="outline"
size="sm"
className="gap-2 ml-6"
data-testid={SeqExample.title.toLowerCase().split(" ").join("_")}
onClick={async () => {
await handleSequenceLoad(SeqExample.path);
}}
>
Load
</Button>
</div>
</>
))}
</ScrollArea>
</DialogContent>
</Dialog>
);
};


0 comments on commit ad14376

Please sign in to comment.