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

T1202022 - dxFileManager - A directory is not created when clicking "New Directory" quickly #26232

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 @@ -86,9 +86,9 @@ class FileManagerFolderChooserDialog extends FileManagerDialogBase {
super._onPopupShown();
}

_onPopupHidden() {
_onPopupHiding() {
this._toggleUnavailableLocationsDisabled(false);
super._onPopupHidden();
super._onPopupHiding();
}

_toggleUnavailableLocationsDisabled(isDisabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class FileManagerDialogBase extends Widget {
onInitialized: ({ component }) => {
component.registerKeyHandler('enter', this._applyDialogChanges.bind(this));
},
onHidden: this._onPopupHidden.bind(this),
onHiding: this._onPopupHiding.bind(this),
onShown: this._onPopupShown.bind(this),
_wrapperClassExternal: `${FILE_MANAGER_DIALOG_POPUP} ${options.popupCssClass ?? ''}`
};
Expand Down Expand Up @@ -104,7 +104,7 @@ class FileManagerDialogBase extends Widget {
this._popup.hide();
}

_onPopupHidden() {
_onPopupHiding() {
this._onClosedAction({ dialogResult: this._dialogResult });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2353,4 +2353,107 @@ QUnit.module('Editing operations', moduleConfig, () => {
assert.strictEqual(this.wrapper.getDetailsItemName(0), newFileName, '1st file is still in the initial dir');
assert.strictEqual(this.wrapper.getDetailsItemName(1), fileName2, '2nd file is still in the initial dir');
});

test('create folder from fast re-opened dialog (T1202022)', function(assert) {
fx.off = false;
this.wrapper.getToolbarButton('New directory').trigger('dxclick');
this.clock.tick(400);

$('.dx-overlay-shader').trigger('dxpointerdown');
this.clock.tick(50);

this.wrapper.getToolbarButton('New directory').trigger('dxclick');
this.clock.tick(400);
this.wrapper.getDialogButton('Create').trigger('dxclick');
this.clock.tick(400);

const $folderNode = this.wrapper.getFolderNode(4);
assert.equal($folderNode.find('span').text(), 'Untitled directory', 'folder created');
assert.equal(this.wrapper.getFocusedItemText(), 'Files', 'root folder selected');
fx.off = true;
});

test('rename item from fast re-opened dialog (T1202022)', function(assert) {
fx.off = false;
const newFileName = 'File 123.txt';

const $cell = this.wrapper.getRowNameCellInDetailsView(1);
assert.equal(this.wrapper.getDetailsItemName(0), 'File 1.txt', 'has target file');
$cell.trigger(CLICK_EVENT).click();
this.clock.tick(400);

this.wrapper.getToolbarButton('Rename').trigger('dxclick');
this.clock.tick(400);

$('.dx-overlay-shader').trigger('dxpointerdown');
this.clock.tick(50);

this.wrapper.getToolbarButton('Rename').trigger('dxclick');
this.clock.tick(400);
this.wrapper.getDialogTextInput().val(newFileName).trigger('change');
this.wrapper.getDialogButton('Save').trigger('dxclick');
this.clock.tick(400);

assert.equal(this.wrapper.getFocusedItemText(), 'Files', 'root folder selected');
assert.strictEqual(this.wrapper.getDetailsItemName(0), newFileName, 'file is renamed');
fx.off = true;
});

test('copy item from fast re-opened dialog (T1202022)', function(assert) {
fx.off = false;

const $cell = this.wrapper.getRowNameCellInDetailsView(1);
assert.equal(this.wrapper.getDetailsItemName(0), 'File 1.txt', 'has target file');
$cell.trigger(CLICK_EVENT).click();
this.clock.tick(400);

this.wrapper.getToolbarButton('Copy to').trigger('dxclick');
this.clock.tick(400);

$('.dx-overlay-shader').trigger('dxpointerdown');
this.clock.tick(50);

this.wrapper.getToolbarButton('Copy to').trigger('dxclick');
this.clock.tick(400);

const $folderNodes = this.wrapper.getFolderNodes(true);
$folderNodes.eq(3).trigger('dxclick');

this.wrapper.getDialogButton('Copy').trigger('dxclick');
this.clock.tick(400);

assert.strictEqual(this.wrapper.getFocusedItemText(), 'Folder 3', 'initial folder should be selected');
assert.strictEqual(this.fileManager.getCurrentDirectory().name, 'Folder 3', 'current folder is the initial folder');
assert.strictEqual(this.wrapper.getDetailsItemName(0), 'File 1.txt', 'file copied');
fx.off = true;
});

test('move item from fast re-opened dialog (T1202022)', function(assert) {
fx.off = false;

const $cell = this.wrapper.getRowNameCellInDetailsView(1);
assert.equal(this.wrapper.getDetailsItemName(0), 'File 1.txt', 'has target file');
$cell.trigger(CLICK_EVENT).click();
this.clock.tick(400);

this.wrapper.getToolbarButton('Move to').trigger('dxclick');
this.clock.tick(400);

$('.dx-overlay-shader').trigger('dxpointerdown');
this.clock.tick(50);

this.wrapper.getToolbarButton('Move to').trigger('dxclick');
this.clock.tick(400);

const $folderNodes = this.wrapper.getFolderNodes(true);
$folderNodes.eq(3).trigger('dxclick');

this.wrapper.getDialogButton('Move').trigger('dxclick');
this.clock.tick(400);

assert.strictEqual(this.wrapper.getFocusedItemText(), 'Folder 3', 'initial folder should be selected');
assert.strictEqual(this.fileManager.getCurrentDirectory().name, 'Folder 3', 'current folder is the initial folder');
assert.strictEqual(this.wrapper.getDetailsItemName(0), 'File 1.txt', 'file moved');
fx.off = true;
});
});