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

refactor(config-ui): remove blueprintjs #6659

Merged
merged 6 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 config-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The **Config-UI Application** is a **React.js** SPA (Single-Page-Application) th
#### Technology / Stack Overview

- React
- Blueprint
- Antd
- Vite
- TypeScript
- Yarn3
Expand Down
20 changes: 8 additions & 12 deletions config-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
"dependencies": {
"@ahooksjs/use-url-state": "^3.5.1",
"@ant-design/icons": "^5.2.6",
"@blueprintjs/core": "^5.3.0",
"@blueprintjs/datetime2": "^1.0.10",
"@blueprintjs/popover2": "^2.0.10",
"@blueprintjs/select": "^5.0.10",
"@reduxjs/toolkit": "^1.9.7",
"ahooks": "^3.7.8",
"antd": "^5.11.1",
Expand All @@ -46,28 +42,28 @@
"react-router-dom": "^6.14.1",
"react-transition-group": "^4.4.5",
"redux": "^4.2.1",
"styled-components": "^5.3.6"
"styled-components": "^6.1.1"
},
"devDependencies": {
"@types/file-saver": "^2.0.5",
"@types/node": "^18.15.1",
"@types/react": "^18.0.24",
"@types/react": "^17.0.73",
"@types/react-copy-to-clipboard": "^5.0.4",
"@types/react-dom": "^18.0.10",
"@types/react-dom": "^17.0.25",
"@types/react-router-dom": "^5.3.3",
"@types/react-transition-group": "^4.4.6",
"@types/styled-components": "^5.1.26",
"@types/styled-components": "^5.1.34",
"@vitejs/plugin-react": "^3.1.0",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.10.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.0",
"lint-staged": "^13.1.0",
"prettier": "^2.7.1",
"typescript": "^4.9.4",
"vite": "^4.2.3",
"typescript": "^4.9.5",
"vite": "^4.5.1",
"vite-plugin-svgr": "^4.2.0"
}
}
2 changes: 1 addition & 1 deletion config-ui/src/components/action/copy-text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const CopyText = ({ content }: Props) => {
{content}
</TextTooltip>
<CopyToClipboard text={content} onCopy={() => message.success('Copy successfully.')}>
<Button icon={<CopyOutlined rev={undefined} />} />
<Button icon={<CopyOutlined />} />
</CopyToClipboard>
</Wrapper>
);
Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/components/message/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface Props {
export const Message = ({ style, size = 20, content }: Props) => {
return (
<Wrapper style={style}>
<WarningOutlined rev={undefined} size={size} color="#f4be55" />
<WarningOutlined size={size} color="#f4be55" />
<span>{content}</span>
</Wrapper>
);
Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/components/page-header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const PageHeader = ({ breadcrumbs, extra, children }: Props) => {
{breadcrumbs.length !== i + 1 ? (
<Link to={path}>
{name}
<RightOutlined rev={undefined} />
<RightOutlined />
</Link>
) : (
<span>{name}</span>
Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/components/tooltip/help-tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const HelpTooltip = ({ content, style }: Props) => {
return (
<Wrapper style={style}>
<Tooltip title={content} placement="top">
<QuestionCircleOutlined rev={undefined} />
<QuestionCircleOutlined />
</Tooltip>
</Wrapper>
);
Expand Down
7 changes: 0 additions & 7 deletions config-ui/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
*
*/

@import 'normalize.css';
@import '@blueprintjs/core/lib/css/blueprint.css';
@import '@blueprintjs/icons/lib/css/blueprint-icons.css';
@import '@blueprintjs/select/lib/css/blueprint-select.css';
@import '@blueprintjs/popover2/lib/css/blueprint-popover2.css';
@import '@blueprintjs/datetime/lib/css/blueprint-datetime.css';

body {
color: #292b3f;
}
Expand Down
6 changes: 3 additions & 3 deletions config-ui/src/pages/blueprint/connection-detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,19 @@ export const BlueprintConnectionDetailPage = () => {
okText="Confirm"
onConfirm={handleRemoveConnection}
>
<Button type="primary" danger icon={<DeleteOutlined rev={undefined} />}>
<Button type="primary" danger icon={<DeleteOutlined />}>
Remove this Connection
</Button>
</Popconfirm>
</S.Top>
<Flex vertical gap="middle">
<Flex>
<Button type="primary" icon={<FormOutlined rev={undefined} />} onClick={handleShowDataScope}>
<Button type="primary" icon={<FormOutlined />} onClick={handleShowDataScope}>
Manage Data Scope
</Button>
{pluginConfig.scopeConfig && (
<ExternalLink style={{ marginLeft: 8 }} link={`/connections/${connection.plugin}/${connection.id}`}>
<Button type="primary" icon={<FormOutlined rev={undefined} />}>
<Button type="primary" icon={<FormOutlined />}>
Edit Scope Config
</Button>
</ExternalLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ export const AdvancedEditor = ({ value, onChange }: Props) => {
</p>
<Input.TextArea rows={6} value={value} onChange={(e) => onChange(e.target.value)} />
<Space>
<Button
size="small"
icon={<ClearOutlined rev={undefined} />}
onClick={() => onChange(JSON.stringify([[]], null, ' '))}
>
<Button size="small" icon={<ClearOutlined />} onClick={() => onChange(JSON.stringify([[]], null, ' '))}>
Reset
</Button>
<Dropdown
Expand All @@ -88,7 +84,7 @@ export const AdvancedEditor = ({ value, onChange }: Props) => {
},
}}
>
<Button size="small" icon={<CaretDownOutlined rev={undefined} />}>
<Button size="small" icon={<CaretDownOutlined />}>
Load Templates
</Button>
</Dropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export const SyncPolicy = ({
</div>

<div className="time-selection">
{/* @ts-ignore */}
<DatePicker
value={timeAfter ? dayjs(timeAfter) : null}
placeholder="Select start from"
Expand Down
8 changes: 4 additions & 4 deletions config-ui/src/pages/blueprint/detail/configuration-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ export const ConfigurationPanel = ({ from, blueprint, onRefresh, onChangeTab }:
<h3>Blueprint Name</h3>
<Space>
<span>{blueprint.name}</span>
<Button type="primary" icon={<FormOutlined rev={undefined} />} onClick={handleShowNameDialog} />
<Button type="primary" icon={<FormOutlined />} onClick={handleShowNameDialog} />
</Space>
</div>
<div className="block">
<h3>
<Space>
<span>Sync Policy</span>
<Button type="primary" icon={<FormOutlined rev={undefined} />} onClick={handleShowPolicyDialog} />
<Button type="primary" icon={<FormOutlined />} onClick={handleShowPolicyDialog} />
</Space>
</h3>
<Table
Expand Down Expand Up @@ -188,15 +188,15 @@ export const ConfigurationPanel = ({ from, blueprint, onRefresh, onChangeTab }:
</>
}
action={
<Button type="primary" icon={<PlusOutlined rev={undefined} />} onClick={handleShowAddConnectionDialog}>
<Button type="primary" icon={<PlusOutlined />} onClick={handleShowAddConnectionDialog}>
Add a Connection
</Button>
}
/>
) : (
<Flex vertical gap="middle">
<Flex>
<Button type="primary" icon={<PlusOutlined rev={undefined} />} onClick={handleShowAddConnectionDialog}>
<Button type="primary" icon={<PlusOutlined />} onClick={handleShowAddConnectionDialog}>
Add a Connection
</Button>
</Flex>
Expand Down
4 changes: 2 additions & 2 deletions config-ui/src/pages/blueprint/detail/status-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const StatusPanel = ({ from, blueprint, pipelineId, onRefresh }: Props) =
},
}}
>
<Button icon={<MoreOutlined rev={undefined} />} />
<Button icon={<MoreOutlined />} />
</Dropdown>
</S.ProjectACtion>
)}
Expand All @@ -178,7 +178,7 @@ export const StatusPanel = ({ from, blueprint, pipelineId, onRefresh }: Props) =
type="primary"
loading={operating}
disabled={!!blueprint.projectName}
icon={<DeleteOutlined rev={undefined} />}
icon={<DeleteOutlined />}
onClick={() => setType('delete')}
/>
</Tooltip>
Expand Down
4 changes: 2 additions & 2 deletions config-ui/src/pages/blueprint/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const BlueprintHomePage = () => {
</Radio>
))}
</Radio.Group>
<Button type="primary" icon={<PlusOutlined rev={undefined} />} onClick={handleShowDialog}>
<Button type="primary" icon={<PlusOutlined />} onClick={handleShowDialog}>
New Blueprint
</Button>
</Flex>
Expand Down Expand Up @@ -193,7 +193,7 @@ export const BlueprintHomePage = () => {
align: 'center',
render: (val) => (
<Link to={`/advanced/blueprints/${val}?tab=configuration`}>
<Button type="primary" icon={<SettingOutlined rev={undefined} />} />
<Button type="primary" icon={<SettingOutlined />} />
</Link>
),
},
Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/pages/project/detail/settings-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const SettingsPanel = ({ project, onRefresh }: Props) => {
onOk={handleDelete}
>
<S.DialogBody>
<WarningOutlined rev={undefined} />
<WarningOutlined />
<span>
This operation cannot be undone. Deleting a Data Connection will delete all data that have been collected in
this Connection.
Expand Down
2 changes: 1 addition & 1 deletion config-ui/src/pages/project/detail/webhooks-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const WebhooksPanel = ({ project, onRefresh }: Props) => {
text="Push `incidents` or `deployments` from your tools by incoming webhooks."
action={
<>
<Button type="primary" icon={<PlusOutlined rev={undefined} />} onClick={() => setType('create')}>
<Button type="primary" icon={<PlusOutlined />} onClick={() => setType('create')}>
Add a Webhook
</Button>
<div style={{ margin: '8px 0' }}>or</div>
Expand Down
4 changes: 2 additions & 2 deletions config-ui/src/pages/project/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const ProjectHomePage = () => {
<PageHeader
breadcrumbs={[{ name: 'Projects', path: '/projects' }]}
extra={
<Button type="primary" icon={<PlusOutlined rev={undefined} />} onClick={handleShowDialog}>
<Button type="primary" icon={<PlusOutlined />} onClick={handleShowDialog}>
New Project
</Button>
}
Expand Down Expand Up @@ -193,7 +193,7 @@ export const ProjectHomePage = () => {
render: (name: any) => (
<Button
type="primary"
icon={<SettingOutlined rev={undefined} />}
icon={<SettingOutlined />}
onClick={() => navigate(`/projects/${encodeName(name)}?tab=configuration`)}
/>
),
Expand Down
10 changes: 3 additions & 7 deletions config-ui/src/plugins/components/connection-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,10 @@ export const ConnectionList = ({ plugin, onCreate }: Props) => {
width: 200,
render: (_, { plugin, id }) => (
<>
<Button
type="link"
icon={<EyeOutlined rev={undefined} />}
onClick={() => navigate(`/connections/${plugin}/${id}`)}
>
<Button type="link" icon={<EyeOutlined />} onClick={() => navigate(`/connections/${plugin}/${id}`)}>
Details
</Button>
<Button type="link" icon={<EditOutlined rev={undefined} />} onClick={() => handleShowForm(id)}>
<Button type="link" icon={<EditOutlined />} onClick={() => handleShowForm(id)}>
Edit
</Button>
</>
Expand All @@ -116,7 +112,7 @@ export const ConnectionList = ({ plugin, onCreate }: Props) => {
dataSource={connections}
pagination={false}
/>
<Button style={{ marginTop: 16 }} type="primary" icon={<PlusOutlined rev={undefined} />} onClick={onCreate}>
<Button style={{ marginTop: 16 }} type="primary" icon={<PlusOutlined />} onClick={onCreate}>
Create a New Connection
</Button>
<Modal
Expand Down
6 changes: 1 addition & 5 deletions config-ui/src/plugins/components/connection-status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ export const ConnectionStatus = ({ connection }: Props) => {
<Wrapper>
<span className={status}>{STATUS_MAP[status]}</span>
{status !== IConnectionStatus.ONLINE && (
<Button
loading={status === IConnectionStatus.TESTING}
icon={<RedoOutlined rev={undefined} />}
onClick={handleTest}
/>
<Button loading={status === IConnectionStatus.TESTING} icon={<RedoOutlined />} onClick={handleTest} />
)}
</Wrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const SearchLocal = ({ plugin, connectionId, config, disabledScope, selec

{status === 'loaded' && (
<S.JobLoad>
<CheckCircleFilled style={{ color: '#4DB764' }} rev={undefined} />
<CheckCircleFilled style={{ color: '#4DB764' }} />
<span className="count">{miller.items.length}</span> scopes found
</S.JobLoad>
)}
Expand All @@ -232,7 +232,7 @@ export const SearchLocal = ({ plugin, connectionId, config, disabledScope, selec
</Form.Item>
<Form.Item>
{status === 'loaded' && (
<Input prefix={<SearchOutlined rev={undefined} />} value={query} onChange={(e) => setQuery(e.target.value)} />
<Input prefix={<SearchOutlined />} value={query} onChange={(e) => setQuery(e.target.value)} />
)}
<MillerColumnsSelect
items={scopes}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const SearchRemote = ({ plugin, connectionId, config, disabledScope, sele
</Form.Item>
<Form.Item>
<Input
prefix={<SearchOutlined rev={undefined} />}
prefix={<SearchOutlined />}
placeholder={config.searchPlaceholder ?? 'Search'}
value={search.query}
onChange={(e) => setSearch({ ...search, query: e.target.value })}
Expand Down
4 changes: 2 additions & 2 deletions config-ui/src/plugins/components/data-scope-select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const DataScopeSelect = ({
/>
) : (
<Flex>
<Button type="primary" icon={<RedoOutlined rev={undefined} />}>
<Button type="primary" icon={<RedoOutlined />}>
Refresh Data Scope
</Button>
</Flex>
Expand Down Expand Up @@ -164,7 +164,7 @@ export const DataScopeSelect = ({
) : (
<Flex>
<ExternalLink link={`/connections/${plugin}/${connectionId}`}>
<Button type="primary" icon={<PlusOutlined rev={undefined} />}>
<Button type="primary" icon={<PlusOutlined />}>
Add Data Scope
</Button>
</ExternalLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const ScopeConfigSelect = ({ plugin, connectionId, scopeConfigId, onCance
return (
<Flex vertical gap="middle">
<Flex>
<Button type="primary" icon={<PlusOutlined rev={undefined} />} onClick={handleShowDialog}>
<Button type="primary" icon={<PlusOutlined />} onClick={handleShowDialog}>
Add New Scope Config
</Button>
</Flex>
Expand All @@ -89,9 +89,7 @@ export const ScopeConfigSelect = ({ plugin, connectionId, scopeConfigId, onCance
key: 'id',
width: 100,
render: (id) =>
id !== 'None' ? (
<Button type="link" icon={<EditOutlined rev={undefined} />} onClick={() => handleUpdate(id)} />
) : null,
id !== 'None' ? <Button type="link" icon={<EditOutlined />} onClick={() => handleUpdate(id)} /> : null,
},
]}
dataSource={dataSource}
Expand Down
Loading
Loading