Skip to content

Commit

Permalink
Merge pull request #138 from sametcodes/133-previewing-on-private-que…
Browse files Browse the repository at this point in the history
…ries-doesnt-work

fix(#133): Previewing private queries doesnt work
  • Loading branch information
sametcodes authored Apr 10, 2023
2 parents a5a84b0 + 05acbbd commit 48b2763
Show file tree
Hide file tree
Showing 17 changed files with 18,087 additions and 2,068 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"jsx": true
}
}
}
}
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ _All your statistics at once._
![](https://readme.rocks/api/view/642dfbff39f5d6e5e5f45c3b)
![](https://readme.rocks/api/view?queryConfig%5Busername%5D=sametcodes&id=641b2efa3e90e7e555cdacd7)

## Recent projects and used languages

![](https://readme.rocks/api/view/6431b08616981eaebfd030f9)
![](https://readme.rocks/api/view/6431b559ddde9c1558a16fe6)

## Line stats
![](https://readme.rocks/api/view/642220d0c3f0ffcbcafd573f)

## Your latest `daily.dev` and `dev.to` articles
<img align="left" src="https://readme.rocks/api/view?queryConfig%5Busername%5D=honeypot&queryConfig%5Bcount%5D=3&id=641cd30dbe50187858f7d61a" width="48%" />
<img src="https://readme.rocks/api/view?queryConfig%5Busername%5D=isaacdlyman&queryConfig%5Bcount%5D=2&id=641c6e78c50c62ccdb646278" width="48%" />
<br clear="left"/>

<img src="https://readme.rocks/api/view?queryConfig%5Busername%5D=honeypot&queryConfig%5Bcount%5D=3&id=641cd30dbe50187858f7d61a" />
<img src="https://readme.rocks/api/view?queryConfig%5Busername%5D=isaacdlyman&queryConfig%5Bcount%5D=2&id=641c6e78c50c62ccdb646278" />

## Contributors

<img width="700" src="https://readme.rocks/api/view?queryConfig%5Bowner_name%5D=facebook&queryConfig%5Brepository_name%5D=react&viewConfig%5Btitle%5D=Our%20contributors&viewConfig%5Bsubtitle%5D=Thank%20you%20for%20all%20your%20contributions.%20We%20appreciate%20that.&viewConfig%5Bitems_per_row%5D=15&id=642f70a3104ae4fd80d6efac" />

## Milestones

Expand All @@ -26,6 +35,8 @@ _All your statistics at once._
<img src="https://readme.rocks/api/view?queryConfig%5Busername%5D=d-fischer&id=64248c899d4315a82e3cb3f7" />
</a>

<img width="700" src="https://readme.rocks/api/view?queryConfig%5Busername%5D=ljharb&viewConfig%5Btitle%5D=My%20sponsors&viewConfig%5Bsubtitle%5D=Thank%20you%20for%20sponsoring%20me.&viewConfig%5Bitems_per_row%5D=15&id=64300f9e4160c69275201776" />

### Running locally

Make sure you install the dependencies first.
Expand Down
4 changes: 3 additions & 1 deletion components/form/private.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ export default function PrivateConfigForm({
];

const formDataValues = { ...(query || {}), ...(view || {}) };
schema.validateSync(formDataValues, { abortEarly: false });
if (Object.keys(formDataValues).length === 0)
return { queryConfig: query || {}, viewConfig: view || {} };

schema.validateSync(formDataValues, { abortEarly: false });
return {
queryConfig: query || {},
viewConfig: view || {},
Expand Down
2 changes: 2 additions & 0 deletions components/form/public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export default function PublicConfigForm({
];

const formDataValues = { ...(query || {}), ...(view || {}) };
if (Object.keys(formDataValues).length === 0)
return { queryConfig: query || {}, viewConfig: view || {} };
const validations = [queryValidation, viewValidation].filter(Boolean);
const schema = mergeSchemas(...validations);
schema.validateSync(formDataValues, { abortEarly: false });
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ declare module "next-auth" {

// change unstable_getServerSession returning type
declare module "next-auth/next" {
export function unstable_getServerSession(
export function getServerSession(
...args: Parameters<typeof getServerSession>
): Promise<Session | null>;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/@dsvgui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
storybook-static
19 changes: 19 additions & 0 deletions lib/@dsvgui/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import path from "path";

/** @type { import('@storybook/nextjs').StorybookConfig } */
const config = {
stories: ["../components/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/nextjs",
options: {},
},
docs: {
autodocs: "tag",
},
};
export default config;
14 changes: 14 additions & 0 deletions lib/@dsvgui/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type { import('@storybook/react').Preview } */
const preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
16 changes: 16 additions & 0 deletions lib/@dsvgui/components/fallback/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Meta, StoryObj } from "@storybook/react";
import { Fallback } from "./index";

const meta: Meta<typeof Fallback> = {
title: "Fallback",
component: Fallback,
};
export default meta;

type Story = StoryObj<typeof Fallback>;

export const Warning: Story = {
render: () => (
<Fallback title="Fallback" message="This is a fallback component" />
),
};
2 changes: 1 addition & 1 deletion lib/@dsvgui/components/fallback/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export const Fallback: React.FC<IFallback> = ({ title, message }) => {
<path
className="icon"
xmlns="http://www.w3.org/2000/svg"
d="M52.95 36.3464C52.3 34.9719 49.9167 34.9719 49.0501 36.3464L29.55 69.7266C29.3564 70.03 29.256 70.3748 29.2591 70.7253C29.2622 71.0758 29.3688 71.4192 29.5678 71.7197C29.7668 72.0203 30.0509 72.2671 30.3907 72.4345C30.7305 72.6019 31.1135 72.6839 31.5 72.6719H70.5001C70.8866 72.6839 71.2696 72.6019 71.6094 72.4345C71.9492 72.2671 72.2333 72.0203 72.4323 71.7197C72.6313 71.4192 72.7379 71.0758 72.741 70.7253C72.7441 70.3748 72.6437 70.03 72.4501 69.7266L52.95 36.3464ZM53.1667 66.7812H48.8334V62.8542H53.1667V66.7812ZM48.8334 58.9271V49.1094H53.1667V58.9271H48.8334Z"
fill="#646464"
d="M52.95 36.3464C52.3 34.9719 49.9167 34.9719 49.0501 36.3464L29.55 69.7266C29.3564 70.03 29.256 70.3748 29.2591 70.7253C29.2622 71.0758 29.3688 71.4192 29.5678 71.7197C29.7668 72.0203 30.0509 72.2671 30.3907 72.4345C30.7305 72.6019 31.1135 72.6839 31.5 72.6719H70.5001C70.8866 72.6839 71.2696 72.6019 71.6094 72.4345C71.9492 72.2671 72.2333 72.0203 72.4323 71.7197C72.6313 71.4192 72.7379 71.0758 72.741 70.7253C72.7441 70.3748 72.6437 70.03 72.4501 69.7266L52.95 36.3464ZM53.1667 66.7812H48.8334V62.8542H53.1667V66.7812ZM48.8334 58.9271V49.1094H53.1667V58.9271H48.8334Z"
/>
<text
fill="#646464"
Expand Down
Loading

0 comments on commit 48b2763

Please sign in to comment.