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

merging participant list with participant tracker [#146186631] #30

Merged
merged 6 commits into from
Jun 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 0 additions & 54 deletions app/views/protocols/_participant_list.html.haml

This file was deleted.

12 changes: 9 additions & 3 deletions app/views/protocols/_participant_tracker.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,23 @@
-# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.~

%h3= t(:participant)[:tracker]
#custom-toolbar
%button.btn.btn-primary.new-participant{type: "button", data: {protocol_id: protocol.id}, aria: {label: "Create Participant"}}=t(:participant)[:new_participant]
#participant_tracker
%table.participants{id: "participants-tracker-table", data: {toggle: 'table', search: "true", height: "400", url: participants_path(protocol_id: protocol.id, format: :json), striped: "true", show: {columns: "true", refresh: "true", export: "true", toggle: "true"}, export: {types: ['excel']}, select: {item: {name: "toolbar1"}}, sort: {name: 'last_name', order: 'asc'}}}
%table.participants{id: "participants-tracker-table", data: {toggle: 'table', search: "true", toolbar: '#custom-toolbar', url: participants_path(protocol_id: protocol.id, format: :json), striped: "true", height: "400", sort: {name: 'last_name', order: 'asc'}, show: {columns: "true", refresh: "true", toggle: "true", export: "true"}, export: {types: ['excel']}, select: {item: {name: "toolbar1"}}}}
%thead.primary-header
%tr
%th{data: {class: 'calendar', align: "center", width: "5", field: "calendar"}}= t(:participant)[:calendar]
%th{data: {class: 'participant_report', align: "center", width: "5", field: "participant_report"}}= t(:participant)[:participant_report]
%th{data: {class: 'calendar', align: "center", field: "calendar"}}= t(:participant)[:calendar]
%th{data: {class: 'participant_report', align: "center", field: "participant_report"}}= t(:participant)[:participant_report]
%th{data: {class: 'change_arm', align: "center", width: "95", field: "chg_arm"}}= t(:arm)[:change_arm]
%th{data: {class: 'last_name truncate', align: "left", sortable: "true", field: "last_name"}}= t(:participant)[:last_name]
%th{data: {class: 'first_name truncate', align: "left", sortable: "true", field: "first_middle"}}= t(:participant)[:first_name]
%th{data: {class: 'mrn truncate', align: "left", sortable: "true", field: "mrn"}}= t(:participant)[:mrn]
%th{data: {class: 'external_id truncate', align: "left", sortable: "true", field: "external_id"}}= t(:participant)[:id]
%th{data: {class: 'arm_name truncate', align: "left", sortable: "true", field: "arm_name"}}= t(:participant)[:arm]
%th{data: {class: 'status', align: "left", sortable: "true", field: "statusDropdown"}}= t(:participant)[:status]
%th{data: {class: 'notes', align: "center", field: "notes"}}= t(:participant)[:notes]
%th{data: {class: 'recruitment_source', align: "left", sortable: "true", field: "recruitment_source", visible: "false"}}= t(:participant)[:recruitment_source]
%th{data: {class: 'details', align: "center", field: "details"}}= t(:actions)[:details]
%th{data: {class: 'edit', align: "center", field: "edit"}}= t(:actions)[:edit]
%th{data: {class: 'delete', align: "center", field: "delete"}}= t(:actions)[:delete]
9 changes: 2 additions & 7 deletions app/views/protocols/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,22 @@
- if @services_present
%li.custom-tab.protocol-tab{role: 'presentation', class: (@current_protocol_tab == "study_schedule" ? "active" : "")}
= link_to t(:protocol)[:tabs][(is_protocol_type_study? (@protocol)) ? :study_schedule : :project_schedule], "#study_schedule", {"data-toggle" => 'tab', role: 'tab', "aria-controls" => 'study_schedule'}
%li.custom-tab.protocol-tab{role: 'presentation', class: (@current_protocol_tab == "participant_list" ? "active" : "")}
= link_to t(:protocol)[:tabs][:participant_list], "#participant_list", {"data-toggle" => 'tab', role: 'tab', "aria-controls" => 'participant_list'}
%li.custom-tab.protocol-tab{role: 'presentation', class: (@current_protocol_tab == "participant_tracker" ? "active" : "")}
= link_to t(:protocol)[:tabs][:participant_tracker], "#participant_tracker", {"data-toggle" => 'tab', role: 'tab', "aria-controls" => 'participant_tracker'}
%li.custom-tab.protocol-tab{role: 'presentation', class: (@current_protocol_tab == "study_level_activities" ? "active" : "")}
= link_to t(:protocol)[:tabs][(is_protocol_type_study? (@protocol)) ? :study_level_activities : :project_level_activities], "#study_level_activities", {"data-toggle" => 'tab', role: 'tab', "aria-controls" => 'study_level_activities'}

%li.custom-tab.protocol-tab{role: 'presentation', :id => "protocol-reports-tab", class: (@current_protocol_tab == "reports" ? "active" : "")}
= link_to t(:protocol)[:tabs][:reports], "#reports", {"data-toggle" => 'tab', role: 'tab', "aria-controls" => 'reports'}
- if @protocol.unaccessed_documents_count > 0
%span.notification.protocol_report_notifications
= @protocol.unaccessed_documents_count

.tab-content
- if @services_present
.tab-pane#study_schedule{role: 'tabpanel', class: (@current_protocol_tab == "study_schedule" ? "active" : "")}
= render partial: 'study_schedule/calendar', locals: {protocol: @protocol, page: @page, tab: (cookies["active-schedule-tab".to_sym]) ? cookies["active-schedule-tab".to_sym] : 'template'}

.tab-pane#participant_list{role: 'tabpanel', class: (@current_protocol_tab == "participant_list" ? "active" : "")}
= render partial: 'participant_list', locals: {protocol: @protocol, participant: @participant}

.tab-pane#participant_tracker{role: 'tabpanel', class: (@current_protocol_tab == "participant_tracker" ? "active" : "")}
= render partial: 'participant_tracker', locals: {protocol: @protocol}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
feature 'User views Participant details', js: true do

scenario 'and sees the Participants attributes' do
given_i_am_viewing_the_participant_list
given_i_am_viewing_the_participant_tracker
when_i_click_the_participant_details_icon
then_i_should_see_the_participant_details
end

def given_i_am_viewing_the_participant_list
def given_i_am_viewing_the_participant_tracker
protocol = create_and_assign_protocol_to_me

visit protocol_path(protocol.id)
wait_for_ajax

click_link 'Participant List'
click_link 'Participant Tracker'
wait_for_ajax
end

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
feature 'User creates Participant', js: true do

scenario 'and sees the new Participants in the list' do
given_i_am_viewing_the_participant_list
given_i_am_viewing_the_participant_tracker
when_i_create_a_new_participant
then_i_should_see_the_new_participant_in_the_list
end

def given_i_am_viewing_the_participant_list
def given_i_am_viewing_the_participant_tracker
@protocol = create_and_assign_protocol_to_me

visit protocol_path(@protocol.id)
wait_for_ajax

click_link 'Participant List'
click_link 'Participant Tracker'
wait_for_ajax
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
feature 'User deletes Participant', js: true do

scenario 'and sees the Participant is removed from the list' do
given_i_am_viewing_the_participant_list
given_i_am_viewing_the_participant_tracker
when_i_delete_a_participant
then_i_should_not_see_the_participant
end

def given_i_am_viewing_the_participant_list
def given_i_am_viewing_the_participant_tracker
protocol = create_and_assign_protocol_to_me

visit protocol_path(protocol.id)
wait_for_ajax

click_link 'Participant List'
click_link 'Participant Tracker'
wait_for_ajax
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
feature 'User edits Participant', js: true do

scenario 'and sees the updated Participant' do
given_i_am_viewing_the_participant_list
given_i_am_viewing_the_participant_tracker
when_i_update_a_participants_details
then_i_should_see_the_updated_details
end

def given_i_am_viewing_the_participant_list
def given_i_am_viewing_the_participant_tracker
protocol = create_and_assign_protocol_to_me

visit protocol_path(protocol.id)
wait_for_ajax

click_link 'Participant List'
click_link 'Participant Tracker'
wait_for_ajax
end

Expand All @@ -44,9 +44,9 @@ def when_i_update_a_participants_details
fill_in 'First Name', with: 'Starlord'
page.execute_script %Q{ $('#dob_time_picker').trigger("focus") }
page.execute_script %Q{ $("td.day:contains('15')").trigger("click") }

find("input[value='Save Participant']").click

refresh_bootstrap_table 'table.participants'
end

Expand Down