-
Notifications
You must be signed in to change notification settings - Fork 40
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 commenting for fuel suppliers #414
Add commenting for fuel suppliers #414
Conversation
Changelog: - Model created - Serializers created and adjuste - privileged_access boolean field to control API visibility of comments Todo: - Create new permission (VIEW|EDIT)_PRIVILIGED_COMMENT - Create route/viewSet to save comments - Wire up the frontend - Unit tests
API is now built and has thorough unit-testing
roles_permissions_v0.3.0.json
Adjusted permission class to use `'key' in dict` format rather than dict.has_key('key'). Confirmed working with Python 3.6.4
Unit Testing Fix
Added front-end code to show Credit Balance of the selected organization for IDIR Users Added a check on the user's permission before showing the balance of the organization Updated test_api_custom so it follows pep8 coding style a bit better Added MinSerializer for Organization to reduce the amount of data (and add security) coming in for Credit Trades
Added Declined indicator in the breadcrumbs
Rescinded as a Flag, instead of Status
…SQL reserved word
# Conflicts: # backend/api/fixtures/test_credit_trade_comments.json # backend/api/models/CreditTrade.py # backend/api/models/CreditTradeComment.py # backend/api/models/CreditTradeHistory.py # backend/api/models/User.py # backend/api/permissions/CreditTradeComment.py # backend/api/serializers/CreditTrade.py # backend/api/serializers/CreditTradeHistory.py # backend/api/services/CreditTradeService.py # backend/api/test_api.py # backend/api/test_api_credit_trade_comment.py # backend/api/test_credit_trades.py # backend/api/viewsets/CreditTrade.py # backend/nose.cfg # frontend/src/credit_transfers/CreditTransferViewContainer.js # frontend/src/credit_transfers/components/CreditTransferDetails.js # frontend/src/credit_transfers/components/CreditTransferFormButtons.js # frontend/src/credit_transfers/components/CreditTransferProgress.js # frontend/src/credit_transfers/components/CreditTransferTable.js
disabled={props.disabled.BTN_SIGN_2_2} | ||
title={props.permissions.BTN_SIGN_2_2 | ||
disabled={props.isCommenting || props.disabled.BTN_SIGN_2_2} | ||
title={props.isCommenting ? Lang.TEXT_COMMENT_DIRTY : (props.permissions.BTN_SIGN_2_2 |
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 know that eslint will complain about the nested ternary, but it's the most concise way to do this, and the parens make precedence unambiguous.
…r-fuel-suppliers # Conflicts: # backend/api/serializers/CreditTrade.py
Do you have a Trello card for this? |
Closes issue #395 (Trello card 688 https://trello.com/c/tGlVgY8P) |
@@ -0,0 +1,20 @@ | |||
# -*- coding: utf-8 -*- |
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.
Can you adjust the filename for this so it's incremented by 1? Just to avoid two 15's
@amichard I'll check that out. It's something to do with the spacing being different when the button is in disabled state. I haven't added any special rules so I'll dig into it. Regarding the buttons not appearing in review state, that's a business logic rule. Per Justin analysts should be able to comment when in signed 2/2 and reviewed and directors should only be able to comment when in reviewed. I created test fixture users for my test cases that have either RECOMMEND or (DECLINE|APPROVE) credit transfer but not both, in order to test the logic. |
- button styling - migration file names - also snuck in a column rename per comment on Trello card bcgov#688
@amichard All review comments addressed in latest push |
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.
Looks good!
This fixes the issue brought in by #414 Add commenting for fuel suppliers
…pliers. Changelog highlights: Added natural key lookups for User, Role, Permission, Credit Trade Status, and Type to ease test fixture creation Exhaustive testing suite to validate permissions are applied as specified by business logic Created a new test fixture with more production-like government roles to test finer-grained permissions Refactored commenting permissions to allow client and server to share the same logic (the server passes allowable commenting actions as part of a credit trade API response) Tooltips/disabled statuses for action buttons when commenting mode is active
This fixes the issue brought in by #414 Add commenting for fuel suppliers
This pull request introduces the commenting feature for fuel suppliers.
Changelog highlights: