Skip to content

Commit

Permalink
style: format with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhthomas committed Nov 11, 2023
1 parent 9a2c976 commit 5ba4202
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 43 deletions.
6 changes: 3 additions & 3 deletions src/lib/components/form/SelectField.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script lang="ts" context="module">
import type { AnyZodObject } from 'zod';
type T = AnyZodObject;
</script>

<script lang="ts" generics="T extends AnyZodObject">
import { Helper, Label, Select, type SelectOptionType } from 'flowbite-svelte';
import type { FormPathLeaves, ZodValidation } from 'sveltekit-superforms';
import { type SuperForm, formFieldProxy } from 'sveltekit-superforms/client';
import type { z } from 'zod';
import type { ZodValidation, FormPathLeaves } from 'sveltekit-superforms';
import { formFieldProxy, type SuperForm } from 'sveltekit-superforms/client';
export let form: SuperForm<ZodValidation<T>, unknown>;
export let field: FormPathLeaves<z.infer<T>>;
Expand Down
5 changes: 2 additions & 3 deletions src/lib/components/form/TextField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

<script lang="ts" generics="T extends AnyZodObject">
import { Helper, Input, Label } from 'flowbite-svelte';
import type { FormPathLeaves, ZodValidation } from 'sveltekit-superforms';
import { type SuperForm, formFieldProxy } from 'sveltekit-superforms/client';
import type { z } from 'zod';
import type { ZodValidation, FormPathLeaves } from 'sveltekit-superforms';
import { formFieldProxy, type SuperForm } from 'sveltekit-superforms/client';
export let form: SuperForm<ZodValidation<T>, unknown>;
export let field: FormPathLeaves<z.infer<T>>;
Expand Down
9 changes: 4 additions & 5 deletions src/lib/components/form/ToggleField.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<script lang="ts" context="module">
import type { AnyZodObject } from 'zod';
type T = AnyZodObject;
</script>

<script lang="ts" generics="T extends AnyZodObject">
import type { Writable } from 'svelte/store';
import { Helper, Label, Toggle } from 'flowbite-svelte';
import type { Writable } from 'svelte/store';
import type { FormPathLeaves, ZodValidation } from 'sveltekit-superforms';
import { type SuperForm, formFieldProxy } from 'sveltekit-superforms/client';
import type { z } from 'zod';
import type { ZodValidation, FormPathLeaves } from 'sveltekit-superforms';
import { formFieldProxy, type SuperForm } from 'sveltekit-superforms/client';
export let form: SuperForm<ZodValidation<T>, unknown>;
export let field: FormPathLeaves<z.infer<T>>;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/table/DataTable.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import { Render, Subscribe, type TableViewModel } from 'svelte-headless-table';
import {
Table,
TableBody,
Expand All @@ -8,6 +7,7 @@
TableHead,
TableHeadCell
} from 'flowbite-svelte';
import { Render, Subscribe, type TableViewModel } from 'svelte-headless-table';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export let vm: TableViewModel<any>;
Expand Down
34 changes: 19 additions & 15 deletions src/lib/components/webhooks/WebhookEditDrawer.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<script context="module" lang="ts">
import { openModal } from 'svelte-modals';
import { superValidate } from 'sveltekit-superforms/client';
import WebhookEditDrawer from './WebhookEditDrawer.svelte';
import { WebhooksApi } from '$lib/api';
import WebhookEditDrawer from './WebhookEditDrawer.svelte';
const webhooksService = useService(WebhooksApi);
type EditDrawerType = 'create' | 'update';
Expand Down Expand Up @@ -31,33 +33,35 @@
</script>

