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: introduce request group settings (name, description, and move/copy) #3350

Merged
merged 12 commits into from
Jun 25, 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 @@ -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