Skip to content

Commit

Permalink
feat: introduce request group settings (name, description, and move/c…
Browse files Browse the repository at this point in the history
…opy) (#3350)
  • Loading branch information
NickHackman committed Jun 25, 2021
1 parent 3bac68f commit a03c098
Show file tree
Hide file tree
Showing 8 changed files with 383 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import Dropdown from '../base/dropdown/dropdown';
import EnvironmentEditModal from '../modals/environment-edit-modal';
import * as models from '../../../models';
import { showError, showModal, showPrompt } from '../modals';
import { showError, showModal } from '../modals';
import type { HotKeyRegistry } from '../../../common/hotkeys';
import { hotKeyRefs } from '../../../common/hotkeys';
import type { RequestGroupAction } from '../../../plugins';
Expand All @@ -30,6 +30,7 @@ interface Props {
activeEnvironment?: Environment | null;
handleCreateRequest: (id: string) => any;
handleDuplicateRequestGroup: (requestGroup: RequestGroup) => any;
handleShowSettings: (requestGroup: RequestGroup) => any,
handleMoveRequestGroup: (requestGroup: RequestGroup) => any;
handleCreateRequestGroup: (requestGroup: string) => any;
}
Expand All @@ -51,19 +52,6 @@ class RequestGroupActionsDropdown extends PureComponent<Props, State> {
this._dropdown = n;
}

_handleRename() {
const { requestGroup } = this.props;
showPrompt({
title: 'Rename Folder',
defaultValue: requestGroup.name,
onComplete: name => {
models.requestGroup.update(requestGroup, {
name,
});
},
});
}

async _handleRequestCreate() {
this.props.handleCreateRequest(this.props.requestGroup._id);
}
Expand All @@ -72,10 +60,6 @@ class RequestGroupActionsDropdown extends PureComponent<Props, State> {
this.props.handleDuplicateRequestGroup(this.props.requestGroup);
}

_handleRequestGroupMove() {
this.props.handleMoveRequestGroup(this.props.requestGroup);
}

async _handleRequestGroupCreate() {
this.props.handleCreateRequestGroup(this.props.requestGroup._id);
}
Expand Down Expand Up @@ -160,15 +144,9 @@ class RequestGroupActionsDropdown extends PureComponent<Props, State> {
<DropdownItem onClick={this._handleRequestGroupDuplicate}>
<i className="fa fa-copy" /> Duplicate
</DropdownItem>
<DropdownItem onClick={this._handleRename}>
<i className="fa fa-edit" /> Rename
</DropdownItem>
<DropdownItem onClick={this._handleEditEnvironment}>
<i className="fa fa-code" /> Environment
</DropdownItem>
<DropdownItem onClick={this._handleRequestGroupMove}>
<i className="fa fa-exchange" /> Move
</DropdownItem>
<DropdownItem buttonClass={PromptButton} addIcon onClick={this._handleDeleteFolder}>
<i className="fa fa-trash-o" /> Delete
</DropdownItem>
Expand All @@ -183,6 +161,10 @@ class RequestGroupActionsDropdown extends PureComponent<Props, State> {
{p.label}
</DropdownItem>
))}
<DropdownDivider />
<DropdownItem onClick={this.props.handleShowSettings}>
<i className="fa fa-wrench" /> Settings
</DropdownItem>
</Dropdown>
);
}
Expand Down

This file was deleted.

Loading

0 comments on commit a03c098

Please sign in to comment.