-
Notifications
You must be signed in to change notification settings - Fork 41
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
Improve project linking workflows API end point #3626
Conversation
copy the workflow and add to the projects.workflows relation instead of duplicating
expect(resource.workflows.first.id).to_not eq(workflow.id) | ||
end | ||
end | ||
|
||
context "copy linked subject_set" do | ||
context 'copy linked subject_set' do |
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.
RSpec/NestedGroups: Maximum example group nesting exceeded [4/3].
RSpec/ContextWording: Start context description with 'when', 'with', or 'without'.
context "copy linked workflow" do | ||
it 'should have the same tasks workflow' do | ||
expect(resource.workflows.first.tasks).to eq(workflow.tasks) | ||
context 'copy linked workflow' do |
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.
RSpec/NestedGroups: Maximum example group nesting exceeded [4/3].
RSpec/ContextWording: Start context description with 'when', 'with', or 'without'.
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
When linking workflow(s) to a project the current behaviour is to duplicate the workflow and save a new copy. This duplicate is basic and copies over existing context and values that make little or no sense in the new project (classification counts etc) while not allowing us to copy workflow relations (e.g. translations etc)
This PR introduces a
WorkflowCopier
class that allows custom copying logic for the Workflow resource and copy the translation resources as well.This
WorkflowCopier
class is now used instead of the basic AR.dup
method in the controller action to update the link relations.Additionally - my laptop was going crazy 'monitoring' the project files via guard (I may be the only one that uses this) so i updated the guard dependencies (improve the underlying FS libs for monitoring changes) and config (to reduce the number of files we are 'monitoring'). This massively improved the system for me and doesn't impact the behaviour of this PR just how i run my dev setup.
I realize this is an unrelated addition to the PR and if folks feel strongly i'll remove to it's own PR.
Review checklist
apiary.apib
file?