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

Some style adjustments #4162

Merged
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
14 changes: 6 additions & 8 deletions client/app/components/dynamic-form/DynamicForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class DynamicForm extends React.Component {
const submitProps = {
type: 'primary',
htmlType: 'submit',
className: 'w-100',
className: 'w-100 m-t-20',
disabled: this.state.isSubmitting,
loading: this.state.isSubmitting,
};
Expand All @@ -259,22 +259,20 @@ class DynamicForm extends React.Component {
<Form id={id} className="dynamic-form" layout="vertical" onSubmit={this.handleSubmit}>
{this.renderFields(regularFields)}
{!isEmpty(advancedFields) && (
<>
<div className="extra-options">
<Button
type="dashed"
block
className="extra-options-button m-t-30 m-b-10"
className="extra-options-button"
onClick={() => this.setState({ showExtraOptions: !showExtraOptions })}
>
Additional Settings
<i className={cx('fa m-l-5', { 'fa-caret-up': showExtraOptions, 'fa-caret-down': !showExtraOptions })} />
</Button>
<Collapse collapsed={!showExtraOptions}>
<div className="m-t-15">
{this.renderFields(advancedFields)}
</div>
<Collapse collapsed={!showExtraOptions} className="extra-options-content">
{this.renderFields(advancedFields)}
</Collapse>
</>
</div>
)}
{saveButton && <Button {...submitProps}>{saveText}</Button>}
{this.renderActions()}
Expand Down
12 changes: 12 additions & 0 deletions client/app/components/dynamic-form/DynamicForm.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@import '~@/assets/less/ant';

.dynamic-form{
.extra-options {
margin: 25px 0 10px;
}

.extra-options-button {
&, &:focus, &:hover {
height: 40px;
Expand All @@ -14,4 +18,12 @@
background-color: fade(@btn-danger-bg, 15%);
}
}

.extra-options-content {
margin-top: 15px;

.ant-form-item:last-of-type {
margin-bottom: 0 !important;
}
}
}