Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add collaboration UI #1491

Merged
merged 121 commits into from Sep 23, 2021
Merged

Add collaboration UI #1491

merged 121 commits into from Sep 23, 2021

Commits on Sep 9, 2021

  1. Added tests for getCollaborators method from CollaboratorsRepository

    The SimperiumCollaboratorsRepository now has a dependency for
    Bucket<Note>, thus, all tests that use the instance directly had to be
    updated.
    danilo04 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    f190dd7 View commit details
    Browse the repository at this point in the history
  2. Added more tests to getCollaborators in case the note is deleted/trash

    Given that notes are synchronized across different devices, there may
    be the case in which a user will try to get the collaborators of a note
    that was deleted or is in the trash. For those cases, we cannot add
    collaborators.
    danilo04 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    099f6d0 View commit details
    Browse the repository at this point in the history
  3. Format file for git

    danilo04 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    8504289 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e37d61d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e3b5a75 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8d0c126 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    650f353 View commit details
    Browse the repository at this point in the history
  8. Refactor getCollaborators to use a generic method that is reused

    Created the getNote method that will be reused in addCollaborator and
    getCollaborators since these methods need a Note object.
    danilo04 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    4323206 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    6077431 View commit details
    Browse the repository at this point in the history
  10. Remove validation in CollaboratorsRepository

    Collaborator validation should not be responsibility of
    addCollaborators.
    danilo04 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    78804ca View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    cb02c32 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f23d6b3 View commit details
    Browse the repository at this point in the history
  13. Change methods that load a note in CollaboratorsRepository to suspend

    Since loading a note does a database query, we change all the methods
    in SimperiumCollaboratorsRepository to suspend methods. To be able to
    test properly the repository, we need to inject the dispatcher, so we
    updated the dispatcher in all the test and created a provider for Hilt.
    danilo04 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    e2cd8da View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2021

  1. Fix format in GetTagsUseCase

    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    f56fee0 View commit details
    Browse the repository at this point in the history
  2. Move NoteTest to unit tests directory since it doesn't require emulator

    Tests on model does not require emulator. They can run fast and are
    better suited to run as unit tests instead of connected tests.
    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    4d42dd5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cf7b357 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b1c96ca View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f92cca8 View commit details
    Browse the repository at this point in the history
  6. Refactor TagValidationResult to be part of ValidateTagUseCase

    Make explicit that TagValidationResult is part and just used in
    ValidateTagUseCase.
    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    a59dacf View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    cb75708 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    542abb0 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9ff6d51 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f480b6c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ace9aee View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    3c1893c View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6526a9a View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a1226cd View commit details
    Browse the repository at this point in the history
  15. Reformat test cases

    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    ec634b3 View commit details
    Browse the repository at this point in the history
  16. Reformat test cases

    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    9a565bc View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    cc75ba6 View commit details
    Browse the repository at this point in the history
  18. Added tests for getCollaborators method from CollaboratorsRepository

    The SimperiumCollaboratorsRepository now has a dependency for
    Bucket<Note>, thus, all tests that use the instance directly had to be
    updated.
    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    9f4da82 View commit details
    Browse the repository at this point in the history
  19. Added more tests to getCollaborators in case the note is deleted/trash

    Given that notes are synchronized across different devices, there may
    be the case in which a user will try to get the collaborators of a note
    that was deleted or is in the trash. For those cases, we cannot add
    collaborators.
    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    6c6cf72 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    26b0b72 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    4368547 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    f0b0038 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    abe2a13 View commit details
    Browse the repository at this point in the history
  24. Remove validation in CollaboratorsRepository

    Collaborator validation should not be responsibility of
    addCollaborators.
    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    8e00d4c View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    3886d18 View commit details
    Browse the repository at this point in the history
  26. Change methods that load a note in CollaboratorsRepository to suspend

    Since loading a note does a database query, we change all the methods
    in SimperiumCollaboratorsRepository to suspend methods. To be able to
    test properly the repository, we need to inject the dispatcher, so we
    updated the dispatcher in all the test and created a provider for Hilt.
    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    c7cacb8 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    81248eb View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    a5cf149 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    09539c9 View commit details
    Browse the repository at this point in the history
  30. Add tests for CollaboratorsViewModel

    Add tests for loadCollaborators and removeCollaborator. Add collaborator
    will be handled in another ViewModel.
    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    c229a96 View commit details
    Browse the repository at this point in the history
  31. Implement loadCollaborators and removeCollaborators

    Moved NoteInTrash and NoteDeleted as UiState since the UI must make a
    decision when the note is in trash or deleted. The ViewModel will not
    provide collaborators for notes in these states.
    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    164bdfb View commit details
    Browse the repository at this point in the history
  32. Remove event field in CollaboratorsViewModel

    This field is not needed now but might be added later when UI is
    implemented.
    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    73cb547 View commit details
    Browse the repository at this point in the history
  33. Clean imports

    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    989ad8a View commit details
    Browse the repository at this point in the history
  34. Fix warning in layout

    danilo04 committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    4db6c32 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2021

  1. Add Empty UiState for collaborators

    In case there are not collaborators added, a special state is returned
    since the UI will perform certain actions for this case.
    danilo04 committed Sep 14, 2021
    Configuration menu
    Copy the full SHA
    52484cf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dc2eb09 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    91faf5a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3869c29 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4960180 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1288c87 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    72f814b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1974cbf View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    53d4855 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    951d9ff View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    8eedbe9 View commit details
    Browse the repository at this point in the history
  12. Add remove collaborator dialog and action to event

    Show an alert dialog before removing a collaborator. In case the user
    taps on Remove, then call the ViewModel to remove the collaborator.
    danilo04 committed Sep 14, 2021
    Configuration menu
    Copy the full SHA
    a8aac3a View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2021

  1. Reuse the mock notes bucket

    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    8060e8b View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary class

    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    07cddcd View commit details
    Browse the repository at this point in the history
  3. Add AddCollaboratorViewModel to handle UI state to add collaborator UI

    Initial version without implementation of AddCollaboratorViewModel.
    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    f9b35a0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    81bc463 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4524e01 View commit details
    Browse the repository at this point in the history
  6. Reorganize strings

    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    33c653d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    da63130 View commit details
    Browse the repository at this point in the history
  8. Add noteId parameter to AddCollaboratorEvent

    The noteId is sent to the fragment so it can add the collaborator to the
    correct Note
    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    9fc0768 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c3d6f53 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2472473 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    09a82e4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    01acd51 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    8c3dfd9 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    e58d5d9 View commit details
    Browse the repository at this point in the history
  15. Add support for update on collaborators locally and from the network

    Listen to changes on the note that might mean the collaborators were
    updated. This works for when a new collaborator is added locally or
    from another client.
    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    a34ed2f View commit details
    Browse the repository at this point in the history
  16. Remove progress dialog in collaborators list

    The list of collaborators is obtained from a single note. Loading the
    note is not a heavy task, thus, the progress bar in this case is
    overkill.
    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    2f09db5 View commit details
    Browse the repository at this point in the history
  17. Handle cases when the note is trashed or deleted

    If the user is editing the collaborators of a note that is trashed or
    deleted, the user is returned to the list of activities since
    collaborators cannot be added to trashed or deleted notes.
    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    a11cccd View commit details
    Browse the repository at this point in the history
  18. Fix collaborators layout

    Improve positioning of views in layout to handle list of collaborators.
    The list is scrollable to handle long list of collaborators.
    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    cdaab94 View commit details
    Browse the repository at this point in the history
  19. Handle data for AddCollaboratorFragment through arguments

    When the configuration changes, Android tries to recreate the dialog
    fragment. Since the previous AddCollaboratorFragment's constructor
    had one parameter, the instance could be recreated. Now we pass the
    note ID through Bundle objects as arguments.
    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    31adb38 View commit details
    Browse the repository at this point in the history
  20. Reformat AndroidManifest.xml

    Reformat manifest with the previous format and add CollaboratorsActivity
    with android:configChanges="orientation|keyboardHidden|screenSize"
    danilo04 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    3a6fc8a View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2021

  1. Maintain instance of fragment when configuration change

    Now the fragment stays when the configuration changes, thus, we do not
    have to handle instance creation.
    danilo04 committed Sep 16, 2021
    Configuration menu
    Copy the full SHA
    af4191a View commit details
    Browse the repository at this point in the history
  2. Avoid updating collaborators list after collaborator removed

    The action of removing a collaborator will be handled by the flow when
    the collaborators changed.
    danilo04 committed Sep 16, 2021
    Configuration menu
    Copy the full SHA
    3d5ec3c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0b34083 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b233ddf View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1fbb316 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    564a7fd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1875ab8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4ade889 View commit details
    Browse the repository at this point in the history
  9. Add empty line for git

    danilo04 committed Sep 16, 2021
    Configuration menu
    Copy the full SHA
    6fd52e0 View commit details
    Browse the repository at this point in the history
  10. Add empty line for git

    danilo04 committed Sep 16, 2021
    Configuration menu
    Copy the full SHA
    066aed3 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    119c408 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2021

  1. Configuration menu
    Copy the full SHA
    0e1bbb6 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2021

  1. Change label for track event

    danilo04 committed Sep 20, 2021
    Configuration menu
    Copy the full SHA
    b124559 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    027ae7e View commit details
    Browse the repository at this point in the history
  3. Use IO context just for getNote

    Use the IO dispatcher in the getNote method and let all other three
    methods free of using any dispatcher.
    danilo04 committed Sep 20, 2021
    Configuration menu
    Copy the full SHA
    fa33aa2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cb3d1ad View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9d054fd View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bb411c5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d0f7531 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    79168d2 View commit details
    Browse the repository at this point in the history
  9. Flip setupViews and setObservers

    Keep consistency on how the two methods are layered afterwards.
    danilo04 committed Sep 20, 2021
    Configuration menu
    Copy the full SHA
    c248403 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f44e932 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9cff3e1 View commit details
    Browse the repository at this point in the history
  12. Remove blank spaces

    danilo04 committed Sep 20, 2021
    Configuration menu
    Copy the full SHA
    833acdf View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    198ee8b View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    f731ffc View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    78df3d6 View commit details
    Browse the repository at this point in the history
  16. Remove incorrect comment

    danilo04 committed Sep 20, 2021
    Configuration menu
    Copy the full SHA
    d321b84 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    a2229c9 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    af1df21 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    0918454 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    8cd381c View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    9c93954 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2021

  1. Add tests for calls to collaboratorsChanged() method

    To be able to test this method, we need to mock the whole class. We mock
    CollaboratorsRepository and all the calls that the tests made.
    danilo04 committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    56de650 View commit details
    Browse the repository at this point in the history
  2. Add IO dispatcher parameter to SimperiumTagsRepository

    This is mostly for testing purposes since it is easier to inject a test
    dispatcher to avoid multithreading bugs in the testing library for
    coroutines.
    danilo04 committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    32eca5b View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2021

  1. Configuration menu
    Copy the full SHA
    74171ed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    74730be View commit details
    Browse the repository at this point in the history
  3. Inflate layout for dialog using the context themed wrapper

    Even though the dialog was using the correct mode (light or dark), the
    view inside the dialog was not. To make the view inside the dialog mode
    aware, we use the context theme wrapper to inflate the layout.
    danilo04 committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    84ee1e4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4fc4d25 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    48d67ef View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2021

  1. Configuration menu
    Copy the full SHA
    208f343 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dbaf20c View commit details
    Browse the repository at this point in the history