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

#10: Support post removal #28

Closed
wants to merge 2 commits into from
Closed

Conversation

dustyo-O
Copy link
Contributor

@dustyo-O
Copy link
Contributor Author

this solves #10

@tadatuta
Copy link
Member

тесты упали:

Deps validation error at common.blocks/issue/issue.deps.js :
Invalid type (boolean) in ".shouldDeps[4].mods.visible[0]": expected string
Deps validation error at common.blocks/issue/issue.deps.js :
Invalid type (boolean) in ".shouldDeps[4].mods.visible[1]": expected string
Deps validation error at common.blocks/issue/issue.deps.js :
Invalid type (boolean) in ".shouldDeps[5].mods.visible[0]": expected string
Deps validation error at common.blocks/issue/issue.deps.js :
Invalid type (boolean) in ".shouldDeps[5].mods.visible[1]": expected string

content: [
{
block: 'button',
text: i18n(this.block, 'Delete'),
Copy link
Member

Choose a reason for hiding this comment

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

по негласной договоренности порядок ключей: block, mods, mix, text

},
{
block: 'modal',
mods: { theme: 'islands', autoclosable: true, visible: false },
Copy link
Member

Choose a reason for hiding this comment

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

модификатор в значении false не имеет смысла

@@ -11,6 +13,51 @@ block('issue').content()(function() {
elem: 'date',
content: issue.created_from_now
},
issue.user.login === currentUser.login && {
block: 'issue',
Copy link
Member

Choose a reason for hiding this comment

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

здесь и везде ниже вместо хардкода имени блока использовать this.block (можно закешировать заранее)

mods: { theme: 'islands', size: 'm', view: 'action' },
mix: { block: 'issue', elem: 'delete-modal-yes' },
text: i18n(this.block, 'DeleteYes'),
js: { number: issue.number }
Copy link
Member

Choose a reason for hiding this comment

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

поле js поднять перед mix

},
{
block: 'spin',
mods: { theme: 'islands', size: 'm', visible: false },
Copy link
Member

Choose a reason for hiding this comment

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

false не имеет смысла

_onClickDeleteButton: function(event) {
var modal = this._elem('delete-confirm-modal').findMixedBlock(Modal);

event.preventDefault();
Copy link
Member

Choose a reason for hiding this comment

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

какую задачу здесь решает preventDefault?

var modal = this._elem('delete-confirm-modal').findMixedBlock(Modal);

event.preventDefault();
modal.setMod('visible', true);
Copy link
Member

Choose a reason for hiding this comment

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

true писать не обязательно

$.post('/api/' + event.bemTarget.params.number + '/delete', {
token: '213123123'
}).then(function(response) {
if (response === 'ok') {
Copy link
Member

Choose a reason for hiding this comment

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

а если не ок, то что? :)

}
}).catch(function(){
spinner.delMod('visible');
modalBody.setMod('visible', true);
Copy link
Member

Choose a reason for hiding this comment

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

тут бы какое-то пояснение для пользователя, что ничего такого не случилось

// deleting issue with 'removed' label
var issueAddLabelRequestUrl = applyToken(issuesRequestUrl + '/' + req.params.id + '/labels', req.body.token);

makeIssueRemoveRequest(issueAddLabelRequestUrl).then(function() {
Copy link
Member

Choose a reason for hiding this comment

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

removeIssueRequest

@LISBON11 LISBON11 closed this Sep 30, 2017
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.

None yet

3 participants