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

BHBC-2076: Display Templates from S3 #910

Merged
merged 26 commits into from
Jan 16, 2023
Merged

BHBC-2076: Display Templates from S3 #910

merged 26 commits into from
Jan 16, 2023

Conversation

curtisupshall
Copy link
Contributor

@curtisupshall curtisupshall commented Jan 11, 2023

Overview

Render live S3 bucket contents on the Resources page.

Guide for updating templates: https://apps.nrs.gov.bc.ca/int/confluence/display/TASHIS/Updating+Resource+Templates

Links to Jira tickets

Description of relevant changes

  • Adds a new endpoint and API hook for retreiving S3 files through the backend;
  • Removes hardcoded links to S3 from the Resources page;
  • Adds helper functions for retrieving lists of files for a given S3 folder
  • Replaces globally-scoped variables in the file utils module with appropriate getters

PR Checklist

Code

  • New files/classes/functions have appropriately descriptive names and comment blocks to describe their use/behaviour
  • I have avoided duplicating code when possible, moving re-usable pieces into functions
  • I have avoided hard-coding values where possible and moved any re-usable constants to a constants file
  • My code is as flat as possible (avoids deeply nested if/else blocks, promise chains, etc)
  • My code changes account for null/undefined values and handle errors appropriately
  • My code uses types/interfaces to help describe values/parameters/etc, help ensure type safety, and improve readability

Style

  • My code follows the established style conventions
  • My code uses native material-ui components/icons/conventions when possible

Documentation

  • I have commented my code sufficiently, such that an unfamiliar developer could understand my code
  • I have added/updated README's and related documentation, as needed

Tests

  • I have added/updated unit tests for any code I've added/updated
  • I have added/updated the Postman requests/tests to account for any API endpoints I've added/updated

Linting/Formatting

  • I have run the linter and fixed any issues, as needed
    See the lint commands in package.json
  • I have run the formatter and fixed any issues, as needed
    See the format commands in package.json

SonarCloud

  • I have addressed all SonarCloud Bugs, Vulnerabilities, Security Hotspots, and Code Smells

@codecov
Copy link

codecov bot commented Jan 11, 2023

Codecov Report

Merging #910 (0159c57) into dev (43fd16b) will decrease coverage by 0.04%.
The diff coverage is 43.85%.

@@            Coverage Diff             @@
##              dev     #910      +/-   ##
==========================================
- Coverage   66.48%   66.44%   -0.05%     
==========================================
  Files         339      345       +6     
  Lines       10877    11073     +196     
  Branches     1908     1944      +36     
==========================================
+ Hits         7232     7357     +125     
- Misses       3243     3299      +56     
- Partials      402      417      +15     
Impacted Files Coverage Δ
.../src/paths/project/{projectId}/participants/get.ts 96.00% <ø> (ø)
api/src/paths/user/list.ts 85.71% <ø> (ø)
api/src/paths/user/self.ts 96.29% <ø> (ø)
api/src/paths/user/{userId}/get.ts 96.42% <ø> (ø)
api/src/repositories/error-repository.ts 100.00% <ø> (ø)
api/src/repositories/project-repository.ts 83.92% <ø> (ø)
api/src/repositories/validation-repository.ts 84.21% <ø> (ø)
api/src/services/summary-service.ts 82.14% <0.00%> (-2.61%) ⬇️
...utils/media/csv/validation/csv-header-validator.ts 94.44% <ø> (ø)
api/src/utils/media/media-utils.ts 78.72% <ø> (ø)
... and 51 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@curtisupshall curtisupshall marked this pull request as ready for review January 12, 2023 19:21
KjartanE
KjartanE previously approved these changes Jan 13, 2023
Copy link
Contributor

@KjartanE KjartanE left a comment

Choose a reason for hiding this comment

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

🎮

Copy link
Collaborator

@NickPhura NickPhura left a comment

Choose a reason for hiding this comment

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

Was trying it in Openshfit, and the download button for a resource doesn't seem to work. The page refreshes and I get kicked back the the project list page, and no file is downloaded.

If I copy the url from the download button and paste it into my browser, then it does download the file, but clicking the button doesn't seem to work for me.

(Same behaviour in Firefox, Chrome and Edge)

@curtisupshall
Copy link
Contributor Author

Was trying it in Openshfit, and the download button for a resource doesn't seem to work. The page refreshes and I get kicked back the the project list page, and no file is downloaded.

If I copy the url from the download button and paste it into my browser, then it does download the file, but clicking the button doesn't seem to work for me.

(Same behaviour in Firefox, Chrome and Edge)

Good catch! Fixed with 03a6bc3.

NickPhura
NickPhura previously approved these changes Jan 16, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@curtisupshall curtisupshall merged commit e63f674 into dev Jan 16, 2023
@curtisupshall curtisupshall deleted the BHBC-2076 branch January 16, 2023 21:55
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