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

feat(viewer): integrate file upload component in form logic (DSP-1257) #264

Merged
merged 12 commits into from Jan 26, 2021

Conversation

tobiasschweizer
Copy link
Contributor

resolves DSP-1257

@tobiasschweizer tobiasschweizer added the enhancement New feature or request label Jan 21, 2021
@tobiasschweizer tobiasschweizer self-assigned this Jan 21, 2021
@tobiasschweizer tobiasschweizer changed the title feat(viewer): add @Output to upload comp. (DSP-1257) feat(viewer): integrate file upload component in form logic (DSP-1257) Jan 25, 2021
Copy link
Contributor

@mpro7 mpro7 left a comment

Choose a reason for hiding this comment

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

Good job! Thanks.

}, { updateOn: 'blur' });

if (this.parentForm !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this in purpose just for undefined? Otherwise it can be simplified to if (this.parentForm) {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course if (this.parentForm) {} would also work.

However, this involves a conversion of undefined to a Boolean value.

this.parentForm !== undefined checks that the member this.parentForm has been initialised, not performing any type conversion.

So all it does is checking exactly for undefined which is a special type in JS.

if (myvar) {} could give unexpected results if myvar was actually a Boolean. So if mayvar was initialised to false, this would not be the same as undefined.

The condition should prevent errors in case of non initialised vars.

So in general, I am trying to avoid implicit type conversions.

@tobiasschweizer tobiasschweizer merged commit 1d208d1 into main Jan 26, 2021
@tobiasschweizer tobiasschweizer deleted the wip/dsp-1257-upload branch January 26, 2021 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants