---
# System prepended metadata

title: Submissions work by Fin & Mahaki
tags: [ahau-notes, submissions, ahau]

---

# Submissions work by Fin & Mahaki

###### tags: `ahau-notes` `submissions` `ahau`

List of important files related to ssb-submissions 
- ahau/ui 
    - **/ahau/ui/src/store/modules/notifications/index.js**
        - contains getAllNotifications() which displays notifs
        - [ ] Needs a method to list all submissions. There are more detailed comments explaining what is needed and where in the file 
    - **/ahau/ui/src/components/menu/NotificationsList.vue**
        - Displays notifs, checks submission type and changes the notification dialog based on that type
        - [ ] The submission type is currently just a hard-coded string in our dummy data. Either you will need some front end logic to figure out the submission type or ideally create a variable in ssb-submissions for it. This is explain in more detail in the file 
    - **/ahau/ui/src/components/dialog/profile/SideNodeDialog.vue**
        - logic to check if whakapapa is submission, and if so "send" button is replaced with "submit"
        - under processUpdatePerson() we check if the whakapapa is a submit only, and if so call editProfileSubmission instead of making the edit
            - processUpdatePerson() creates the profile edit submission. It takes the following parameters: the profile id, the groupId (to be changed to the poBoxId), the change details, and optionally a comment and recps 
            - [ ] need to change groupId to poBoxId. There is working code and more details in the file for it under processUpdatePerson
    - **ahau/ui/src/components/dialog/DialogHandler.vue**
        - contains links for submission dialogs (UpdateProfileDialog, AddRelativeDialog, etc)
        - contains code which replaces 'send' with 'submit' if the whakapapa is submit only
        - under addPerson(), we check if whakapapa is submit only, and if so call submitAddPerson instead of adding the person 
    - **ahau/ui/src/lib/submission-helpers.js**
        - defines gql mutations and queries related to submissions 
    - **/ahau/ui/src/components/dialog/submission**
        - contains the vue files for notifications 
        - 
            - **UpdateProfileDialog.vue**
                - Handles updating a profile and displays the information relating to the update to the kaitiaki.
                - when the kaitiaki clicks approve or deline, the submit method is called with the result passed in. If the kaitiaki approves the submission, updatePerson() is called which executes the changes
                - [ ] the this.notification.comments is very weird. It contains the comment as intended, but for some reason the key is the id of the profile who suggested the change. Probably a mistake in the backend?
                - [ ] approve/decline throws a strange error if the comment isn't inputted, even though the comment isn't required. We input a empty comment currently to sidestep that issue 
            - **RemoveRelativeDialog.vue (prototype)**
                - Handles the removal of parents, partners, children and siblings to a profile
                - Reject / approve buttons call the submit method. Rejection closes notification, approval directly updates profile in updatePerson()
                - [ ] needs to call approveSubmission()/declineSubmission after the kaitiaki makes a decision 
            - **AddRelativeDialog.vue (prototype)**
                
                - Handles the addition of parents, partners, children and siblings to a profile
                - Reject / approve buttons call the submit method. Rejection closes notification, approval directly updates profile in updatePerson()
                - [ ] This prototype is almost done. However, the dummy data it was taking as input is formatted slightly differently to how the notification data is formatted. You should be able to fix it by changing the computed properties that no longer fit, for example changes() expects the profile addition information to be at notifications.changes, but once the backend is hooked up this will need to be changed 
                - [ ] needs to call approveSubmission()/declineSubmission after the kaitiaki makes a decision 
                - [ ] very light gray border line when viewing the profile to be added, can't figure out how to remove it 
- **ahau/lib/graphql/Ssb Graphql Submissions** (we might want to rename this)
    - resolvers.js
        - contains a getSubmissionGroupPerson query
        - contains mutations for submitNewGroupPerson, proposeEditGroupPerson, approveSubmission and rejectSubmission, all of which seem to be working in the tests.
        - [ ] needs proposeTombstoneGroupPerson, tombstoneSubmission and whakapapa link. 
        - [ ] changing profile picture did not work in the test implementation, should work in the final implementation but we need to test it
    - type-defs.js
        - Contains schemas for the graphql queries?
    - create-submission.test.js
        - Contains unit testing of type-defs.js and resolvers.js

- **ahau/lib/ssb-plugins/ssb-submissions**
    - contains all the needed methods except for some kind of list notifications or get all notifs method.
    - make sure to use Fin_and_mahaki_tests, as the latest changes in the proposeEdit file fix a bug where trying to make a profile change will give you an "invalid details" error.
    - [x] working but could do with more extensive testing  
