Skip to content

DCC bug 697 - Fix for a roadmap-wide bug where the following were#3119

Merged
briri merged 2 commits intodevelopmentfrom
dcc_bug_697_api_v1_contact_displaying_email_for_name
Mar 3, 2022
Merged

DCC bug 697 - Fix for a roadmap-wide bug where the following were#3119
briri merged 2 commits intodevelopmentfrom
dcc_bug_697_api_v1_contact_displaying_email_for_name

Conversation

@johnpinto1
Copy link
Contributor

@johnpinto1 johnpinto1 commented Mar 3, 2022

failing in the REST API V1 call "GET 0/api/v1/plans"
for following reasons:
(1) Plans policy initialize method was broken
(2) Each plan in the json array was using the email for the user name.

Fix for DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/697

Changes made:
(1) The initialize method in /policies/api/v1/plans super call requires
no arguments, it was taking the ApiClient as an argument.
(2) In /views/api/v1/contributors/_show.json.jbuilder we changed
json.name as follows as we were previously using the 'User' rather than
'Contributor' object
json.name contributor.is_a?(User) ? contributor.name(false) : contributor.name

@johnpinto1
Copy link
Contributor Author

@briri & @raycarrick-ed I don't think Tests error are due to changes I made.

failing in the REST API V1 call "GET 0/api/v1/plans"
for following reasons:
(1) Plans policy initialize method was broken
(2) Each plan in the json array was using the email for the user name.

DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/697

Changes made:
(1) The initialize method in /policies/api/v1/plans super call requires
no arguments, it was taking the ApiClient as an argument.
(2) In /views/api/v1/contributors/_show.json.jbuilder we changed
json.name as follows as we were previously using the 'User' rather than
'Contributor' object
 json.name contributor.is_a?(User) ? contributor.name(false) : contributor.name
@johnpinto1 johnpinto1 force-pushed the dcc_bug_697_api_v1_contact_displaying_email_for_name branch from ef0f851 to 4ef7b22 Compare March 3, 2022 12:15
Copy link
Contributor

@briri briri 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 @johnpinto1

@briri
Copy link
Contributor

briri commented Mar 3, 2022

The tests are failing due to a dependency issue with the JS karma tests. I have commented the karma tests out in my PR, #3117. I think we should just eventually convert those over to feature RSpec tests since our strengths lie in the Ruby/Rails world instead of the JS world

@johnpinto1
Copy link
Contributor Author

@briri & @raycarrick-ed I have added a commit that comments out the Karma tests as suggested.

@briri briri merged commit 8812ec1 into development Mar 3, 2022
@briri briri deleted the dcc_bug_697_api_v1_contact_displaying_email_for_name branch March 3, 2022 17:20
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