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

Feature/feedback #35

Merged
merged 23 commits into from
Apr 28, 2017
Merged

Feature/feedback #35

merged 23 commits into from
Apr 28, 2017

Conversation

aziz512
Copy link
Collaborator

@aziz512 aziz512 commented Apr 28, 2017

This PR adds a feedback form which sends feedback to firebase

this.open = !this.open;
let mainDiv = this.el.nativeElement.querySelector('#main');
if (this.open) {
mainDiv.style['width'] = '25%';
Copy link
Collaborator

@prestonvanloon prestonvanloon Apr 28, 2017

Choose a reason for hiding this comment

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

You might consider using ngClass to apply a class with width: 25%

name:string = '';
comment: string = '';
statusMessage:string = '';
error = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rename to hasError


buttonClicked(){
this.open = !this.open;
let mainDiv = this.el.nativeElement.querySelector('#main');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use const

})
export class FeedbackWidgetComponent implements OnInit {
open = false;
email: string = '';
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can rely on implicit types if you are initializing these strings to empty string.
Why are you initializing them to empty string?

export class FeedbackWidgetComponent implements OnInit {
open = false;
email: string = '';
name:string = '';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Formatting

styleUrls: ['./feedback-widget.component.css']
})
export class FeedbackWidgetComponent implements OnInit {
open = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rename to isOpen

timestamp: new Date().toUTCString(),
href:window.location.href,
header: headerText
}).then(x => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

}).then(() => {

header: headerText
}).then(x => {
this.statusMessage = 'Successfully sent';
setTimeout(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This send function is doing a lot of stuff. I recommend refactoring this message display logic into a private function.

Then you can call

}).then(this.showSuccessMessage);

}
}

htmlEscape(str) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a function level comment to describe what this is doing? Alternatively, is there a npm module you could use? It feels like someone has done this before, somewhere.

let comment = this.comment;
let email = this.email;
let items = this.angularFire.database.list('/feedback');
let headerText = document.body.querySelector('h1:not([style*="display:none"]') ? document.body.querySelector('h1:not([style*="display:none"]').innerHTML : '';
Copy link
Collaborator

Choose a reason for hiding this comment

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

h1:visible ?


buttonClicked(){
this.open = !this.open;
let mainDiv = this.el.nativeElement.querySelector('#main');
Copy link
Collaborator

Choose a reason for hiding this comment

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

use *ngIf

});

this.comment = '';
//TODO set username in state.local.user
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it a real TODO or copyPaste?

}
}

htmlEscape(str) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't think this is super secure, leave a TODO, since we'll have to figure out how to handle it once we fetch it

Jai-Chaudhary and others added 19 commits April 28, 2017 12:49
- Shows all slides in a single scrollable view
- Added enumeration of "Presentation modes", could be "none" or
"overview"
- Toggles between 'overview' and 'none'
- Added @print media-query to print 1 slide per page and use proper zoom
- A slide shows its page number if in 'overview' mode
- Added Overview button to all slides
- Shows all slides in a single scrollable view
- Added enumeration of "Presentation modes", could be "none" or
"overview"
- Toggles between 'overview' and 'none'
- Added @print media-query to print 1 slide per page and use proper zoom
- A slide shows its page number if in 'overview' mode
- Added Overview button to all slides
@kirjs
Copy link
Collaborator

kirjs commented Apr 28, 2017

OK, I need this in ASAP for the demo, please fix this stuff in another PR

@kirjs kirjs merged commit 5f56464 into master Apr 28, 2017
@prestonvanloon
Copy link
Collaborator

In the future, can you create a demo branch and merge the branch into that without closing the PR?

It will be difficult to respond to review over different pull requests.

@kirjs
Copy link
Collaborator

kirjs commented Apr 28, 2017

Agreed

@kirjs kirjs deleted the feature/feedback branch May 2, 2017 11:32
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.

6 participants