Skip to content

Commit

Permalink
Merge pull request #11 from actiontech/fix/modify-rejected-order
Browse files Browse the repository at this point in the history
[fix]: Order creator is unable to modify SQL statements.
  • Loading branch information
Rain-1214 authored Oct 20, 2023
2 parents 0b60f95 + 01402c8 commit a8c9f39
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
5 changes: 4 additions & 1 deletion packages/base/src/page/Project/Detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ const ProjectDetail: React.FC = () => {
/* FITRUE_isCE */

return (
<EmptyBox if={projectDetailFetched} defaultNode={<HeaderProgress />}>
<EmptyBox
if={projectDetailFetched || !nextProjectID}
defaultNode={<HeaderProgress />}
>
{/* IFTRUE_isEE */}
{renderProjectDetail()}
{/* FITRUE_isEE */}
Expand Down
12 changes: 8 additions & 4 deletions packages/base/src/page/Project/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BasicButton, PageHeader } from '@actiontech/shared';
import { BasicButton, EmptyBox, PageHeader } from '@actiontech/shared';
import { TableRefreshButton } from '@actiontech/shared/lib/components/ActiontechTable';
import { Space } from 'antd5';
import { useTranslation } from 'react-i18next';
Expand All @@ -10,9 +10,11 @@ import { updateProjectModalStatus } from '../../store/project';
import { ModalName } from '../../data/ModalName';
import ProjectManageModal from './Modal';
import { ProjectListStyledWrapper } from './style';
import { useCurrentUser } from '@actiontech/shared/lib/global';

const Project: React.FC = () => {
const { t } = useTranslation();
const { isAdmin } = useCurrentUser();

const dispatch = useDispatch();

Expand All @@ -39,9 +41,11 @@ const Project: React.FC = () => {
</Space>
}
extra={
<BasicButton type="primary" onClick={createProject}>
{t('dmsProject.createProject.modalTitle')}
</BasicButton>
<EmptyBox if={isAdmin}>
<BasicButton type="primary" onClick={createProject}>
{t('dmsProject.createProject.modalTitle')}
</BasicButton>
</EmptyBox>
}
/>
<ProjectList />
Expand Down
7 changes: 4 additions & 3 deletions packages/sqle/src/page/Order/Detail/RejectReason/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { RejectReasonProps } from './index.type';
const RejectReason: React.FC<RejectReasonProps> = ({
stepInfo,
currentUsername,
openModifySqlModal
openModifySqlModal,
createOrderUserName
}) => {
const { t } = useTranslation();
return (
Expand All @@ -28,11 +29,11 @@ const RejectReason: React.FC<RejectReasonProps> = ({
</div>

<EmptyBox
if={currentUsername === stepInfo.operation_user_name}
if={currentUsername === createOrderUserName}
defaultNode={
<div className="wait-operator-modify-sql">
{t('order.operator.waitModifySql', {
username: stepInfo.operation_user_name
username: createOrderUserName
})}
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export type RejectReasonProps = {
stepInfo: IWorkflowStepResV2;
currentUsername: string;
openModifySqlModal: () => void;
createOrderUserName: string;
};
1 change: 1 addition & 0 deletions packages/sqle/src/page/Order/Detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const OrderDetail: React.FC = () => {
stepInfo={currentRejectedStep!}
currentUsername={username}
openModifySqlModal={openModifySqlModal}
createOrderUserName={orderInfo?.create_user_name ?? ''}
/>
</EmptyBox>

Expand Down

0 comments on commit a8c9f39

Please sign in to comment.