From 59642fc66e5f2a7ca7d3e9e9771b90a6d7334455 Mon Sep 17 00:00:00 2001 From: Gail Terman Date: Tue, 16 Aug 2022 08:53:00 -0400 Subject: [PATCH 1/5] fix hash links --- app/javascript/app.vue | 4 ++- app/javascript/components/hash_link.vue | 21 +++++++++++++++ app/javascript/reports/reports_screen.vue | 32 +++++++++++++---------- app/javascript/shared/hash-links.mixin.js | 9 +++++++ 4 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 app/javascript/components/hash_link.vue create mode 100644 app/javascript/shared/hash-links.mixin.js diff --git a/app/javascript/app.vue b/app/javascript/app.vue index ceb044aaa..668afc55c 100644 --- a/app/javascript/app.vue +++ b/app/javascript/app.vue @@ -32,6 +32,7 @@ import VueCal from 'vue-cal' import 'vue-cal/dist/vuecal.css' import { mapState, mapActions } from 'vuex'; import { FETCH_WORKFLOWS } from '@/store/schedule_workflow'; +import { hashLinksMixin } from './shared/hash-links.mixin'; extend('email', email); extend('numeric', numeric); @@ -54,7 +55,7 @@ export default { BottomNavbar, SignAgreements }, - mixins: [personSessionMixin, settingsMixin], + mixins: [personSessionMixin, settingsMixin, hashLinksMixin], data() { return { showOverlay: false @@ -83,6 +84,7 @@ export default { this.fetchSettings(); // fetch the schedule state too this.fetchScheduleWorkflows(); + setTimeout(() => this.scrollFix(this.$route.hash), 1) } } diff --git a/app/javascript/components/hash_link.vue b/app/javascript/components/hash_link.vue new file mode 100644 index 000000000..53a606806 --- /dev/null +++ b/app/javascript/components/hash_link.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/app/javascript/reports/reports_screen.vue b/app/javascript/reports/reports_screen.vue index 669d09a9d..10f348b80 100644 --- a/app/javascript/reports/reports_screen.vue +++ b/app/javascript/reports/reports_screen.vue @@ -2,11 +2,11 @@

These are interim reports.

Participants
@@ -321,9 +321,13 @@ - - diff --git a/app/javascript/shared/hash-links.mixin.js b/app/javascript/shared/hash-links.mixin.js deleted file mode 100644 index f82610d4b..000000000 --- a/app/javascript/shared/hash-links.mixin.js +++ /dev/null @@ -1,9 +0,0 @@ -export const hashLinksMixin = { - methods: { - scrollFix: function(hashbang) { - location.hash = hashbang; - } - } -} - -export default hashLinksMixin; From ba4973ae2cef0911a5a08272f142bcdc19d4b808 Mon Sep 17 00:00:00 2001 From: Gail Terman Date: Wed, 17 Aug 2022 08:57:53 -0400 Subject: [PATCH 5/5] remove extra line --- app/javascript/app.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/app/javascript/app.vue b/app/javascript/app.vue index e12c2e877..ceb044aaa 100644 --- a/app/javascript/app.vue +++ b/app/javascript/app.vue @@ -83,7 +83,6 @@ export default { this.fetchSettings(); // fetch the schedule state too this.fetchScheduleWorkflows(); - setTimeout(() => this.scrollFix(this.$route.hash), 1) } }