diff --git a/src/addons/AddOnPin.svelte b/src/addons/AddOnPin.svelte
index 0a9027f31..a6114cd96 100644
--- a/src/addons/AddOnPin.svelte
+++ b/src/addons/AddOnPin.svelte
@@ -1,6 +1,6 @@
diff --git a/src/addons/browser/AddOnList.svelte b/src/addons/browser/AddOnList.svelte
index b4ee58bf3..da65f3d1c 100644
--- a/src/addons/browser/AddOnList.svelte
+++ b/src/addons/browser/AddOnList.svelte
@@ -1,13 +1,3 @@
-
-
-
diff --git a/src/addons/runs/Scheduled.svelte b/src/addons/runs/Scheduled.svelte
index db3034548..2aecddb73 100644
--- a/src/addons/runs/Scheduled.svelte
+++ b/src/addons/runs/Scheduled.svelte
@@ -7,7 +7,8 @@
import Error from "../../common/icons/Error.svelte";
import Loader from "../../common/Loader.svelte";
import Paginator from "../../common/Paginator.svelte";
- import ScheduledEvent, { type Event } from "./ScheduledEvent.svelte";
+ import ScheduledEvent from "./ScheduledEvent.svelte";
+ import type { Event } from "../types";
import { baseApiUrl } from "../../api/base.js";
@@ -29,7 +30,7 @@
$: next_url = res.next ? new URL(res.next) : null;
$: prev_url = res.previous ? new URL(res.previous) : null;
$: events = res.results ?? [];
- $: empty = !loading && res.results?.length === 0;
+ $: empty = !loading && !Boolean(res.results?.length) && !error;
export async function load(url?: string | URL) {
try {
diff --git a/src/addons/runs/ScheduledEvent.svelte b/src/addons/runs/ScheduledEvent.svelte
index 08f751dc7..f39654eaf 100644
--- a/src/addons/runs/ScheduledEvent.svelte
+++ b/src/addons/runs/ScheduledEvent.svelte
@@ -1,16 +1,5 @@
@@ -35,13 +45,7 @@
{args}
parameters={{
msw: {
- handlers: [
- mock.users.data,
- mock.users.me,
- mock.organizations.data,
- mock.projects.data,
- mock.runs.data,
- ],
+ handlers,
},
}}
/>
@@ -51,13 +55,7 @@
args={{ ...args, embed: true }}
parameters={{
msw: {
- handlers: [
- mock.users.data,
- mock.users.me,
- mock.organizations.data,
- mock.projects.data,
- mock.runs.data,
- ],
+ handlers,
},
}}
/>
@@ -67,13 +65,7 @@
args={{ ...args, dialog: true }}
parameters={{
msw: {
- handlers: [
- mock.users.data,
- mock.users.me,
- mock.organizations.data,
- mock.projects.data,
- mock.runs.data,
- ],
+ handlers,
},
}}
/>
diff --git a/src/pages/app/stories/SearchBar.stories.svelte b/src/pages/app/stories/SearchBar.stories.svelte
index 6b8d0c200..dc322994c 100644
--- a/src/pages/app/stories/SearchBar.stories.svelte
+++ b/src/pages/app/stories/SearchBar.stories.svelte
@@ -1,7 +1,8 @@
-
@@ -22,7 +25,7 @@
args={{ search: "project:example-project-123" }}
parameters={{
msw: {
- handlers: [mock.users.data, mock.organizations.data, mock.projects.data],
+ handlers,
},
}}
/>
@@ -32,7 +35,7 @@
args={{ compact: true, search: "project:example-project-123" }}
parameters={{
msw: {
- handlers: [mock.users.data, mock.organizations.data, mock.projects.data],
+ handlers,
},
}}
/>
@@ -42,7 +45,7 @@
args={{ example: true, search: "project:example-project-123" }}
parameters={{
msw: {
- handlers: [mock.users.data, mock.organizations.data, mock.projects.data],
+ handlers,
},
}}
/>
@@ -52,7 +55,7 @@
args={{ dialog: true, search: "user:example-user-123" }}
parameters={{
msw: {
- handlers: [mock.users.data, mock.organizations.data, mock.projects.data],
+ handlers,
},
}}
/>
diff --git a/src/pages/app/stories/SearchInput.stories.svelte b/src/pages/app/stories/SearchInput.stories.svelte
index b04202fd5..12ffeb47b 100644
--- a/src/pages/app/stories/SearchInput.stories.svelte
+++ b/src/pages/app/stories/SearchInput.stories.svelte
@@ -2,7 +2,8 @@
import { Story } from "@storybook/addon-svelte-csf";
import SearchInput from "../SearchInput.svelte";
- import * as mock from "./mock";
+ import { organizations, users } from "../../../test/handlers/accounts";
+ import { projects } from "../../../test/handlers/projects";
export const meta = {
title: "App / Search / Search Input",
@@ -16,7 +17,7 @@
name="default"
parameters={{
msw: {
- handlers: [mock.users.data, mock.organizations.data, mock.projects.data],
+ handlers: [users.data, organizations.data, projects.data],
},
}}
>
diff --git a/src/pages/app/stories/SearchLink.stories.svelte b/src/pages/app/stories/SearchLink.stories.svelte
index 6ccc43177..176d702a5 100644
--- a/src/pages/app/stories/SearchLink.stories.svelte
+++ b/src/pages/app/stories/SearchLink.stories.svelte
@@ -1,7 +1,8 @@
-
diff --git a/src/pages/viewer/stories/Header.stories.svelte b/src/pages/viewer/stories/Header.stories.svelte
index 57a0a640c..1d6805b13 100644
--- a/src/pages/viewer/stories/Header.stories.svelte
+++ b/src/pages/viewer/stories/Header.stories.svelte
@@ -3,11 +3,11 @@
import Header from "../Header.svelte";
- import documentFixture from "../fixtures/document.json";
+ import { document } from "../../../test/fixtures/documents";
import { Document as DocumentState } from "../../../structure/document";
const args = {
- document: new DocumentState(documentFixture),
+ document: new DocumentState(document),
loaded: true,
title: true,
showOrg: true,
diff --git a/src/pages/viewer/stories/Sidebar.stories.svelte b/src/pages/viewer/stories/Sidebar.stories.svelte
index 1bf8344a1..b7489efd2 100644
--- a/src/pages/viewer/stories/Sidebar.stories.svelte
+++ b/src/pages/viewer/stories/Sidebar.stories.svelte
@@ -2,11 +2,11 @@
import { Story, Template } from "@storybook/addon-svelte-csf";
import Sidebar from "../Sidebar.svelte";
- import documentFixture from "../fixtures/document.json";
+ import { document } from "../../../test/fixtures/documents";
import { Document as DocumentState } from "../../../structure/document";
const args = {
- document: new DocumentState(documentFixture),
+ document: new DocumentState(document),
loaded: true,
signedIn: true,
disableControls: false,
@@ -30,6 +30,6 @@
name="Uneditable"
args={{
...args,
- document: new DocumentState({ ...documentFixture, edit_access: false }),
+ document: new DocumentState({ ...document, edit_access: false }),
}}
/>
diff --git a/src/projects/Browser.svelte b/src/projects/Browser.svelte
index dfbb2bf05..d98666b24 100644
--- a/src/projects/Browser.svelte
+++ b/src/projects/Browser.svelte
@@ -9,11 +9,10 @@
import Drawer from "../common/Drawer.svelte";
import Search, { query } from "../common/SearchInput.svelte";
import Flex from "../common/Flex.svelte";
- import Paginator from "../common/Paginator.svelte";
import ProjectList from "./ProjectList.svelte";
import { newProject } from "../manager/layout";
import Button from "../common/Button.svelte";
- import { getProjects, getPublicProjects } from "../api/project";
+ import { getProjects } from "../api/project";
import type { User } from "../api/types";
import { getMe } from "../api/orgAndUser";
import Filters, { type FilterKey, filter } from "./Filters.svelte";
@@ -56,7 +55,7 @@
}
// }
} catch (err) {
- error = err;
+ error = err.errorData.detail;
projects = null;
}
loading = false;
diff --git a/src/projects/stories/Browser.stories.svelte b/src/projects/stories/Browser.stories.svelte
index 4b8aae61e..81f3ddedf 100644
--- a/src/projects/stories/Browser.stories.svelte
+++ b/src/projects/stories/Browser.stories.svelte
@@ -4,8 +4,8 @@
import Browser from "../Browser.svelte";
const args = { visible: true };
- import { projectHandlers } from "./mockData";
- import { mockGetMe } from "../../pages/app/accounts/stories/mockData";
+ import { projects } from "../../test/handlers/projects";
+ import { mockGetMe } from "../../test/handlers/accounts";
export const meta = {
title: "App / Projects / Browser",
@@ -22,20 +22,20 @@
diff --git a/src/projects/stories/ProjectList.stories.svelte b/src/projects/stories/ProjectList.stories.svelte
index 6d60e4fc6..5e2a65dc2 100644
--- a/src/projects/stories/ProjectList.stories.svelte
+++ b/src/projects/stories/ProjectList.stories.svelte
@@ -1,11 +1,11 @@