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

Serve SharePoint documents from generic view #5989

Merged
merged 7 commits into from
Mar 6, 2025

Conversation

oliverjwroberts
Copy link
Contributor

@oliverjwroberts oliverjwroberts commented Mar 5, 2025

Description of change

Users wish to see all files/documents relating to a company under a new "files" tab on the company overview page. The caveat is this collection list should show files of various types: those in SharePoint, those uploaded to an S3 bucket, and maybe others in the future.

See CLS2-1300, CLS2-1301, and CLS2-1304 for more information.

This PR adds a model for a SharePointDocument (as we are focusing on this type for the MVP), as well as a GenericDocument which has generic relations to the type-specific document model, and the related object, which in this instance is a Company. However, this may be extended to InvestmentProject's, or other models, in the future.

It also adds a serializer and viewset to enable the retrieval of one or multiple GenericDocument instances, along with the ability to sort the results on the created_on field, and filter them by realted_object_id.

Checklist

  • Has this branch been rebased on top of the current main branch?

    Explanation

    The branch should not be stale or have conflicts at the time reviews are requested.

  • Is the CircleCI build passing?

General points

Other things to check

  • Make sure fixtures/test_data.yaml is maintained when updating models
  • Consider the admin site when making changes to models
  • Use select-/prefetch-related field lists in views and search apps, and update them when fields are added
  • Make sure the README is updated e.g. when adding new environment variables

See docs/CONTRIBUTING.md for more guidelines.

@oliverjwroberts oliverjwroberts self-assigned this Mar 5, 2025
@oliverjwroberts oliverjwroberts requested a review from a team as a code owner March 5, 2025 16:09
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.65%. Comparing base (c0d85af) to head (787cf42).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5989      +/-   ##
==========================================
+ Coverage   96.64%   96.65%   +0.01%     
==========================================
  Files        1085     1089       +4     
  Lines       25486    25580      +94     
  Branches     1687     1690       +3     
==========================================
+ Hits        24630    24724      +94     
  Misses        699      699              
  Partials      157      157              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@DeanElliott96 DeanElliott96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, small suggestion to move test utility functions into the tests folders.

@oliverjwroberts oliverjwroberts merged commit 68c27c0 into main Mar 6, 2025
7 checks passed
@oliverjwroberts oliverjwroberts deleted the feature/CLS2-1304-serve-sharepoint-documents branch March 6, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants