Skip to content

Commit

Permalink
Merge pull request opf#14174 from opf/fix/structured-meetings-the-def…
Browse files Browse the repository at this point in the history
…ault

Make structured meeting the default
  • Loading branch information
oliverguenther authored Nov 20, 2023
2 parents c09da8a + 8679a84 commit f1450c8
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 63 deletions.
2 changes: 1 addition & 1 deletion modules/calendar/spec/features/calendar_widget_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
require_relative '../../../overviews/spec/support/pages/overview'
require_relative '../support/pages/calendar'

RSpec.describe 'Calendar Widget', :js, :with_cuprite do
RSpec.describe 'Calendar Widget', :js, :with_cuprite, with_settings: { start_of_week: 1 } do
let(:project) do
create(:project, enabled_module_names: %w[work_package_tracking calendar_view])
end
Expand Down
110 changes: 56 additions & 54 deletions modules/meeting/app/views/meetings/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,51 +35,53 @@ See COPYRIGHT and LICENSE files for more details.
<%= f.text_field :title, :required => true, :size => 60, container_class: '-wide' %>
</div>

<div class="form--field -required -align-start">
<label class="form--label" for="meeting_type"><%= Meeting.human_attribute_name(:type) %></label>
<div class="form--field-container">
<div class="op-tile-block">
<label class="op-tile-block--tile form--radio-button-container -wide"
for="meeting_type_classic"
data-test-selector="op-tile-block">
<div class="op-tile-block--content">
<%= styled_radio_button_tag 'meeting[type]',
'classic',
true,
no_label: true,
class: 'radio-button' %>
<div>
<% if @meeting.new_record? %>
<div class="form--field -required -align-start">
<label class="form--label" for="meeting_type"><%= Meeting.human_attribute_name(:type) %></label>
<div class="form--field-container">
<div class="op-tile-block">
<label class="op-tile-block--tile form--radio-button-container -wide"
for="meeting_type_dynamic"
data-test-selector="op-tile-block">
<div class="op-tile-block--content">
<%= styled_radio_button_tag 'meeting[type]',
'dynamic',
true,
no_label: true,
class: 'radio-button' %>
<div>
<span data-test-selector="op-tile-block-title" class="op-tile-block--title">
<%= t('meeting.types.classic') %>
<%= t('meeting.types.structured') %>
</span>
<p class="op-tile-block--description">
<%= t('meeting.types.classic_text') %>
</p>
<p class="op-tile-block--description">
<%= t('meeting.types.structured_text') %>
</p>
</div>
</div>
</div>
</label>
<label class="op-tile-block--tile form--radio-button-container -wide"
for="meeting_type_dynamic"
data-test-selector="op-tile-block">
<div class="op-tile-block--content">
<%= styled_radio_button_tag 'meeting[type]',
'dynamic',
false,
no_label: true,
class: 'radio-button' %>
<div>
</label>
<label class="op-tile-block--tile form--radio-button-container -wide"
for="meeting_type_classic"
data-test-selector="op-tile-block">
<div class="op-tile-block--content">
<%= styled_radio_button_tag 'meeting[type]',
'classic',
false,
no_label: true,
class: 'radio-button' %>
<div>
<span data-test-selector="op-tile-block-title" class="op-tile-block--title">
<%= t('meeting.types.structured') %>
<%= t('meeting.types.classic') %>
</span>
<p class="op-tile-block--description">
<%= t('meeting.types.structured_text') %>
</p>
<p class="op-tile-block--description">
<%= t('meeting.types.classic_text') %>
</p>
</div>
</div>
</div>
</label>
</label>
</div>
</div>
</div>
</div>
<% end %>

<% if global_meeting_create_context? %>
<div class="form--field -required">
Expand Down Expand Up @@ -110,7 +112,7 @@ See COPYRIGHT and LICENSE files for more details.
<div class="form--field -required">
<label for="meeting_start_date" class="form--label"><%= Meeting.human_attribute_name(:start_date) %>
<span class="hidden-for-sighted">
<%= t(:label_start_date)%><%= t(:text_hint_date_format) %>
<%= t(:label_start_date) %><%= t(:text_hint_date_format) %>
</span>
</label>

Expand All @@ -128,29 +130,29 @@ See COPYRIGHT and LICENSE files for more details.
</label>
</label>
<%= f.text_field :start_time_hour,
id: 'meeting-form-start-time',
required: true,
type: 'time',
no_label: true,
step: 5.minutes,
suffix: Time.zone.to_s,
container_class: '-xslim' %>
id: 'meeting-form-start-time',
required: true,
type: 'time',
no_label: true,
step: 5.minutes,
suffix: Time.zone.to_s,
container_class: '-xslim' %>
</div>
</div>

<div class="form--field -required">
<label for="meeting-form-duration" class="form--label"><%= Meeting.human_attribute_name(:duration) %></label>
<div class="form--field-container">
<%= f.number_field :duration,
id: 'meeting-form-duration',
required: true,
size: 5,
no_label: true,
min: 0.00,
step: 0.25,
max: 168,
suffix: t(:text_in_hours),
container_class: '-xslim' %>
id: 'meeting-form-duration',
required: true,
size: 5,
no_label: true,
min: 0.00,
step: 0.25,
max: 168,
suffix: t(:text_in_hours),
container_class: '-xslim' %>
</div>
</div>

