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

Added Unlock feature #46

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

Added Unlock feature #46

wants to merge 1 commit into from

Conversation

zapdos26
Copy link
Contributor

Added Unlock feature;
Made a dynamic dropdown;
Moved vote option creation to PollHelpers
Prevent button press processing when vote is locked;
Changed how "isLocked" status is determined;
Add notification to user if their vote was blocked due to it being locked.
Remove empty votes from results;
Remove null from section, because null causes errors when sending the message;
Ran ESlint;

Made a dynamic dropdown;
Moved vote option creation to PollHelpers
Prevent button press processing when vote is locked;
Changed how "isLocked" status is determined;
Add notification to user if their vote was blocked due to it being locked.
Remove empty votes from results;
Remove null from section, because null causes errors when sending the message.
@@ -123,6 +131,16 @@ export class Actions {
}
}

private onUnlockSelected(payload: any, poll: Poll): void {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

this.isLocked = true;
this.generateVoteResults();
this.message = this.message.slice(0, 2).concat(this.message.slice(this.getDividerId() - 1));
this.message = this.message.slice(0, this.getDividerId() - 1).concat(this.getDynamicSelect()).concat(this.message.slice(this.getDividerId()));
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.


public unlockpoll(): void {
this.isLocked = false;
this.message = this.message.slice(0, this.getDividerId() - 1).concat(this.getDynamicSelect()).concat({type: "divider"}).concat(this.message.slice(this.getDividerId() + 2));
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented Dec 21, 2019

Code Climate has analyzed commit b28ae50 and detected 4 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 4

View more on Code Climate.

@zapdos26 zapdos26 mentioned this pull request Dec 21, 2019
@zapdos26 zapdos26 changed the base branch from master to dev December 21, 2019 00:09
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.

1 participant