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

Support copy from right in timetable editor #1013

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

miles-grant-ibigroup
Copy link
Contributor

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JSDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

Description

Timetable editor has a cool keyboard shortcut to copy from left/top, but nothing to copy from right! We add shift+l to do this, mirroring shift+'.

Please test thoroughly I could only come up with so many edge cases. Tempted to add a new e2e case

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

Add null checks and a check to avoid copying time into a non-time cell.

case 76: { // l
// Set current cell's value to adjacent cell's (rightward) value.
const adjacentCol = columns[this._getColIndex(scrollToColumn) + 1]
if (evt.shiftKey && !activeCell && isTimeFormat(adjacentCol.type)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to check that adjacentCol is defined (see console error), and that check needs to be added for copy-from-left.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there should also be an isTimeFormat check for the focused cell. (We probably don't want to copy a time value into a non-time cell, but this is possible, as written, from the first time cell into the trip short name cell).

Copy link
Contributor

Choose a reason for hiding this comment

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

There is a caveat that the adjacent cells must be visible for the copy operations to complete, but that is not blocking for this PR.

lib/editor/util/timetable.js Show resolved Hide resolved
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.

4 participants