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

File list columns are now sortable #3078

Merged
merged 1 commit into from
Feb 26, 2020
Merged

Conversation

PVince81
Copy link
Contributor

@PVince81 PVince81 commented Feb 21, 2020

Description

Added ability to sort some columns in the file lists by clicking on
them. The sort direction appears with an indicator.

Related Issue

Fixes #1854

Motivation and Context

How Has This Been Tested?

  • manual test
  • acceptance tests

Screenshots (if appropriate):

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • restore or keep sort order per file list (ex: sort by share time in "shared with others" then go back to "all files", no sort is set now)
  • add sortable columns in more lists (trashbin, shares)
  • add acceptance tests

@PVince81 PVince81 self-assigned this Feb 21, 2020
@update-docs
Copy link

update-docs bot commented Feb 21, 2020

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@PVince81
Copy link
Contributor Author

Now thinking, it won't be easy to have a sort field per table because the sorting is happening in the global state. Would require moving the global state's activeFiles into the object, and possibly more of the mixins. For this task I'll try to limit the changes and just make sure it doesn't behave too badly when switching between views. Maybe it will simply fallback to the name column when switching for now.

@PVince81 PVince81 force-pushed the sorting-clickable-columns branch from 91ef3a9 to fbda029 Compare February 24, 2020 16:18
@PVince81
Copy link
Contributor Author

PVince81 commented Feb 24, 2020

  • aria label for sort indicator
  • own vue component for clickable sort column, there's already too much markup...

@PVince81
Copy link
Contributor Author

I've added clickable columns in more lists, and also the whole width is clickable.
Since there's a lot of repetition, let's move those into a separate Vue component.

Also will need a way to detect those indicators from the test to find out whether to click once or twice depending on the desired sort order.

@PVince81
Copy link
Contributor Author

PVince81 commented Feb 25, 2020

  • use raw oc-button instead of links

@PVince81
Copy link
Contributor Author

PVince81 commented Feb 26, 2020

  • use raw oc-button instead of links, requires ODS update to not look shitty

Added ability to sort some columns in the file lists by clicking on
them. The sort direction appears with an indicator.
@PVince81 PVince81 force-pushed the sorting-clickable-columns branch from fbda029 to 6a954e0 Compare February 26, 2020 10:28
@PVince81 PVince81 marked this pull request as ready for review February 26, 2020 10:29
@PVince81 PVince81 requested a review from LukasHirt February 26, 2020 10:29
setSort: async function (column, isDesc = false) {
const columnSelector = util.format(this.elements.filesTableHeaderColumn.selector, xpathHelper.buildXpathLiteral(column))
await this.useXpath()
.waitForElementVisible(columnSelector)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From nightwatch docs:

click() will automatically wait for the element to be present (until the specified timeout).

Do we need to wait until the element is visible or is present enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep "visible" just to be on the safe side...

@PVince81 PVince81 merged commit d7fdde3 into master Feb 26, 2020
@delete-merged-branch delete-merged-branch bot deleted the sorting-clickable-columns branch February 26, 2020 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Files list needs to be sortable
2 participants