Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Mar 27, 2024
1 parent 4f6eb10 commit c95dca5
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 77 deletions.
4 changes: 2 additions & 2 deletions src/common/dialog/stories/RevisionsDialog.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import RevisionsDialog from "../RevisionsDialog.svelte";
import documentFixture from "../../../pages/app/test/fixtures/document.json";
import { document } from "../../../test/fixtures/documents";
import { revisionControl } from "../../../test/handlers/documents";
import { mockGetMe } from "../../../test/handlers/accounts";
Expand All @@ -26,7 +26,7 @@
const args = {
enabled: true,
documentId: "1",
revisions: documentFixture.revisions,
revisions: document.revisions,
onSave: action("Save"),
onCancel: action("Cancel"),
};
Expand Down
4 changes: 2 additions & 2 deletions src/common/stories/RevisionIcon.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import RevisionIcon from "../RevisionIcon.svelte";
import documentFixture from "../../pages/app/test/fixtures/document.json";
import { document } from "../../test/fixtures/documents";
const args = {
revisions: documentFixture.revisions,
revisions: document.revisions,
showCount: true,
};
Expand Down
5 changes: 1 addition & 4 deletions src/common/stories/UploadOptions.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
let args = {};
import {
mockGetMe,
mockGetOrg,
} from "../../pages/app/accounts/stories/mockData";
import { mockGetMe, mockGetOrg } from "../../test/handlers/accounts";
export const meta = {
title: "Common / Upload Options",
Expand Down
6 changes: 3 additions & 3 deletions src/pages/app/stories/ActionBar.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script context="module">
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import { action } from "@storybook/addon-actions";
import ActionBar from "../ActionBar.svelte";
import documentFixture from "../../viewer/fixtures/document.json";
import { document } from "../../../test/fixtures/documents";
export const meta = {
title: "App / Action Bar",
Expand All @@ -15,7 +15,7 @@
loggedIn: true,
data: {
loading: false,
documents: [documentFixture, documentFixture, documentFixture],
documents: [document, document, document],
},
selection: {
checked: false,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/app/stories/Document.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Document from "../Document.svelte";
import * as structure from "../../../structure/document.js";
import document from "../fixtures/document.json";
import { document } from "../../../test/fixtures/documents";
export const meta = {
title: "App / Documents / Document",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/app/stories/DocumentThumbnail.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import DocumentThumbnail from "../DocumentThumbnail.svelte";
import { Document } from "../../../structure/document.js";
import document from "../fixtures/document.json";
import { document } from "../../../test/fixtures/documents";
export const meta = {
title: "App / Documents / Document Thumbnail",
Expand Down
38 changes: 15 additions & 23 deletions src/pages/app/stories/Documents.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<script context="module">
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import Documents from "../Documents.svelte";
import { layout } from "../../../manager/layout.js";
import * as mock from "./mock";
import { users, organizations } from "../../../test/handlers/accounts";
import { projects } from "../../../test/handlers/projects";
import { runs } from "../../../test/handlers/addons";
export const meta = {
title: "App / Documents / Documents",
Expand All @@ -22,6 +24,14 @@
};
let container;
const handlers = [
users.data,
users.me,
organizations.data,
projects.data,
runs.data,
];
</script>

<Template let:args>
Expand All @@ -35,13 +45,7 @@
{args}
parameters={{
msw: {
handlers: [
mock.users.data,
mock.users.me,
mock.organizations.data,
mock.projects.data,
mock.runs.data,
],
handlers,
},
}}
/>
Expand All @@ -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,
},
}}
/>
Expand All @@ -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,
},
}}
/>
15 changes: 9 additions & 6 deletions src/pages/app/stories/SearchBar.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<script context="module">
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import SearchBar from "../SearchBar.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 Bar",
component: SearchBar,
tags: ["autodocs"],
parameters: { layout: "centered" },
};
const handlers = [users.data, organizations.data, projects.data];
</script>

