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

Feat: hide project form item #307

Merged
merged 1 commit into from
Dec 29, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class AppDialog extends React.Component<Props, State> {
description,
alias,
name,
project,
icon = '',
componentType,
properties,
Expand All @@ -110,7 +109,7 @@ class AppDialog extends React.Component<Props, State> {
icon,
name,
description,
project,
project: 'default',
envBinding: envbinding,
component: {
alias,
Expand Down
22 changes: 12 additions & 10 deletions src/pages/ApplicationList/components/GeneralConfig/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { checkName } from '../../../../utils/common';
import './index.less';
import Translation from '../../../../components/Translation';
import type { Project } from '../../../../interface/project';
import { If } from 'tsx-control-statements/components';

type Props = {
visible: boolean;
Expand Down Expand Up @@ -108,16 +109,17 @@ class GeneralConfig extends React.Component<Props, State> {
</FormItem>
</Col>
</Row>

<Row>
<Col span={24} style={{ padding: '0 8px' }}>
<ProjectForm
field={this.props.field}
projectList={projectList}
syncProjectList={this.props.syncProjectList}
/>
</Col>
</Row>
<If condition={false}>
<Row>
<Col span={24} style={{ padding: '0 8px' }}>
<ProjectForm
field={this.props.field}
projectList={projectList}
syncProjectList={this.props.syncProjectList}
/>
</Col>
</Row>
</If>
</Form>
</div>
);
Expand Down
27 changes: 15 additions & 12 deletions src/pages/EnvPage/components/EnvDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { Env } from '../../../../interface/env';
import ProjectForm from '../../../ApplicationList/components/GeneralConfig/project-form';
import type { Project } from '../../../../interface/project';
import { createEnv, updateEnv } from '../../../../api/env';
import { If } from 'tsx-control-statements/components';

type Props = {
project?: string;
Expand Down Expand Up @@ -64,13 +65,13 @@ class EnvDialog extends React.Component<Props, State> {
return;
}
const { isEdit } = this.props;
const { name, alias, description, project, targets, namespace } = values;
const { name, alias, description, targets, namespace } = values;
const params = {
name,
alias,
description,
namespace,
project,
project: 'default',
targets,
};

Expand Down Expand Up @@ -235,16 +236,18 @@ class EnvDialog extends React.Component<Props, State> {
</FormItem>
</Col>
</Row>
<Row>
<Col span={24} style={{ padding: '0 8px' }}>
<ProjectForm
field={this.field}
disable={isEdit}
projectList={projectOptions}
syncProjectList={syncProjectList}
/>
</Col>
</Row>
<If condition={false}>
<Row>
<Col span={24} style={{ padding: '0 8px' }}>
<ProjectForm
field={this.field}
disable={isEdit}
projectList={projectOptions}
syncProjectList={syncProjectList}
/>
</Col>
</Row>
</If>
<Row>
<Col span={24} style={{ padding: '0 8px' }}>
<FormItem label={<Translation>Target</Translation>} required>
Expand Down