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
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-07-27 23:24:05 +0300
committerFilipa Lacerda <filipa@gitlab.com>2017-07-27 23:25:02 +0300
commitd34c620fae23597e0130474fe20883f0718ded58 (patch)
treeda89ba9fc2dcbc731fb3fd1e98dc25ad063455f8 /app/assets/javascripts/notes/stores/getters.js
parent487ed06f444892abce47a6e21aaea79c9ca9c800 (diff)
[ci skip] Add issue data and notes data provided through haml to the store to stop querying the DOM everywhere
Diffstat (limited to 'app/assets/javascripts/notes/stores/getters.js')
-rw-r--r--app/assets/javascripts/notes/stores/getters.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes/stores/getters.js b/app/assets/javascripts/notes/stores/getters.js
index c3a9f0a5e89..2db3c3f02af 100644
--- a/app/assets/javascripts/notes/stores/getters.js
+++ b/app/assets/javascripts/notes/stores/getters.js
@@ -1,10 +1,12 @@
export const notes = state => state.notes;
-
export const targetNoteHash = state => state.targetNoteHash;
+export const getNotesDataByProp = state => prop => state.notesData[prop];
+export const getIssueDataByProp = state => prop => state.notesData[prop];
+export const getUserDataByProp = state => prop => state.notesData[prop];
export const notesById = (state) => {
const notesByIdObject = {};
-
+ // TODO: FILIPA: TRANSFORM INTO A REDUCE
state.notes.forEach((note) => {
note.notes.forEach((n) => {
notesByIdObject[n.id] = n;