-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#59885] Impl. DeleteDialog for meetings/occurences
Implements the `DangerConfirmationDialog` for both one-time/dynamic meetings and recurring meeting occurences. N.B. this does not change the UI for classic meetings. N.B. design, copy still need to be adjusted for good one-time meeting UX.
- Loading branch information
Showing
10 changed files
with
142 additions
and
18 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
modules/meeting/app/components/meetings/delete_dialog_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<%#-- copyright | ||
OpenProject is an open source project management software. | ||
Copyright (C) the OpenProject GmbH | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License version 3. | ||
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
Copyright (C) 2006-2013 Jean-Philippe Lang | ||
Copyright (C) 2010-2013 the ChiliProject Team | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
of the License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
See COPYRIGHT and LICENSE files for more details. | ||
++#%> | ||
|
||
<%= | ||
render(Primer::OpenProject::DangerConfirmationDialog.new( | ||
id:, | ||
title:, | ||
form_arguments: { | ||
action: meeting_path(@meeting), | ||
method: :delete, | ||
data: { turbo: true } | ||
} | ||
)) do |dialog| | ||
dialog.with_confirmation_message do |message| | ||
message.with_heading(tag: :h2) { I18n.t("meeting.delete_dialog.heading") } | ||
message.with_description_content(confirmation_message) | ||
end | ||
dialog.with_confirmation_check_box_content(I18n.t("text_permanent_delete_confirmation_checkbox_label")) | ||
end | ||
%> |
67 changes: 67 additions & 0 deletions
67
modules/meeting/app/components/meetings/delete_dialog_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# frozen_string_literal: true | ||
|
||
#-- copyright | ||
# OpenProject is an open source project management software. | ||
# Copyright (C) the OpenProject GmbH | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License version 3. | ||
# | ||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
# Copyright (C) 2006-2013 Jean-Philippe Lang | ||
# Copyright (C) 2010-2013 the ChiliProject Team | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
# | ||
# See COPYRIGHT and LICENSE files for more details. | ||
#++ | ||
|
||
module Meetings | ||
class DeleteDialogComponent < ApplicationComponent | ||
include ApplicationHelper | ||
include OpTurbo::Streamable | ||
|
||
def initialize(meeting:, project:) | ||
super | ||
|
||
@meeting = meeting | ||
@project = project | ||
end | ||
|
||
private | ||
|
||
def id = "delete-meeting-dialog" | ||
|
||
def title = I18n.t("meeting.delete_dialog.title") | ||
|
||
def confirmation_message | ||
if recurring_meeting.present? | ||
I18n.t(:label_recurring_meeting_delete_confirmation, name: recurring_meeting.title) | ||
else | ||
I18n.t("text_are_you_sure") | ||
end | ||
end | ||
|
||
def recurring? | ||
@meeting.is_a?(RecurringMeeting) | ||
end | ||
|
||
def recurring_meeting | ||
return if recurring? | ||
|
||
@meeting.recurring_meeting | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters