Commit cd79e9fb6646303fcbc18cf21b332a04342b84e0

Authored by Daniela Feitosa
1 parent da3f1073

Tabs to display fields for each kind of profile

Also fixed tests

(ActionItem2962)
app/views/features/_manage_community_fields.rhtml
1 -<h2><%= __('Manage community fields') %></h2>  
2 -  
3 <% labelled_form_for(:environment, @environment, :url => {:action => 'manage_community_fields'}) do |f| %> 1 <% labelled_form_for(:environment, @environment, :url => {:action => 'manage_community_fields'}) do |f| %>
4 2
5 <table id='community_fields_conf'> 3 <table id='community_fields_conf'>
app/views/features/_manage_enterprise_fields.rhtml
1 -<h2><%= __('Manage enterprise fields') %></h2>  
2 -  
3 <% labelled_form_for(:environment, @environment, :url => {:action => 'manage_enterprise_fields'}) do |f| %> 1 <% labelled_form_for(:environment, @environment, :url => {:action => 'manage_enterprise_fields'}) do |f| %>
4 2
5 <table id='enterprise_fields_conf'> 3 <table id='enterprise_fields_conf'>
app/views/features/_manage_person_fields.rhtml
1 -<h2><%= _('Manage person fields') %></h2>  
2 -  
3 <% labelled_form_for(:environment, @environment, :url => {:action => 'manage_person_fields'}) do |f| %> 1 <% labelled_form_for(:environment, @environment, :url => {:action => 'manage_person_fields'}) do |f| %>
4 2
5 <table id='person_fields_conf'> 3 <table id='person_fields_conf'>
app/views/features/manage_fields.rhtml
1 -<%= javascript_include_tag "manage-fields.js" %>  
2 -  
3 -<%= render :partial => 'manage_person_fields' %> 1 +<h1><%= _('Manage fields displayed for profiles') %></h1>
4 2
5 -<% if !environment.enabled?('disable_asset_enterprises') %>  
6 - <%= render :partial => 'manage_enterprise_fields' %> 3 +<% tabs = [] %>
  4 +<% tabs << {:title => _("Person's fields"), :id => 'person-fields',
  5 + :content => (render :partial => 'manage_person_fields')} %>
  6 +<% tabs << {:title => _("Community's fields"), :id => 'community-fields',
  7 + :content => (render :partial => 'manage_community_fields')} %>
  8 +<% unless environment.enabled?('disable_asset_enterprises') %>
  9 + <% tabs << {:title => _("Enterprise's fields"), :id => 'enterprise-fields',
  10 + :content => (render :partial => 'manage_enterprise_fields')} %>
7 <% end %> 11 <% end %>
8 12
9 -<%= render :partial => 'manage_community_fields' %> 13 +<%= render_tabs(tabs) %>
  14 +
  15 +<%= javascript_include_tag "manage-fields.js" %>
features/manage_fields.feature
@@ -17,7 +17,8 @@ Feature: check all manage fields @@ -17,7 +17,8 @@ Feature: check all manage fields
17 17
18 @selenium 18 @selenium
19 Scenario: check all active person fields 19 Scenario: check all active person fields
20 - Given I check "person_active" 20 + Given I follow "Person's fields"
  21 + And I check "person_active"
21 And I press "save_person_fields" 22 And I press "save_person_fields"
22 When I go to admin_user's control panel 23 When I go to admin_user's control panel
23 And I follow "Edit Profile" 24 And I follow "Edit Profile"
@@ -25,7 +26,8 @@ Feature: check all manage fields @@ -25,7 +26,8 @@ Feature: check all manage fields
25 26
26 @selenium 27 @selenium
27 Scenario: check all active enterprise fields 28 Scenario: check all active enterprise fields
28 - Given I check "enterprise_active" 29 + Given I follow "Enterprise's fields"
  30 + And I check "enterprise_active"
29 And I press "save_enterprise_fields" 31 And I press "save_enterprise_fields"
30 When I go to paper-street's control panel 32 When I go to paper-street's control panel
31 And I follow "Enterprise Info and settings" 33 And I follow "Enterprise Info and settings"
@@ -33,7 +35,8 @@ Feature: check all manage fields @@ -33,7 +35,8 @@ Feature: check all manage fields
33 35
34 @selenium 36 @selenium
35 Scenario: check all active community fields 37 Scenario: check all active community fields
36 - Given I check "community_active" 38 + Given I follow "Community's fields"
  39 + And I check "community_active"
37 And I press "save_community_fields" 40 And I press "save_community_fields"
38 When I go to mycommunity's control panel 41 When I go to mycommunity's control panel
39 And I follow "Community Info and settings" 42 And I follow "Community Info and settings"
@@ -41,7 +44,8 @@ Feature: check all manage fields @@ -41,7 +44,8 @@ Feature: check all manage fields
41 44
42 @selenium 45 @selenium
43 Scenario: uncheck Check/Uncheck All active person field 46 Scenario: uncheck Check/Uncheck All active person field
44 - Given I check "person_active" 47 + Given I follow "Person's fields"
  48 + And I check "person_active"
45 And I press "save_person_fields" 49 And I press "save_person_fields"
46 And I uncheck "person_active" 50 And I uncheck "person_active"
47 And I press "save_person_fields" 51 And I press "save_person_fields"
@@ -51,7 +55,8 @@ Feature: check all manage fields @@ -51,7 +55,8 @@ Feature: check all manage fields
51 55
52 @selenium 56 @selenium
53 Scenario: uncheck Check/Uncheck All active community field 57 Scenario: uncheck Check/Uncheck All active community field
54 - Given I check "community_active" 58 + Given I follow "Community's fields"
  59 + And I check "community_active"
55 And I press "save_community_fields" 60 And I press "save_community_fields"
56 And I uncheck "community_active" 61 And I uncheck "community_active"
57 And I press "save_community_fields" 62 And I press "save_community_fields"
@@ -61,7 +66,8 @@ Feature: check all manage fields @@ -61,7 +66,8 @@ Feature: check all manage fields
61 66
62 @selenium 67 @selenium
63 Scenario: uncheck Check/Uncheck All active enterprise field 68 Scenario: uncheck Check/Uncheck All active enterprise field
64 - Given I check "enterprise_active" 69 + Given I follow "Enterprise's fields"
  70 + And I check "enterprise_active"
65 And I press "save_enterprise_fields" 71 And I press "save_enterprise_fields"
66 And I uncheck "enterprise_active" 72 And I uncheck "enterprise_active"
67 And I press "save_enterprise_fields" 73 And I press "save_enterprise_fields"