<Template let:args>
Expand All @@ -22,7 +25,7 @@
args={{ search: "project:example-project-123" }}
parameters={{
msw: {
handlers: [mock.users.data, mock.organizations.data, mock.projects.data],
handlers,
},
}}
/>
Expand All @@ -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,
},
}}
/>
Expand All @@ -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,
},
}}
/>
Expand All @@ -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,
},
}}
/>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/app/stories/SearchInput.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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],
},
}}
>
Expand Down
7 changes: 4 additions & 3 deletions src/pages/app/stories/SearchLink.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script context="module">
<script lang="ts" context="module">
import { Story } from "@storybook/addon-svelte-csf";
import SearchLink from "../SearchLink.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 Link",
Expand All @@ -15,7 +16,7 @@
name="default"
parameters={{
msw: {
handlers: [mock.users.data, mock.organizations.data, mock.projects.data],
handlers: [users.data, organizations.data, projects.data],
},
}}
>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/viewer/stories/AllText.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script context="module">
<script lang="ts" context="module">
import { Story } from "@storybook/addon-svelte-csf";
import AllText from "../AllText.svelte";
import { Document } from "@/structure/document.js";
import { viewer } from "@/viewer/viewer.js";
import document from "../fixtures/document.json";
import { Document } from "../../../structure/document.js";
import { viewer } from "../../../viewer/viewer.js";
import { document } from "../../../test/fixtures/documents";
viewer.document = new Document(document);
Expand Down
8 changes: 4 additions & 4 deletions src/pages/viewer/stories/Body.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<script context="module">
<script lang="ts" context="module">
import { Story } from "@storybook/addon-svelte-csf";
import Body from "../Body.svelte";
import { Document } from "../../../structure/document.js";
import document from "../fixtures/document.json";
import { doc } from "@/viewer/document.js";
import { document } from "../../../test/fixtures/documents";
import { doc } from "../../../viewer/document.js";
import { viewer } from "../../../viewer/viewer.js";
export const meta = {
Expand All @@ -15,6 +14,7 @@
// not clear this does anything useful
viewer.doc = new Document(document);
// @ts-ignore
doc.viewer = viewer;
</script>

Expand Down
4 changes: 2 additions & 2 deletions src/pages/viewer/stories/Header.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/pages/viewer/stories/Sidebar.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -30,6 +30,6 @@
name="Uneditable"
args={{
...args,
document: new DocumentState({ ...documentFixture, edit_access: false }),
document: new DocumentState({ ...document, edit_access: false }),
}}
/>
12 changes: 6 additions & 6 deletions src/projects/stories/Browser.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -22,20 +22,20 @@
<Story
name="Success"
{args}
parameters={{ msw: { handlers: [mockGetMe.data, projectHandlers.data] } }}
parameters={{ msw: { handlers: [mockGetMe.data, projects.data] } }}
/>
<Story
name="Loading"
{args}
parameters={{ msw: { handlers: [mockGetMe.data, projectHandlers.loading] } }}
parameters={{ msw: { handlers: [mockGetMe.data, projects.loading] } }}
/>
<Story
name="Error"
{args}
parameters={{ msw: { handlers: [mockGetMe.data, projectHandlers.error] } }}
parameters={{ msw: { handlers: [mockGetMe.data, projects.error] } }}
/>
<Story
name="Empty"
{args}
parameters={{ msw: { handlers: [mockGetMe.data, projectHandlers.empty] } }}
parameters={{ msw: { handlers: [mockGetMe.data, projects.empty] } }}
/>
8 changes: 4 additions & 4 deletions src/projects/stories/ProjectList.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts" context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import { projects } from "../../api/fixtures/projects.fixtures";
import { projectList } from "../../test/fixtures/projects";
import ProjectList from "../ProjectList.svelte";
const args = {
items: projects.results,
items: projectList.results,
loading: false,
error: null,
};
Expand All @@ -26,7 +26,7 @@
name="With Own Data"
args={{
...args,
items: projects.results.map((project) => ({
items: projectList.results.map((project) => ({
...project,
edit_access: true,
})),
Expand All @@ -36,7 +36,7 @@
name="With Shared Data"
args={{
...args,
items: projects.results.map((project) => ({
items: projectList.results.map((project) => ({
...project,
edit_access: project.user === 4,
})),
Expand Down
Loading

0 comments on commit c95dca5

Please sign in to comment.