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

[chore]: Update code and configurations for various improvements and bug fixes. #4

Merged
merged 1 commit into from
Oct 20, 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
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request:
branches: [main, main-ee, release*, 'temporary/**']
branches: [main, 'main-ee', release*, 'temporary/**']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
cache-and-install:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"

steps:
- name: Checkout
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"vite-plugin-conditional-compile": "^1.3.4",
"vite-plugin-dynamic-base": "^0.4.8",
"vite-plugin-eslint": "^1.6.1",
"@ant-design/plots": "^1.2.5"
"vite-plugin-html": "^3.2.0"
},
"dependencies": {
"@ant-design/cssinjs": "^1.17.0",
Expand Down Expand Up @@ -101,7 +101,8 @@
"react-i18next": "^11.18.6",
"react-redux": "^8.0.5",
"react-router-dom": "^6.3.0",
"recoil": "^0.7.4"
"recoil": "^0.7.4",
"@ant-design/plots": "^1.2.5"
},
"resolutions": {
"headers-polyfill": "3.0.10"
Expand Down
2 changes: 1 addition & 1 deletion packages/base/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Action DMS</title>
<title><%= title %></title>
<link
id="light-theme"
rel="stylesheet"
Expand Down
1 change: 1 addition & 0 deletions packages/base/src/page/Member/components/MemberList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const MemberList: React.FC = () => {
<>
{contextHolder}
<ActiontechTable
rowKey="uid"
dataSource={memberList?.list}
pagination={{
total: memberList?.total ?? 0
Expand Down
10 changes: 6 additions & 4 deletions packages/base/src/page/SyncDataSource/SyncTaskList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ const SyncTaskList: React.FC = () => {
const navigate = useNavigate();
const { requestErrorMessage, handleTableRequestError } =
useTableRequestError();
const [messageApi, contextHoler] = message.useMessage();

const syncAction = (taskId: string) => {
const hideLoading = message.loading(
const hideLoading = messageApi.loading(
t('dmsSyncDataSource.syncTaskList.syncTaskLoading')
);
dms
Expand All @@ -32,7 +33,7 @@ const SyncTaskList: React.FC = () => {
})
.then((res) => {
if (res.data.code === ResponseCode.SUCCESS) {
message.success(
messageApi.success(
t('dmsSyncDataSource.syncTaskList.syncTaskSuccessTips')
);
}
Expand All @@ -43,7 +44,7 @@ const SyncTaskList: React.FC = () => {
});
};
const deleteAction = (taskId: string) => {
const hideLoading = message.loading(
const hideLoading = messageApi.loading(
t('dmsSyncDataSource.syncTaskList.deleteTaskLoading')
);
dms
Expand All @@ -53,7 +54,7 @@ const SyncTaskList: React.FC = () => {
})
.then((res) => {
if (res.data.code === ResponseCode.SUCCESS) {
message.success(
messageApi.success(
t('dmsSyncDataSource.syncTaskList.deleteTaskSuccessTips')
);
refresh();
Expand All @@ -78,6 +79,7 @@ const SyncTaskList: React.FC = () => {

return (
<>
{contextHoler}
<PageHeader
title={
<Space>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const UpdateSyncTask: React.FC = () => {
const [syncInstanceTask, setSyncInstanceTask] = useState<
IListDatabaseSourceService | undefined
>();
const [messageApi, contextHoler] = message.useMessage();

const submit = async () => {
const values: SyncTaskFormFields = await form.validateFields();
Expand All @@ -58,7 +59,7 @@ const UpdateSyncTask: React.FC = () => {
.UpdateDatabaseSourceService(params)
.then((res) => {
if (res.data.code === ResponseCode.SUCCESS) {
message.success(t('dmsSyncDataSource.updateSyncTask.successTips'));
messageApi.success(t('dmsSyncDataSource.updateSyncTask.successTips'));
navigate(`/project/${projectID}/syncDataSource`, { replace: true });
}
})
Expand Down Expand Up @@ -99,6 +100,7 @@ const UpdateSyncTask: React.FC = () => {

return (
<PageLayoutHasFixedHeaderStyleWrapper>
{contextHoler}
<PageHeader
fixed
title={
Expand Down
48 changes: 26 additions & 22 deletions packages/base/src/page/UserCenter/Role/RoleList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const RoleList: React.FC = () => {
const { t } = useTranslation();
const dispatch = useDispatch();
const [refreshFlag, { toggle: toggleRefreshFlag }] = useToggle(false);
const [messageApi, contextHoler] = message.useMessage();

const getRoleList = ({ current, pageSize }: TablePaginationProps) => {
const params: IListRolesParams = {
Expand Down Expand Up @@ -60,7 +61,7 @@ const RoleList: React.FC = () => {
);
};
const deleteRole = (roleName: string, roleUid: string) => {
const hideLoading = message.loading(
const hideLoading = messageApi.loading(
t('dmsUserCenter.role.deleteRole.deleting', { name: roleName }),
0
);
Expand All @@ -70,7 +71,7 @@ const RoleList: React.FC = () => {
})
.then((res) => {
if (res.data.code === ResponseCode.SUCCESS) {
message.success(
messageApi.success(
t('dmsUserCenter.role.deleteRole.deleteSuccessTips', {
name: roleName
})
Expand All @@ -96,27 +97,30 @@ const RoleList: React.FC = () => {
}, [toggleRefreshFlag]);

return (
<Card
title={
<Space>
{t('dmsUserCenter.role.roleList.title')}
<Button onClick={toggleRefreshFlag}>
<SyncOutlined spin={tableProps.loading} />
<>
{contextHoler}
<Card
title={
<Space>
{t('dmsUserCenter.role.roleList.title')}
<Button onClick={toggleRefreshFlag}>
<SyncOutlined spin={tableProps.loading} />
</Button>
</Space>
}
extra={[
<Button key="create-role" type="primary" onClick={createRole}>
{t('dmsUserCenter.role.createRole.button')}
</Button>
</Space>
}
extra={[
<Button key="create-role" type="primary" onClick={createRole}>
{t('dmsUserCenter.role.createRole.button')}
</Button>
]}
>
<Table
rowKey="uid"
columns={tableHeaderFactory(updateRole, deleteRole)}
{...tableProps}
/>
</Card>
]}
>
<Table
rowKey="uid"
columns={tableHeaderFactory(updateRole, deleteRole)}
{...tableProps}
/>
</Card>
</>
);
};

Expand Down
51 changes: 29 additions & 22 deletions packages/base/src/page/UserCenter/User/UserGroupList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const UserGroupList: React.FC = () => {
const { t } = useTranslation();
const dispatch = useDispatch();
const [refreshFlag, { toggle: toggleRefreshFlag }] = useToggle(false);
const [messageApi, contextHoler] = message.useMessage();

const getUserGroupList = ({ current, pageSize }: TablePaginationProps) => {
const params: IListUserGroupsParams = {
Expand Down Expand Up @@ -68,7 +69,7 @@ const UserGroupList: React.FC = () => {
userGroupName: string,
userGroupUid: string
) => {
const hideLoading = message.loading(
const hideLoading = messageApi.loading(
t('dmsUserCenter.user.deleteUserGroup.deleting', { name: userGroupName }),
0
);
Expand All @@ -77,7 +78,7 @@ const UserGroupList: React.FC = () => {
user_group_uid: userGroupUid
});
if (res.data.code === ResponseCode.SUCCESS) {
message.success(
messageApi.success(
t('dmsUserCenter.user.deleteUserGroup.deleteSuccess', {
name: userGroupName
})
Expand All @@ -104,27 +105,33 @@ const UserGroupList: React.FC = () => {
}, [toggleRefreshFlag]);

return (
<Card
title={
<Space>
{t('dmsUserCenter.user.userGroupList.title')}
<Button onClick={toggleRefreshFlag}>
<SyncOutlined spin={tableProps.loading} />
<>
{contextHoler}
<Card
title={
<Space>
{t('dmsUserCenter.user.userGroupList.title')}
<Button onClick={toggleRefreshFlag}>
<SyncOutlined spin={tableProps.loading} />
</Button>
</Space>
}
extra={[
<Button key="create-user" type="primary" onClick={addUserGroup}>
{t('dmsUserCenter.user.userGroupList.addUserGroupButton')}
</Button>
</Space>
}
extra={[
<Button key="create-user" type="primary" onClick={addUserGroup}>
{t('dmsUserCenter.user.userGroupList.addUserGroupButton')}
</Button>
]}
>
<Table
rowKey="uid"
columns={userGroupTableHeaderFactory(updateUserGroup, deleteUserGroup)}
{...tableProps}
/>
</Card>
]}
>
<Table
rowKey="uid"
columns={userGroupTableHeaderFactory(
updateUserGroup,
deleteUserGroup
)}
{...tableProps}
/>
</Card>
</>
);
};

Expand Down
48 changes: 26 additions & 22 deletions packages/base/src/page/UserCenter/User/UserList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const UserList: React.FC = () => {
const { t } = useTranslation();
const dispatch = useDispatch();
const [refreshFlag, { toggle: toggleRefreshFlag }] = useToggle(false);
const [messageApi, contextHoler] = message.useMessage();

const getUserList = ({ current, pageSize }: TablePaginationProps) => {
const params: IListUsersParams = {
Expand Down Expand Up @@ -67,15 +68,15 @@ const UserList: React.FC = () => {
);

const removeUser = (username: string, userUid: string) => {
const hideLoading = message.loading(
const hideLoading = messageApi.loading(
t('dmsUserCenter.user.deleteUser.deleting', { username }),
0
);
dms
.DelUser({ user_uid: userUid })
.then((res) => {
if (res.data.code === ResponseCode.SUCCESS) {
message.success(
messageApi.success(
t('dmsUserCenter.user.deleteUser.deleteSuccess', { username })
);
toggleRefreshFlag();
Expand All @@ -98,27 +99,30 @@ const UserList: React.FC = () => {
}, [toggleRefreshFlag]);

return (
<Card
title={
<Space>
{t('dmsUserCenter.user.userList.title')}
<Button onClick={toggleRefreshFlag}>
<SyncOutlined spin={tableProps.loading} />
<>
{contextHoler}
<Card
title={
<Space>
{t('dmsUserCenter.user.userList.title')}
<Button onClick={toggleRefreshFlag}>
<SyncOutlined spin={tableProps.loading} />
</Button>
</Space>
}
extra={[
<Button key="create-user" type="primary" onClick={addUser}>
{t('dmsUserCenter.user.userList.addUserButton')}
</Button>
</Space>
}
extra={[
<Button key="create-user" type="primary" onClick={addUser}>
{t('dmsUserCenter.user.userList.addUserButton')}
</Button>
]}
>
<Table
rowKey="uid"
columns={tableHeaderFactory(updateUser, removeUser)}
{...tableProps}
/>
</Card>
]}
>
<Table
rowKey="uid"
columns={tableHeaderFactory(updateUser, removeUser)}
{...tableProps}
/>
</Card>
</>
);
};

Expand Down
1 change: 1 addition & 0 deletions packages/base/src/page/UserCenter/components/UserList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const UserList: React.FC = () => {
<>
{contextHolder}
<ActiontechTable
rowKey="uid"
dataSource={userList?.list}
pagination={{
total: userList?.total ?? 0
Expand Down
Loading
Loading