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

Card url fixed #1932

Merged
merged 1 commit into from
Oct 3, 2018
Merged

Card url fixed #1932

merged 1 commit into from
Oct 3, 2018

Conversation

schulz
Copy link
Contributor

@schulz schulz commented Oct 3, 2018

There was an issue with displaying card by url. 3 issues found:

  1. If a user was deleted from the system but he was assigned to board this piece of code fails:
    member.username = Users.findOne(member.userId).username;
    So I've replaced it with a check for user to exist:
const u = Users.findOne(member.userId);
    if(u){
      member.username = u.username;
    }
  1. The scrolling was not working as Parent component was not loaded when scrollParentContainer function was called so this function should be called after rendering is finished (I've simply added a timeout to exit the rendering function scope and execute it in separate loop):
if (!Utils.isMiniScreen()){
      Meteor.setTimeout(() => {
        this.scrollParentContainer();
      }, 500);
    }
  1. In swimlanes mode with lots of cards the top scrolling is required to scroll the screen to the card view:
scrollTop(position = 0) {
    const swimlanes = this.$('.js-swimlanes');
    swimlanes && swimlanes.animate({
      scrollTop: position,
    });
  },

And a code to calculate the scroll in scrollParentContainer:

//Scroll top
    const cardViewStartTop = $cardView.offset().top;
    const cardContainerScrollTop = $cardContainer.scrollTop();
    let topOffset = false;
    if(cardViewStartTop < 0){
      topOffset = 0;
    } else if(cardViewStartTop - cardContainerScrollTop > 100) {
      topOffset = cardViewStartTop - cardContainerScrollTop - 100;
    }
    if(topOffset !== false) {
      bodyBoardComponent.scrollTop(topOffset);
    }

This change is Reviewable

@xet7
Copy link
Member

xet7 commented Oct 3, 2018

@schulz

What Wekan GitHub issue numbers this fixes?

@schulz
Copy link
Contributor Author

schulz commented Oct 3, 2018

I didn't create any issue and I'm not sure if one was created, I've just discovered it by myself and fixed

@xet7 xet7 merged commit f8b8912 into wekan:devel Oct 3, 2018
xet7 added a commit that referenced this pull request Oct 3, 2018
Thanks to schulz !
xet7 added a commit that referenced this pull request Oct 3, 2018
Thanks to schulz !
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.

2 participants