From 926353650007e9f1272862ab409f77f4d28316b3 Mon Sep 17 00:00:00 2001 From: mr-exz Date: Fri, 27 Dec 2024 15:22:42 +0300 Subject: [PATCH] deleted not used code --- CHANGELOG.md | 4 ++++ bot/commands/duty_update.rb | 33 --------------------------------- bot/commands/help.rb | 7 +++---- bot/commands/main.rb | 1 - 4 files changed, 7 insertions(+), 38 deletions(-) delete mode 100644 bot/commands/duty_update.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a9dc05..94d50a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## 0.19.3 +### Bugfixes +- Deleted not used code + ## 0.19.2 ### Bugfixes - Fixed creation of duty for other users. diff --git a/bot/commands/duty_update.rb b/bot/commands/duty_update.rb deleted file mode 100644 index 91e446e..0000000 --- a/bot/commands/duty_update.rb +++ /dev/null @@ -1,33 +0,0 @@ -module WhoIsOnDutyTodaySlackBotModule - module Commands - class DutyUpdate - DESCRIPTION = 'Will update a duty. Time should be defined in your local timezone.'.freeze - EXAMPLE = '`duty update from to ` example: `duty update from 8:00 to 17:00`'.freeze - def self.call(client:, data:, match:) - duty = Duty.where(user_id: data.user, channel_id: data.channel).first - - if duty.blank? - client.say( - channel: data.channel, - text: I18n.t('commands.duty.exist.error'), - thread_ts: data.thread_ts || data.ts - ) - else - user = User.where(slack_user_id: data.user).first - duty.duty_from = ActiveSupport::TimeZone.new(user.tz).local_to_utc(match['expression'][/from (\d+:\d+) /, 1].to_time) - duty.duty_to = ActiveSupport::TimeZone.new(user.tz).local_to_utc(match['expression'][/.* to (\d+:\d+)$/, 1].to_time) - duty.channel_id = data.channel - duty.user_id = user.id - duty.enabled = true - duty.save - client.say( - channel: data.channel, - text: I18n.t('commands.duty.updated.text', fH: duty.duty_from.hour, fM: duty.duty_from.min, tH: duty.duty_to.hour, tM: duty.duty_to.min, status: duty.enabled), - thread_ts: data.thread_ts || data.ts - ) - DutyCreate.i_am_on_duty(data: data, client: client) - end - end - end - end -end diff --git a/bot/commands/help.rb b/bot/commands/help.rb index 65eafdf..4501658 100644 --- a/bot/commands/help.rb +++ b/bot/commands/help.rb @@ -26,16 +26,15 @@ def self.generate_help_text WhoIsOnDuty, Checked, DutyCreate, + DutyDelete, + DutySyncWithOpsgenieSchedule, + DutySetOpsgenieEscalation, ChannelReminder, ChannelAutoAnswer, ChannelTagReporterInThread, ChannelLabelsStatistic, ChannelLabelsList, ChannelLabelsMerge, - DutyUpdate, - DutyDelete, - DutySyncWithOpsgenieSchedule, - DutySetOpsgenieEscalation, AnswerSetCustomText, AnswerDeleteCustomText, AnswerEnableHideReason, diff --git a/bot/commands/main.rb b/bot/commands/main.rb index 4e25686..f106382 100644 --- a/bot/commands/main.rb +++ b/bot/commands/main.rb @@ -12,7 +12,6 @@ require_relative 'duty_delete' require_relative 'duty_set_opsgenie_escalation' require_relative 'duty_sync_with_opsgenie_schedule' -require_relative 'duty_update' require_relative 'help' require_relative 'i_am_on_duty' require_relative 'my_status'