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

Render organizer message in CallListItem #1037

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MikaelJohnAndersson
Copy link
Contributor

@MikaelJohnAndersson MikaelJohnAndersson commented Jan 23, 2020

This PR adds functionality for displaying the message to organizer in CallListItem.

Since message_to_organizer only is included in the data when retrieving a single call, CallListItem dispatches an action for retrieving additional data once the item is in view, displaying a loading (dots) animation while the request is pending.

In cases where there is no message_to_organizer data, a fallback message is rendered.

Examples of truncated message, full message and message placeholder:

Skärmavbild 2020-01-29 kl  13 22 34

Loading animation:

calllistitem-msg-loading

Closes #933

@jensborje
Copy link
Collaborator

Would it be possible to include a screenshot? I can't test it myself on my local machine atm.

@MikaelJohnAndersson
Copy link
Contributor Author

@jensborje Sure! I updated the PR with added screenshots.

Copy link
Collaborator

@jensborje jensborje left a comment

Choose a reason for hiding this comment

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

Very good! Well done!

Copy link
Collaborator

@martinajsongren martinajsongren left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I left a comment where you missed a semicolon.

src/components/lists/items/CallListItem.jsx Outdated Show resolved Hide resolved
);
}
else if (call.message_to_organizer && call.message_to_organizer.length > 180) {
messageContent = call.message_to_organizer.substr(0, 180) + '...';
Copy link
Member

Choose a reason for hiding this comment

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

How about something like this?

let len = 0;
messageContent = call.message_to_organizer.split(' ').filter(s => (len += s.length + 1) && len < 40).join(' ') + '...';

0% { content: '.'; }
33% { content: '..'; }
66% { content: '...'; }
99% { content: '.'; }
Copy link
Member

Choose a reason for hiding this comment

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

Is this line needed?

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.

Render organizer message in CallList
4 participants