<script lang="ts">
import Drawer from '../drawer/Drawer.svelte';
import Button from '../Button.svelte';
import { createMutation } from '@tanstack/svelte-query';
import { closeModal } from 'svelte-modals';
import type { SuperValidated } from 'sveltekit-superforms';
import { superForm } from 'sveltekit-superforms/client';
import {
WebhookTrigger,
WebhookResponse,
WebhookDelivery,
WebhookResponse,
type WebhookStore,
WebhookTrigger,
type WebhookUpdate
} from '$lib/api';
import { superForm } from 'sveltekit-superforms/client';
import { queryClient } from '$lib/client';
import {
type WebhookSchema,
deliveryItems,
responseItems,
triggerItems,
webhookSchema,
type WebhookSchema
webhookSchema
} from '$lib/schemas/webhook';
import TextField from '../form/TextField.svelte';
import type { SuperValidated } from 'sveltekit-superforms';
import SelectField from '../form/SelectField.svelte';
import { createMutation } from '@tanstack/svelte-query';
import { useService } from '$lib/services';
import Button from '../Button.svelte';
import MutationError from '../MutationError.svelte';
import StatusButton from '../StatusButton.svelte';
import Drawer from '../drawer/Drawer.svelte';
import SelectField from '../form/SelectField.svelte';
import TextField from '../form/TextField.svelte';
import ToggleField from '../form/ToggleField.svelte';
import { queryClient } from '$lib/client';
import MutationError from '../MutationError.svelte';
import { useService } from '$lib/services';
export let isOpen: boolean;
export let type: EditDrawerType;
Expand Down
11 changes: 6 additions & 5 deletions src/lib/components/webhooks/WebhookInfoDrawer.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script context="module" lang="ts">
import { openModal } from 'svelte-modals';
import WebhookInfoDrawer from './WebhookInfoDrawer.svelte';
export const openWebhookInfoDrawer = async (webhook: WebhookRead) => {
Expand All @@ -11,15 +12,15 @@

<script lang="ts">
import type { WebhookRead } from '$lib/api';
import Button from '$lib/components/Button.svelte';
import Drawer from '$lib/components/drawer/Drawer.svelte';
import { openWebhookEditDrawer } from './WebhookEditDrawer.svelte';
import DetailsGrid from '../details/DetailsGrid.svelte';
import DetailCard from '../details/DetailCard.svelte';
import Icon from '../Icon.svelte';
import { deliveryMap, responseMap, triggerMap } from '$lib/schemas/webhook';
import Icon from '../Icon.svelte';
import DetailCard from '../details/DetailCard.svelte';
import DetailsGrid from '../details/DetailsGrid.svelte';
import { openWebhookEditDrawer } from './WebhookEditDrawer.svelte';
export let isOpen: boolean;
export let webhook: WebhookRead;
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/webhooks/WebhookTitleCell.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import type { WebhookRead } from '$lib/api';
import { openWebhookInfoDrawer } from './WebhookInfoDrawer.svelte';
export let value: string;
Expand Down
17 changes: 9 additions & 8 deletions src/lib/components/webhooks/WebhooksTable.svelte
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<script lang="ts">
import { createRender, createTable } from 'svelte-headless-table';
import type { ReadOrWritable } from 'svelte-headless-table/lib/utils/store';
import { get, writable } from 'svelte/store';
import type {
WebhookArray,
WebhookDelivery,
WebhookResponse,
WebhookRead
WebhookRead,
WebhookResponse
} from '$lib/api';
import CrudTable from '$lib/components/table/DataTable.svelte';
import { createRender, createTable } from 'svelte-headless-table';
import { get, writable } from 'svelte/store';
import SecretTableCell from '$lib/components/table/SecretTableCell.svelte';
import Button from '$lib/components/Button.svelte';
import CrudTable from '$lib/components/table/DataTable.svelte';
import HtmlCell from '$lib/components/table/HtmlCell.svelte';
import SecretTableCell from '$lib/components/table/SecretTableCell.svelte';
import { deliveryMap, responseMap, triggerMap } from '$lib/schemas/webhook';
import { htmlEscape } from '$lib/utils/html';
import type { ReadOrWritable } from 'svelte-headless-table/lib/utils/store';
import { openWebhookEditDrawer } from './WebhookEditDrawer.svelte';
import WebhookTitleCell from './WebhookTitleCell.svelte';
import { deliveryMap, responseMap, triggerMap } from '$lib/schemas/webhook';
export let data: WebhookArray;
Expand Down
3 changes: 2 additions & 1 deletion src/lib/schemas/webhook.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { WebhookTrigger, WebhookResponse, WebhookDelivery } from '$lib/api';
import type { SelectOptionType } from 'flowbite-svelte';
import { z } from 'zod';

import { WebhookDelivery, WebhookResponse, WebhookTrigger } from '$lib/api';

export const webhookSchema = z.object({
title: z.string(),
trigger: z.nativeEnum(WebhookTrigger),
Expand Down
5 changes: 3 additions & 2 deletions src/routes/webhooks/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script lang="ts">
import { createQuery } from '@tanstack/svelte-query';
import { WebhooksApi } from '$lib/api';
import DashboardPage from '$lib/components/layout/DashboardPage.svelte';
import Section from '$lib/components/layout/Section.svelte';
import { createQuery } from '@tanstack/svelte-query';
import WebhooksTable from '$lib/components/webhooks/WebhooksTable.svelte';
import { WebhooksApi } from '$lib/api';
import { useService } from '$lib/services';
const webhooksService = useService(WebhooksApi);
Expand Down

0 comments on commit 5ba4202

Please sign in to comment.