-
Notifications
You must be signed in to change notification settings - Fork 19
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
Feature/deseng623 - Add frontend, update backend routes to use tenant short name #2538
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2538 +/- ##
========================================
Coverage 76.04% 76.05%
========================================
Files 617 604 -13
Lines 22093 21808 -285
Branches 1686 1671 -15
========================================
- Hits 16801 16586 -215
+ Misses 5028 4959 -69
+ Partials 264 263 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I'm excited to see the language system taking shape :) Just a couple optional things to address if you have time
@@ -5,7 +5,7 @@ | |||
|
|||
from http import HTTPStatus | |||
|
|||
from flask import jsonify, request | |||
from flask import request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch :)
style={{ marginTop: '5%', marginBottom: '5%', width: isSmallScreen ? '50%' : '100%' }} | ||
multiple | ||
// Prevent users from clearing all languages with a button click. | ||
clearIcon={<span style={{ display: 'none' }}></span>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the boolean property "disableClearable" could be used here for concision. (API reference)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thank you for finding that! I'll be switching
def delete(language_mapping_id): | ||
@_jwt.requires_auth | ||
@cross_origin(origins=allowedorigins()) | ||
def delete(language_id, tenant_short_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making sure all of this is consistent!
return 'Successfully deleted language-tenant mapping', HTTPStatus.NO_CONTENT | ||
raise ValueError('Language-tenant mapping not found') | ||
LanguageService.remove_language_mapping_from_tenant(language_id, tenant_short_name) | ||
return {'status': 'success', 'message': 'Tenant language deleted successfully'}, HTTPStatus.OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also return HTTP 204 No Content to indicate that the resource no longer exists, unless the message
is planned to be utilized by the app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered this for sure! Do you think there's a downside to having a message & 200 code returned on delete? I don't necessarily think that a 204 on delete is super idiomatic across the web
Quality Gate passedIssues Measures |
…odes (#2540) * DESENG-632 Add DB tables & API routes (#2533) * DESENG-632 Add DB tables & API routes * DESENG-623 fix linting * DESENG-623 Move language to migration file, remove delete crud language route * DESENG-623 Remove ability to delete language --------- Co-authored-by: Alex <[email protected]> * Feature/deseng623 - Add frontend, update backend routes to use tenant short name (#2538) * DESENG-623 Add frontend, update backend routes * DESENG-623 Add api route updates, correct linting * DESENG-623 Correctly invoke autocomplete api to disable claering --------- Co-authored-by: Alex <[email protected]> * DESENG-623 Add frontend tests, trim api tests * DESENG-623 Add frontend tests * DESENG-623 Add new tests, fix broken ones, merge migrations * DESENG-623 Update changelog * DESENG-623 fix linting and tests, clean up code further --------- Co-authored-by: Alex <[email protected]>
Issue #: https://github.com/bcgov/met-public/issues/
Description of changes:
Remaining work:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the met-public license (Apache 2.0).