Expand Down
2 changes: 2 additions & 0 deletions modules/meeting/spec/features/meetings_copy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
expect(page)
.to have_field 'Time', with: start_time.strftime("%H:%M")

choose 'Classic'

click_button "Create"

# Be on the new meeting's page with copied over attributes
Expand Down
7 changes: 7 additions & 0 deletions modules/meeting/spec/features/meetings_new_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
expect_angular_frontend_initialized # Wait for project dropdown to be ready

new_page.set_title 'Some title'
new_page.set_type 'Classic'
new_page.set_project project

new_page.set_start_date '2013-03-28'
Expand Down Expand Up @@ -133,6 +134,7 @@
before do
new_page.visit!
new_page.set_title 'Some title'
new_page.set_type 'Classic'
new_page.set_start_date '2013-03-28'
new_page.set_start_time '13:30'
new_page.set_duration '1.5'
Expand Down Expand Up @@ -168,6 +170,7 @@
expect_angular_frontend_initialized # Wait for project dropdown to be ready

new_page.set_title 'Some title'
new_page.set_type 'Classic'

new_page.set_project project

Expand All @@ -185,6 +188,7 @@
before do
new_page.visit!
new_page.set_title 'Some title'
new_page.set_type 'Classic'
end

it 'renders a validation error' do
Expand Down Expand Up @@ -242,6 +246,7 @@
new_page.visit!

new_page.set_title 'Some title'
new_page.set_type 'Classic'
new_page.set_start_date '2013-03-28'
new_page.set_start_time '13:30'
new_page.set_duration '1.5'
Expand Down Expand Up @@ -298,6 +303,7 @@
it 'allows creating meeting in a project without members' do
new_page.visit!

new_page.set_type 'Classic'
new_page.set_title 'Some title'

show_page = new_page.click_create
Expand Down Expand Up @@ -327,6 +333,7 @@
new_page.visit!

new_page.set_title 'Some title'
new_page.set_type 'Classic'

show_page = new_page.click_create

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
require_relative 'shared_context'
require 'features/work_packages/table/context_menu/context_menu_shared_examples'

RSpec.describe 'Work package table context menu', :js, with_ee: %i[team_planner_view] do
RSpec.describe 'Work package table context menu',
:js,
with_ee: %i[team_planner_view],
with_settings: { start_of_week: 1 } do
include_context 'with team planner full access'

let!(:work_package) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
require 'spec_helper'
require_relative './shared_context'

RSpec.describe 'Team planner working days', js: true, with_ee: %i[team_planner_view] do
RSpec.describe 'Team planner working days',
js: true,
with_ee: %i[team_planner_view],
with_settings: { start_of_week: 1 } do
include_context 'with team planner full access'

context 'with week days defined' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
require 'spec_helper'
require_relative './shared_context'

RSpec.describe 'Team planner error handling', js: true do
RSpec.describe 'Team planner error handling',
js: true,
with_settings: { start_of_week: 1 } do
include_context 'with team planner full access'

let!(:work_package) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
require_relative 'shared_context'
require_relative '../support/components/add_existing_pane'

RSpec.describe 'Team planner remove event', :js, with_ee: %i[team_planner_view] do
RSpec.describe 'Team planner remove event',
:js,
with_ee: %i[team_planner_view],
with_settings: { start_of_week: 1 } do
include_context 'with team planner full access'

let!(:viewer_role) { create(:project_role, permissions: [:view_work_packages]) }
Expand Down
5 changes: 4 additions & 1 deletion modules/team_planner/spec/features/team_planner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
require 'spec_helper'
require_relative 'shared_context'

RSpec.describe 'Team planner', :js, with_ee: %i[team_planner_view] do
RSpec.describe 'Team planner',
:js,
with_ee: %i[team_planner_view],
with_settings: { start_of_week: 1 } do
include_context 'with team planner full access'

it 'hides the internally used filters' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
require 'spec_helper'
require_relative 'shared_context'

RSpec.describe 'Team planner constraints for a subproject', :js, with_ee: %i[team_planner_view] do
RSpec.describe 'Team planner constraints for a subproject',
:js,
with_ee: %i[team_planner_view],
with_settings: { start_of_week: 1 } do
include_context 'with team planner full access'

let!(:other_user) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
require 'spec_helper'
require_relative 'shared_context'

RSpec.describe 'Team planner drag&dop and resizing', :js, with_ee: %i[team_planner_view] do
RSpec.describe 'Team planner drag&dop and resizing',
:js,
with_ee: %i[team_planner_view],
with_settings: { start_of_week: 1 } do
include_context 'with team planner full access'

let!(:other_user) do
Expand Down
2 changes: 1 addition & 1 deletion modules/team_planner/spec/support/pages/team_planner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def change_wp_date_by_resizing(work_package, number_of_days:, is_start_date:)

resizer = is_start_date ? wp_strip.find('.fc-event-resizer-start') : wp_strip.find('.fc-event-resizer-end')

drag_by_pixel(element: resizer, by_x: number_of_days * 180, by_y: 0) unless resizer.nil?
drag_by_pixel(element: resizer, by_x: number_of_days * 250, by_y: 0) unless resizer.nil?
end

def drag_wp_by_pixel(work_package, by_x, by_y)
Expand Down

0 comments on commit f1450c8

Please sign in to comment.