Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-08-07 20:23:56 +0300
committerFilipa Lacerda <filipa@gitlab.com>2017-08-07 20:23:56 +0300
commit25fcee16f5e1640b88bfc893cabdddbed5bc2551 (patch)
tree041cdd8b469f1d57fa19ecebe062386b01b23bda /app
parentfecb1a2f3c77205a72eeff1a3501629d2d1811d8 (diff)
Init adding tests
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/autosave.js5
-rw-r--r--app/assets/javascripts/notes/components/issue_notes_app.vue12
-rw-r--r--app/assets/javascripts/notes/stores/actions.js2
3 files changed, 8 insertions, 11 deletions
diff --git a/app/assets/javascripts/autosave.js b/app/assets/javascripts/autosave.js
index 6000c56665b..cfab6c40b34 100644
--- a/app/assets/javascripts/autosave.js
+++ b/app/assets/javascripts/autosave.js
@@ -2,11 +2,6 @@
import AccessorUtilities from './lib/utils/accessor';
window.Autosave = (function() {
- /**
- *
- * @param {*} field the textarea
- * @param {Array} key Array with: ['Note', type, id, ]
- */
function Autosave(field, key) {
this.field = field;
this.isLocalStorageAvailable = AccessorUtilities.isLocalStorageAccessSafe();
diff --git a/app/assets/javascripts/notes/components/issue_notes_app.vue b/app/assets/javascripts/notes/components/issue_notes_app.vue
index 4c0351f701b..371addd937e 100644
--- a/app/assets/javascripts/notes/components/issue_notes_app.vue
+++ b/app/assets/javascripts/notes/components/issue_notes_app.vue
@@ -114,10 +114,12 @@
this.fetchNotes();
this.initPolling();
- this.$el.parentElement.addEventListener('toggleAward', (event) => {
- const { awardName, noteId } = event.detail;
- this.actionToggleAward({ awardName, noteId });
- });
+ if (this.$el.parentElement) {
+ this.$el.parentElement.addEventListener('toggleAward', (event) => {
+ const { awardName, noteId } = event.detail;
+ this.actionToggleAward({ awardName, noteId });
+ });
+ }
},
};
</script>
@@ -126,7 +128,7 @@
<div id="notes">
<div
v-if="isLoading"
- class="loading">
+ class="js-loading loading">
<loading-icon />
</div>
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index 0c9eb046298..1ad7648e533 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -134,7 +134,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
};
const pollSuccessCallBack = (resp, commit, state, getters) => {
- if (resp.notes.length) {
+ if (resp.notes && resp.notes.length) {
const { notesById } = getters;
resp.notes.forEach((note) => {