feat(focus-group): discussion guide editor, models, controller and store#2147
Open
mohi-devhub wants to merge 5 commits into
Open
feat(focus-group): discussion guide editor, models, controller and store#2147mohi-devhub wants to merge 5 commits into
mohi-devhub wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Builds out the Focus Group module beyond the creation skeleton by adding persisted discussion-guide/config models, a controller + Vuex integration, and an editor UI (including routing/navigation) with EN/ES strings.
Changes:
- Add
DiscussionTopicandFocusGroupConfigmodels and integrate them intoFocusGroupStudyFirestore serialization. - Introduce
FocusGroupController+FocusGroupVuex module and wire save behavior for the discussion guide. - Add an edit route/view and a
DiscussionGuideEditorcomponent, plus navigation and translations.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ux/FocusGroup/views/ManagerView.vue | Adds a new navigation item linking to the discussion guide edit route. |
| src/ux/FocusGroup/views/EditFocusGroupView.vue | New edit screen that hydrates topics from the loaded study and persists them via Vuex action. |
| src/ux/FocusGroup/store/FocusGroup.js | New Focus Group Vuex module with actions for fetching/saving discussion guide. |
| src/ux/FocusGroup/router.js | Registers the edit route under the Focus Group manager route tree. |
| src/ux/FocusGroup/models/FocusGroupStudy.js | Adds typed discussionGuide + config handling and Firestore serialization. |
| src/ux/FocusGroup/models/FocusGroupConfig.js | New model for persisted Focus Group session configuration. |
| src/ux/FocusGroup/models/DiscussionTopic.js | New model for discussion-guide topic structure and serialization. |
| src/ux/FocusGroup/controllers/FocusGroupController.js | New repository/controller for reading and updating discussion guide/config on the tests document. |
| src/ux/FocusGroup/components/DiscussionGuideEditor.vue | New UI editor for topic CRUD, prompt management, and reordering. |
| src/store/index.js | Registers the new Focus Group Vuex module in the global store. |
| src/app/plugins/locales/es.json | Adds Focus Group edit strings and updates manager copy (ES). |
| src/app/plugins/locales/en.json | Adds Focus Group edit strings and updates manager copy (EN). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+60
to
+63
| onMounted(async () => { | ||
| if (!test.value) await store.dispatch('getStudy', { id: route.params.id }) | ||
| hydrate(test.value) | ||
| }) |
Comment on lines
+22
to
+26
| async getFocusGroup({ commit }, id) { | ||
| const study = await focusGroupController.getById(id) | ||
| commit('SET_FOCUS_GROUP', study) | ||
| return study | ||
| }, |
|
| */ | ||
| export default class DiscussionTopic { | ||
| constructor({ id, title, prompts, durationMinutes } = {}) { | ||
| this.id = id ?? DiscussionTopic.generateId() |
Comment on lines
+16
to
+23
| static generateId() { | ||
| if (typeof crypto !== 'undefined' && crypto.randomUUID) { | ||
| return `topic-${crypto.randomUUID()}` | ||
| } | ||
| const array = new Uint32Array(2) | ||
| crypto.getRandomValues(array) | ||
| return `topic-${Date.now()}-${array[0].toString(36)}${array[1].toString(36)}` | ||
| } |
Comment on lines
+11
to
+17
| async getById(id) { | ||
| const res = await this.readOne(COLLECTION, id) | ||
| return instantiateStudyByType(STUDY_TYPES.FOCUS_GROUP, { | ||
| id: res.id, | ||
| ...res.data(), | ||
| }) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Builds out the Focus Group module on top of the creation skeleton (#2146): data models, data layer, and a working discussion guide editor with persistence.
Changes
DiscussionTopicandFocusGroupConfigmodels, integrated intoFocusGroupStudyFocusGroupController(reads and persists the discussion guide + config) and aFocusGroupVuex module, registered in the storeEditFocusGroupView+DiscussionGuideEditor: add, edit, delete, reorder topics, manage prompts, set durationsTesting
Verified end to end on the Firebase emulator: create a Focus Group study, edit the guide, save, and confirm the
discussionGuidearray andconfigmap persist correctly on thetestsdocument. Lint clean, i18n parity passes, build succeeds.Discussion Guide - Video
Discussion-Guide-Flow-Low.mp4
Closes #2134
Closes #2135
Closes #2136