[ci skip] Fix eslint errors

This commit is contained in:
Filipa Lacerda 2017-08-03 12:15:54 +01:00
parent b55ad844e8
commit 0d78eeb2a8
11 changed files with 25 additions and 36 deletions

View file

@ -37,7 +37,7 @@
'getIssueData',
]),
isLoggedIn() {
return this.getUserData === null ? false : true;
return this.getUserData !== null;
},
commentButtonTitle() {
return this.noteType === constants.COMMENT ? 'Comment' : 'Start discussion';
@ -64,7 +64,7 @@
},
canSubmit() {
return !this.note.length || this.isSubmitting;
}
},
},
methods: {
...mapActions([

View file

@ -50,7 +50,7 @@
},
newNotePath() {
return this.getIssueData.create_note_path;
}
},
},
methods: {
...mapActions([

View file

@ -75,14 +75,14 @@
});
}
},
formUpdateHandler(note) {
formUpdateHandler(noteText) {
const data = {
endpoint: this.note.path,
note: {
full_data: true,
target_type: 'issue',
target_id: this.note.noteable_id,
note: { note: note },
note: { note: noteText },
},
};

View file

@ -74,7 +74,7 @@
},
currentUserId() {
return this.getUserDataByProp('id');
}
},
},
};
</script>

View file

@ -52,10 +52,10 @@
// We need to do this otherwise we will render the same emoji over and over again.
groupedAwards() {
const awards = this.awards.reduce((acc, award) => {
if (acc.hasOwnProperty(award.name)) {
if (Object.prototype.hasOwnProperty.call(acc, award.name)) {
acc[award.name].push(award);
} else {
Object.assign(acc, {[award.name]: [award]});
Object.assign(acc, { [award.name]: [award] });
}
return acc;
@ -73,7 +73,7 @@
delete awards.thumbsdown;
}
return Object.assign({}, orderedAwards, awards);
return Object.assign({}, orderedAwards, awards);
},
isAuthoredByMe() {
return this.noteAuthorId === window.gon.current_user_id;
@ -150,7 +150,7 @@
endpoint: this.toggleAwardPath,
noteId: this.noteId,
// 100 emoji is a number. Callback for v-for click sends it as a string
awardName: awardName === "100" ? 100: awardName,
awardName: awardName === '100' ? 100 : awardName,
};
this.toggleAwardRequest(data)

View file

@ -48,7 +48,7 @@
},
formCancelHandler(shouldConfirm, isDirty) {
this.$emit('cancelFormEdition', shouldConfirm, isDirty);
}
},
},
mounted() {
this.renderGFM();

View file

@ -72,7 +72,10 @@
},
editMyLastNote() {
if (this.note === '') {
const lastNoteInDiscussion = this.getDiscussionLastNote(this.discussion, this.currentUserId);
const lastNoteInDiscussion = this.getDiscussionLastNote(
this.discussion,
this.currentUserId,
);
if (lastNoteInDiscussion) {
eventHub.$emit('enterEditMode', {

View file

@ -1,7 +1,6 @@
<script>
import { mapActions } from 'vuex';
import timeAgoTooltip from '../../vue_shared/components/time_ago_tooltip.vue';
import * as types from '../stores/mutation_types';
export default {
props: {
@ -55,7 +54,7 @@
},
methods: {
...mapActions([
'setTargetNoteHash'
'setTargetNoteHash',
]),
handleToggle() {
this.isExpanded = !this.isExpanded;

View file

@ -5,16 +5,15 @@
name: 'singInLinksNotes',
computed: {
...mapGetters([
'getNotesDataByProp'
'getNotesDataByProp',
]),
registerLink() {
return this.getNotesDataByProp('registerPath')
return this.getNotesDataByProp('registerPath');
},
signInLink(){
signInLink() {
return this.getNotesDataByProp('newSessionPath');
}
}
},
},
};
</script>

View file

@ -27,7 +27,7 @@
userData: {
type: Object,
required: false,
default: {}
default: {},
},
},
store,
@ -89,7 +89,7 @@
this.checkLocationHash();
});
})
.catch((error) => Flash('Something went wrong while fetching issue comments. Please try again.'));
.catch(() => Flash('Something went wrong while fetching issue comments. Please try again.'));
},
initPolling() {
this.setLastFetchedAt(this.getNotesDataByProp('lastFetchedAt'));
@ -99,8 +99,7 @@
bindEventHubListeners() {
this.$el.parentElement.addEventListener('toggleAward', (event) => {
const { awardName, noteId } = event.detail;
this.actionToggleAward({ awardName, noteId })
this.actionToggleAward({ awardName, noteId });
});
// JQuery is needed here because it is a custom event being dispatched with jQuery.
@ -121,7 +120,7 @@
created() {
this.setNotesData(this.notesData);
this.setIssueData(this.issueData);
this.setUserData(this.userData)
this.setUserData(this.userData);
},
mounted() {
this.fetchNotes();

View file

@ -1,16 +1,5 @@
import Vue from 'vue';
import placeholderNote from '~/notes/components/issue_placeholder_note.vue';
describe('issue placeholder system note component', () => {
let mountComponent;
beforeEach(() => {
const PlaceholderNote = Vue.extend(placeholderNote);
mountComponent = props => new PlaceholderNote({
propsData: {
note: props,
},
}).$mount();
});
describe('user information', () => {