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 missing ResourcePolicyService #427
Conversation
81ca90d
to
63f7786
Compare
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 @AlexanderS !
Would you mind writing a spec file for resource-policy.service.ts? It doesn't have to be very complicated, just make sure that every new method is covered.
@atarix83 Since this is a change to the submission, and you know a lot more about its inner workings than I do, perhaps you could give it a review?
63f7786
to
a9e0386
Compare
a9e0386
to
97374d4
Compare
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 @AlexanderS for this PR and thanks @artlowel to mention me
@AlexanderS
you have created a DataServiceImpl
both for MetadataSchemaDataService
and ResourcePolicyService
. Is this delegation strictly necessary? If so I should separate classes in separated file as raccomended in Angular style guide https://angular.io/guide/styleguide#single-responsibility.
other than this there is a TypeScript error in resource-policy.service.spec.ts
file to resolve
@atarix83 I just fixed the typescript error. The |
@AlexanderS thanks for solving the typescript error. I hadn't seen the conversation with @artlowel, since we already have similar implementations please leave the code as it is although we do not follow Angular style guide |
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 @AlexanderS!
LGTM
@atarix83 you're right, these DataServiceImpl classes technically violate that rule in the style guide. But I don't think they violate the spirit of the rule: that each file should do one thing. All @AlexanderS did was split the code that was in that file anyway into a private and a public part.
While we could move that DataServiceImpl class to a separate file, it should never be used by anything other than ResourcePolicyService, so there isn't much of a point in my opinion.
* Do not show licenses if the Item doesn't have any file.
This adds the missing
ResourcePolicyService
. The call tothis.collectionDataService.findByHref
only succeeds, because the full href is used and typescript does not check the return type.I do not know if the
resouce-policy.service.ts
file should be placed in something likesrc/app/core/authz/
, but it's only a single file.