-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ui: Add storybook (#691) * build(deps): bump lodash from 4.17.15 to 4.17.19 in /ui/tests (#695) * ui: I18N for form validation (#698) * build(deps): bump lodash from 4.17.15 to 4.17.19 in /ui (#696) * telemetry: Report dashboard internal version (#709) * telemetry: Update router style (#707) *: update system report table name (#693) * build(deps): bump elliptic from 6.5.2 to 6.5.3 in /ui (#712)
- Loading branch information
1 parent
47f5de8
commit e721c4a
Showing
33 changed files
with
3,766 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# This file specifies the TiDB Dashboard internal version, which will be printed in `--version` | ||
# and UI. In release branch, changing this file will result in publishing a new version and tag. | ||
2020.07.15.1 | ||
2020.08.03.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const path = require('path') | ||
|
||
function includeMorePaths(config) { | ||
// find rule to handle *.tsx files | ||
for (const rule of config.module.rules) { | ||
for (const subRule of rule.oneOf || []) { | ||
// /\.(js|mjs|jsx|ts|tsx)$/ | ||
if (subRule.test instanceof RegExp && subRule.test.test('.tsx')) { | ||
subRule.include.push(path.resolve(__dirname, '../lib')) | ||
// although we don't care about the components inside diagnoseReportApp | ||
// but it can't pass compile if we don't add it to the rule.include | ||
subRule.include.push(path.resolve(__dirname, '../diagnoseReportApp')) | ||
break | ||
} | ||
} | ||
} | ||
|
||
return config | ||
} | ||
|
||
// ref: https://harrietryder.co.uk/blog/storybook-with-typscript-customize-cra/ | ||
const custom = require('../config-overrides') | ||
|
||
module.exports = { | ||
stories: ['../lib/components/**/*.stories.@(ts|tsx|js|jsx)'], | ||
addons: [ | ||
'@storybook/preset-create-react-app', | ||
'@storybook/addon-actions', | ||
'@storybook/addon-links', | ||
], | ||
webpackFinal: (storybookConfig) => { | ||
const customConfig = custom(storybookConfig) | ||
const newConfigs = { | ||
...storybookConfig, | ||
module: { ...storybookConfig.module, rules: customConfig.module.rules }, | ||
} | ||
return includeMorePaths(newConfigs) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React, { useEffect } from 'react' | ||
import { addDecorator } from '@storybook/react' | ||
import { Root } from '@lib/components' | ||
import client from '@lib/client' | ||
import * as apiClient from '@lib/utils/apiClient' | ||
import * as auth from '@lib/utils/auth' | ||
|
||
function StoryRoot({ children }) { | ||
useEffect(() => { | ||
apiClient.init() | ||
client | ||
.getInstance() | ||
.userLoginPost({ | ||
username: 'root', | ||
password: '', | ||
is_tidb_auth: true, | ||
}) | ||
.then((r) => auth.setAuthToken(r.data.token)) | ||
}, []) | ||
|
||
return <Root>{children}</Root> | ||
} | ||
|
||
addDecorator((storyFn) => <StoryRoot>{storyFn()}</StoryRoot>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.