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

FRI-182 Add setAuthorFlag endpoint #305

Merged
merged 1 commit into from
Aug 12, 2021
Merged

FRI-182 Add setAuthorFlag endpoint #305

merged 1 commit into from
Aug 12, 2021

Conversation

dmcgihtsdo
Copy link
Contributor

FRI-182 is concerned with adding functionality to allow flags to be associated with Criteria Items.

This feature relies on feature/FRI-182 of AAG.

@dmcgihtsdo dmcgihtsdo requested a review from kaicode August 11, 2021 13:50
@dmcgihtsdo dmcgihtsdo self-assigned this Aug 11, 2021
@@ -19,6 +19,8 @@
// Metadata for internal use only and can't be updated via branch metadata REST service
public static final String INTERNAL_METADATA_KEY = "internal";

public static final String AUTHOR_FLAGS_METADATA_KEY = "authorFlags";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

BranchMetadataHelper felt like the best location for the new AUTHOR_FLAGS_METADATA_KEY constant.

@@ -131,6 +132,26 @@ public void unlockBranch(@PathVariable String branch) {
branchService.unlock(branch);
}

@RequestMapping(value = "/branches/{branchPath}/actions/set-author-flag", method = RequestMethod.POST)
@PreAuthorize("hasPermission('AUTHOR', #branchPath)")
public BranchPojo setAuthorFlag(@PathVariable String branchPath, @RequestBody SetAuthorFlag setAuthorFlag) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method will receive a key/value and update the Branch's metadata accordingly.

Copy link
Member

@kaicode kaicode 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 to me.

@codecov
Copy link

codecov bot commented Aug 11, 2021

Codecov Report

Merging #305 (95c741c) into develop (811399f) will increase coverage by 0.03%.
The diff coverage is 95.65%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #305      +/-   ##
=============================================
+ Coverage      66.13%   66.17%   +0.03%     
- Complexity      3888     3896       +8     
=============================================
  Files            319      320       +1     
  Lines          16959    16982      +23     
  Branches        2315     2316       +1     
=============================================
+ Hits           11216    11237      +21     
- Misses          4819     4820       +1     
- Partials         924      925       +1     
Impacted Files Coverage Δ
...storm/core/data/services/BranchMetadataHelper.java 81.81% <ø> (ø)
...va/org/snomed/snowstorm/rest/BranchController.java 18.42% <90.90%> (+12.26%) ⬆️
.../org/snomed/snowstorm/rest/pojo/SetAuthorFlag.java 100.00% <100.00%> (ø)
...services/classification/ClassificationService.java 42.81% <0.00%> (-0.79%) ⬇️
...org/snomed/snowstorm/fhir/services/FHIRHelper.java 33.78% <0.00%> (+0.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 811399f...95c741c. Read the comment docs.

@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 1 Code Smell

96.3% 96.3% Coverage
0.0% 0.0% Duplication

@dmcgihtsdo dmcgihtsdo merged commit 3a39020 into develop Aug 12, 2021
@dmcgihtsdo dmcgihtsdo deleted the feature/FRI-182 branch August 12, 2021 10:46
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.

2 participants