From ac71675d3096ac9317ea230a408d69029bdadc73 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Mon, 9 Jul 2018 18:13:41 +0100 Subject: Fixes toggle discussion button not expanding collapsed discussions Discussions were being toggled by jquery DOM querying them and toggling visibility but in vue, only the open discussions will be in the DOM Fix includes: - Adds a getter to the store to get the expanded discussions - Adds an action to collapse a discussion - When the user clicks the button, all data needed is now accessible through a getter and we can dispatch an action to toggle the discussion within the state, instead of showing/hiding with jQuery - Removes hardcoded properties Resolves #48237 --- .../diffs/components/diff_file_header.vue | 17 +++++++--- app/assets/javascripts/diffs/store/actions.js | 31 +++++++++++++++++++ app/assets/javascripts/diffs/store/getters.js | 36 +++++++++++++++++++++- app/assets/javascripts/notes/stores/actions.js | 2 ++ .../javascripts/notes/stores/mutation_types.js | 4 +++ app/assets/javascripts/notes/stores/mutations.js | 5 +++ 6 files changed, 89 insertions(+), 6 deletions(-) (limited to 'app/assets/javascripts') diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue index 1957698c6c1..ac4f37512ec 100644 --- a/app/assets/javascripts/diffs/components/diff_file_header.vue +++ b/app/assets/javascripts/diffs/components/diff_file_header.vue @@ -1,5 +1,6 @@ @@ -216,9 +222,10 @@ export default { v-if="diffFile.blob && diffFile.blob.readableText" >