mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Mew app creation - v1 should be default name and pressing enter should create version (#1968)
* updating default value to app version * typo * bugix toast triggering more than once
This commit is contained in:
parent
fda3028c5a
commit
47fbf3fb92
1 changed files with 10 additions and 2 deletions
|
|
@ -110,7 +110,7 @@ class Editor extends React.Component {
|
|||
socket: null,
|
||||
showInitVersionCreateModal: false,
|
||||
isCreatingInitVersion: false,
|
||||
initVersionName: null,
|
||||
initVersionName: 'v1',
|
||||
isSavingEditingVersion: false,
|
||||
showSaveDetail: false,
|
||||
hasAppDefinitionChanged: false,
|
||||
|
|
@ -800,7 +800,12 @@ class Editor extends React.Component {
|
|||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
handleKeyPress = (event) => {
|
||||
if (event.key === 'Enter') {
|
||||
// eslint-disable-next-line no-undef
|
||||
this.createInitVersion();
|
||||
}
|
||||
};
|
||||
createInitVersion = () => {
|
||||
const newVersionName = this.state.initVersionName;
|
||||
const appId = this.state.appId;
|
||||
|
|
@ -844,6 +849,7 @@ class Editor extends React.Component {
|
|||
enforceFocus={false}
|
||||
animation={false}
|
||||
centered={true}
|
||||
// eslint-disable-next-line no-undef
|
||||
>
|
||||
<Modal.Header>
|
||||
<Modal.Title>Create Version</Modal.Title>
|
||||
|
|
@ -855,7 +861,9 @@ class Editor extends React.Component {
|
|||
type="text"
|
||||
className="form-control"
|
||||
placeholder="version name"
|
||||
defaultValue={this.state.initVersionName}
|
||||
onChange={(e) => this.setState({ initVersionName: e.target.value })}
|
||||
onKeyPress={(e) => this.handleKeyPress(e)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue