Allow file name copying in file manager list view while preserving sorting by Yulyaswan · Pull Request #5318 · ExpressionEngine/ExpressionEngine · GitHub
Skip to content
Open
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
4 changes: 2 additions & 2 deletions tests/cypress/cypress/elements/pages/files/CropFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FileManagerSection from '../_sections/FileManagerSection'
class CropFile extends FileManagerSection {
constructor() {
super()
this.urlMatch = /files\/file\/crop/;
this.urlMatch = /files\/file\/view/;

this.elements({
// Main box elements
Expand Down Expand Up @@ -47,4 +47,4 @@ class CropFile extends FileManagerSection {
return filename
}
}
export default CropFile;
export default CropFile;
1 change: 1 addition & 0 deletions tests/cypress/cypress/elements/pages/files/FileManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class FileManager extends FileManagerSection {
'checkbox_header': '.ee-main__content form .table-responsive table tr th:nth-child(1) input[type=checkbox]',

'title_names': '.ee-main__content form .table-responsive table tr td:nth-child(3)',
'file_names': '.ee-main__content form .table-responsive table tr td:nth-child(4)',
'file_types': '.ee-main__content form .table-responsive table tr td:nth-child(5)',
'dates_added': '.ee-main__content form .table-responsive table tr td:nth-child(6)',
'manage_actions': '.ee-main__content form .table-responsive table tr td:nth-child(8)',
Expand Down
10 changes: 3 additions & 7 deletions tests/cypress/cypress/integration/files/crop.ee6.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ context('File Manager / Crop File', () => {
cy.auth();
cy.contains('Files').click()
cy.get('.sidebar__link').contains('About').click()
cy.get('.ee-main__content form .table-responsive table tr:nth-child(2) td:nth-child(4)').invoke('text').as('file_name', { type: 'static' })
//cy.get('.ee-main__content form .table-responsive table tr:nth-child(2) td:nth-child(4) ul.toolbar li.crop').click()
// cy.get('a[title="Crop"]').first().click({force: true})
cy.get('.ee-main__content form .table-responsive table tr:nth-child(2) .toolbar-wrap .js-dropdown-toggle').click()
cy.get('a[title="Edit"]').filter(':visible').first().click()
cy.get('.ee-main__content form .table-responsive table tr:nth-child(2) .toolbar-wrap .dropdown--open a[title="Edit"]').click({force: true})
page.get('crop_tab').click()
// page = CropFile.new
// @return = FileManager.new
Expand All @@ -40,11 +39,8 @@ context('File Manager / Crop File', () => {

//page.get('breadcrumb').should('exist')
//page.get('breadcrumb').contains('File ManagerEdit "' + file_name + '"Crop, Rotate & Resize "' + file_name + '"')
cy.get('@file_name').then((filename) => {
//page.get('heading').contains('Crop, Rotate & Resize "' + filename + '"')
page.get('heading').contains(filename.replace('File Name', ''))
page.get('crop_tab').should('have.class', 'active')
})
cy.url().should('match', page.urlMatch)
page.get('crop_tab').should('have.class', 'active')

page.get('crop_tab').should('exist')
page.get('rotate_tab').should('exist')
Expand Down
11 changes: 11 additions & 0 deletions tests/cypress/cypress/integration/files/file_manager.ee6.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ context('File Manager', () => {
page.get('files').should('have.length', 10)
});

it('keeps rows sortable while excluding the file name cell from drag start', () => {
beforeEach_all_files();

page.get('files').first().should('have.class', 'ui-sortable-handle')
page.get('file_names').first().should('have.class', 'filemanager-filename-cell')

cy.get('.f_manager-wrapper tbody').then(($tbody) => {
expect($tbody.sortable('option', 'cancel')).to.include('.filemanager-filename-cell')
})
});

// General Tests

it('Change the page size using the menu', () => {
Expand Down
6 changes: 4 additions & 2 deletions tests/cypress/cypress/integration/publish/publish.ee6.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ context('Publish Entry', () => {
page.get('chosen_files').should('have.length', 2)
page.get('file_fields').each(function(field, i) {
var fileNameLabel = field.parents('.field-control').find('.fields-upload-chosen-name');
const fileName = selectedFiles[i].trim();
cy.get(fileNameLabel).should('be.visible')
cy.get(fileNameLabel).should('contain', selectedFiles[i])
cy.get(fileNameLabel).should('contain', fileName)

var fileInputHidded = field.parents('.field-control').find('input[class="js-file-input"]');
cy.get(fileInputHidded).invoke('val').then((value) => {
Expand All @@ -157,8 +158,9 @@ context('Publish Entry', () => {
page.get('chosen_files').should('have.length', 2)
page.get('file_fields').each(function(field, i) {
var fileNameLabel = field.parents('.field-control').find('.fields-upload-chosen-name');
const fileName = selectedFiles[i].trim();
cy.get(fileNameLabel).should('be.visible')
cy.get(fileNameLabel).should('contain', selectedFiles[i])
cy.get(fileNameLabel).should('contain', fileName)

var fileInputHidded = field.parents('.field-control').find('input[class="js-file-input"]');
cy.get(fileInputHidded).invoke('val').then((value) => {
Expand Down
1 change: 1 addition & 0 deletions themes/ee/asset/javascript/src/cp/publish/entry-list.js
Loading