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

ES6: Migrate 'view_model' #1236

Merged
merged 3 commits into from
May 19, 2017
Merged

ES6: Migrate 'view_model' #1236

merged 3 commits into from
May 19, 2017

Conversation

gregor
Copy link
Contributor

@gregor gregor commented May 15, 2017

No description provided.

@lipis lipis mentioned this pull request May 15, 2017
79 tasks
@gregor gregor force-pushed the es6/view_model branch 15 times, most recently from c43dd03 to 18886a1 Compare May 16, 2017 10:17
@gregor gregor changed the title 🚧 ES6: Migrate 'view_model' ES6: Migrate 'view_model' May 16, 2017
@gregor gregor force-pushed the es6/view_model branch 5 times, most recently from 1342c53 to 40d57a1 Compare May 16, 2017 11:48
],
};

}
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove empty line

});
this.posted_mode_verify = ko.pureComputed(() => {
return this.posted_mode() === z.auth.AuthView.MODE.POSTED_VERIFY;
});
Copy link
Contributor

@ffflorian ffflorian May 16, 2017

Choose a reason for hiding this comment

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

Functions in lines 248-262 can all be replaced by the short version:

this.posted_mode_verify = ko.pureComputed(() => this.posted_mode() === z.auth.AuthView.MODE.POSTED_VERIFY);

})
.then(() => {
return this.user_service.change_own_email(this.username());
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Short function could be applied here, too.

let payload = {};
const username = this.username()
.trim()
.toLowerCase();
Copy link
Contributor

Choose a reason for hiding this comment

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

const username = this.username().trim().toLowerCase();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Linter will fail

Copy link
Contributor

Choose a reason for hiding this comment

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

More than two.. :) it's too deep..

this.state(GiphyViewModel.STATE.ERROR);
});

}
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove empty line

let main_css_classes = `main-accent-color-${this.user().accent_id()}`;
main_css_classes += ` ${this.user().accent_theme()}`;
main_css_classes += ' show';
return main_css_classes;
Copy link
Contributor

Choose a reason for hiding this comment

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

const main_css_classes = `main-accent-color-${this.user().accent_id()} ${this.user().accent_theme()} show';

or

let main_css_classes = `main-accent-color-${this.user().accent_id()} `;
main_css_classes += this.user().accent_theme();
main_css_classes += ' show';

this.calls = this.calling_repository.calls;
this.joined_call = this.calling_repository.joined_call;

this.videod_call = ko.pureComputed(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be this.video_call (everywhere)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No

@gregor gregor force-pushed the es6/view_model branch 2 times, most recently from db7c798 to 32aef09 Compare May 16, 2017 12:32
@gregor gregor force-pushed the es6/view_model branch 3 times, most recently from 43989af to b79bacd Compare May 16, 2017 17:33
@bennycode bennycode merged commit 0b060f1 into dev May 19, 2017
@bennycode bennycode deleted the es6/view_model branch May 19, 2017 21:14
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.

4 participants