This file contains hidden or 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
| AWS ES cluster available at http://127.0.0.1:9200 | |
| Kibana available at http://127.0.0.1:9200/_plugin/kibana/ | |
| /usr/local/lib/node_modules/aws-es-kibana/node_modules/http-proxy/lib/http-proxy/index.js:120 | |
| throw err; | |
| ^ | |
| Error: socket hang up | |
| at connResetException (internal/errors.js:609:14) | |
| at TLSSocket.socketCloseListener (_http_client.js:402:25) | |
| at TLSSocket.emit (events.js:326:22) |
This file contains hidden or 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
| import { render } from "@testing-library/react"; | |
| test("username exists", () => { | |
| const { queryByTestId } = render( | |
| <Avatar username="Timonweb" src="https://example.com/avatar.jpg" /> | |
| ); | |
| expect(queryByTestId(/username/i)).toBeTruthy(); | |
| }); |
This file contains hidden or 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
| import { render } from "@testing-library/react"; | |
| test("username doesn't exist", () => { | |
| const { queryByTestId } = render( | |
| <Avatar | |
| username="Timonweb" | |
| src="https://example.com/avatar.jpg" | |
| usernameIsHidden | |
| /> | |
| ); |
This file contains hidden or 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
| import { render } from "@testing-library/react"; | |
| test("username exists", () => { | |
| const { getByTestId } = render( | |
| <Avatar username="Timonweb" src="https://example.com/avatar.jpg" /> | |
| ); | |
| expect(getByTestId(/username/i).textContent).toBe("Timonweb"); | |
| }); |
This file contains hidden or 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
| function Avatar({ username, src, usernameIsHidden = false }) { | |
| return ( | |
| <div> | |
| <img src={src} /> | |
| {!usernameIsHidden && <h4 data-testid="username">{username}</h4>} | |
| </div> | |
| ); | |
| } |
This file contains hidden or 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
| import React, { useState, lazy, Suspense } from 'react'; | |
| import IconButton from '@material-ui/core/IconButton'; | |
| import SettingsIcon from '@material-ui/icons/Settings'; | |
| const SettingDrawer = lazy(() => import('./SettingDrawer')); | |
| // import SettingDrawer from './SettingDrawer' |
This file contains hidden or 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
Show hidden characters
| { | |
| "compilerOptions": { | |
| ... | |
| "baseUrl": "src" | |
| }, | |
| "include": ["src"] | |
| } |
This file contains hidden or 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
| <body> | |
| <link rel="stylesheet/less" type="text/css" href="/color.less" /> | |
| <noscript>You need to enable JavaScript to run this app.</noscript> | |
| <div id="root"></div> | |
| <script> | |
| window.less = { | |
| async: false, | |
| env: 'production' | |
| }; | |
| </script> |
This file contains hidden or 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
| const path = require('path'); | |
| const { generateTheme } = require('antd-theme-generator'); | |
| const options = { | |
| stylesDir: path.join(__dirname, './src/theme'), | |
| antDir: path.join(__dirname, './node_modules/antd'), | |
| varFile: path.join(__dirname, './src/theme/vars.less'), | |
| mainLessFile: path.join(__dirname, './src/theme/index.less'), | |
| themeVariables: ['@primary-color', '@layout-header-background', '@menu-dark-color', '@font-size-base'], | |
| indexFileName: 'index.html', |
This file contains hidden or 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
| const path = require('path'); | |
| const { override, fixBabelImports, addLessLoader } = require('customize-cra') | |
| const FilterWarningsPlugin = require('webpack-filter-warnings-plugin') | |
| // filter out warning to prevent CI build failing | |
| const filterWarningsPlugin = config => { | |
| config.plugins.push( | |
| new FilterWarningsPlugin({ | |
| exclude: /mini-css-extract-plugin/ |
NewerOlder