Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#133): Previewing private queries doesnt work #138

Merged
merged 21 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3b666e1
Merge pull request #120 from sametcodes/develop
sametcodes Apr 7, 2023
ed95057
docs: updated readme for contributors
sametcodes Apr 7, 2023
3dde857
Merge pull request #123 from sametcodes/develop
sametcodes Apr 7, 2023
791e6c6
docs: updated readme for sponsors view
sametcodes Apr 7, 2023
ba3cdf1
docs: updated readme for contributors
sametcodes Apr 7, 2023
c5007e7
Merge pull request #131 from sametcodes/develop
sametcodes Apr 8, 2023
7d3bed2
Merge pull request #132 from sametcodes/develop
sametcodes Apr 8, 2023
0bd6fd4
docs: updated for recent projects and languages
sametcodes Apr 8, 2023
1914ec3
style(#78): add storybook on project
zehraworks Apr 9, 2023
0b6e56e
Merge branch 'develop' into 78-stories-for-dsvgui
sametcodes Apr 9, 2023
5008773
config: added eslint storybook plugin
sametcodes Apr 9, 2023
1ea287f
fix: replaced unstable function
sametcodes Apr 9, 2023
3aaee4a
docs(#78): moved storybook and deps to @dsvgui package
sametcodes Apr 9, 2023
870c72c
config: set storybook deps as main deps
sametcodes Apr 9, 2023
1aa7c12
config: removed build:staging command
sametcodes Apr 9, 2023
3eb5b38
config: ignored stories, test and specs for builds
sametcodes Apr 9, 2023
ed3bc45
config: replaced custom rule to ignore plugin
sametcodes Apr 9, 2023
b366d46
config: added @storybook/react to main deps
sametcodes Apr 9, 2023
2190711
Merge branch '78-stories-for-dsvgui' into 133-previewing-on-private-q…
sametcodes Apr 10, 2023
a9fbb6a
refactor: removed non-used validations
sametcodes Apr 10, 2023
05acbbd
fix(#133): the issue with previewing private queries
sametcodes Apr 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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