Commit 3351661f authored by Dan Jensen's avatar Dan Jensen Committed by Thong Kuah

Remove un-used Event archived action

This removes the Event archived action. It was introduced over 1
year ago, but was not implemented as planned and has never been used.

Changelog: removed
parent 3c4021d2
...@@ -240,8 +240,7 @@ module EventsHelper ...@@ -240,8 +240,7 @@ module EventsHelper
DESIGN_ICONS = { DESIGN_ICONS = {
'created' => 'upload', 'created' => 'upload',
'updated' => 'pencil', 'updated' => 'pencil',
'destroyed' => ICON_NAMES_BY_EVENT_TYPE['destroyed'], 'destroyed' => ICON_NAMES_BY_EVENT_TYPE['destroyed']
'archived' => 'archive'
}.freeze }.freeze
def design_event_icon(action, size: 24) def design_event_icon(action, size: 24)
......
...@@ -24,15 +24,14 @@ class Event < ApplicationRecord ...@@ -24,15 +24,14 @@ class Event < ApplicationRecord
left: 9, # User left project left: 9, # User left project
destroyed: 10, destroyed: 10,
expired: 11, # User left project due to expiry expired: 11, # User left project due to expiry
approved: 12, approved: 12
archived: 13 # Recoverable deletion
).freeze ).freeze
private_constant :ACTIONS private_constant :ACTIONS
WIKI_ACTIONS = [:created, :updated, :destroyed].freeze WIKI_ACTIONS = [:created, :updated, :destroyed].freeze
DESIGN_ACTIONS = [:created, :updated, :destroyed, :archived].freeze DESIGN_ACTIONS = [:created, :updated, :destroyed].freeze
TARGET_TYPES = HashWithIndifferentAccess.new( TARGET_TYPES = HashWithIndifferentAccess.new(
issue: Issue, issue: Issue,
...@@ -437,8 +436,7 @@ class Event < ApplicationRecord ...@@ -437,8 +436,7 @@ class Event < ApplicationRecord
{ {
created: _('uploaded'), created: _('uploaded'),
updated: _('revised'), updated: _('revised'),
destroyed: _('deleted'), destroyed: _('deleted')
archived: _('archived')
} }
end end
......
...@@ -14378,7 +14378,6 @@ Event action. ...@@ -14378,7 +14378,6 @@ Event action.
| Value | Description | | Value | Description |
| ----- | ----------- | | ----- | ----------- |
| <a id="eventactionapproved"></a>`APPROVED` | Approved action. | | <a id="eventactionapproved"></a>`APPROVED` | Approved action. |
| <a id="eventactionarchived"></a>`ARCHIVED` | Archived action. |
| <a id="eventactionclosed"></a>`CLOSED` | Closed action. | | <a id="eventactionclosed"></a>`CLOSED` | Closed action. |
| <a id="eventactioncommented"></a>`COMMENTED` | Commented action. | | <a id="eventactioncommented"></a>`COMMENTED` | Commented action. |
| <a id="eventactioncreated"></a>`CREATED` | Created action. | | <a id="eventactioncreated"></a>`CREATED` | Created action. |
......
...@@ -17,7 +17,6 @@ FactoryBot.define do ...@@ -17,7 +17,6 @@ FactoryBot.define do
trait(:left) { action { :left } } trait(:left) { action { :left } }
trait(:destroyed) { action { :destroyed } } trait(:destroyed) { action { :destroyed } }
trait(:expired) { action { :expired } } trait(:expired) { action { :expired } }
trait(:archived) { action { :archived } }
trait(:approved) { action { :approved } } trait(:approved) { action { :approved } }
factory :closed_issue_event do factory :closed_issue_event do
......
...@@ -8,7 +8,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do ...@@ -8,7 +8,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do
let_it_be(:uploader) { create(:user) } let_it_be(:uploader) { create(:user) }
let_it_be(:editor) { create(:user) } let_it_be(:editor) { create(:user) }
let_it_be(:deleter) { create(:user) } let_it_be(:deleter) { create(:user) }
let_it_be(:archiver) { create(:user) }
def design_activity(user, action) def design_activity(user, action)
[user.name, user.to_reference, action, 'design'].join(' ') [user.name, user.to_reference, action, 'design'].join(' ')
...@@ -24,7 +23,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do ...@@ -24,7 +23,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do
create(:design_event, :created, author: uploader, **common_attrs) create(:design_event, :created, author: uploader, **common_attrs)
create(:design_event, :updated, author: editor, **common_attrs) create(:design_event, :updated, author: editor, **common_attrs)
create(:design_event, :destroyed, author: deleter, **common_attrs) create(:design_event, :destroyed, author: deleter, **common_attrs)
create(:design_event, :archived, author: archiver, **common_attrs)
end end
before do before do
...@@ -39,7 +37,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do ...@@ -39,7 +37,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do
expect(page).to have_content(design_activity(uploader, 'uploaded')) expect(page).to have_content(design_activity(uploader, 'uploaded'))
expect(page).to have_content(design_activity(editor, 'revised')) expect(page).to have_content(design_activity(editor, 'revised'))
expect(page).to have_content(design_activity(deleter, 'deleted')) expect(page).to have_content(design_activity(deleter, 'deleted'))
expect(page).to have_content(design_activity(archiver, 'archived'))
end end
it 'allows filtering out the design events', :aggregate_failures do it 'allows filtering out the design events', :aggregate_failures do
...@@ -48,7 +45,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do ...@@ -48,7 +45,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do
expect(page).not_to have_content(design_activity(uploader, 'uploaded')) expect(page).not_to have_content(design_activity(uploader, 'uploaded'))
expect(page).not_to have_content(design_activity(editor, 'revised')) expect(page).not_to have_content(design_activity(editor, 'revised'))
expect(page).not_to have_content(design_activity(deleter, 'deleted')) expect(page).not_to have_content(design_activity(deleter, 'deleted'))
expect(page).not_to have_content(design_activity(archiver, 'archived'))
end end
it 'allows filtering in the design events', :aggregate_failures do it 'allows filtering in the design events', :aggregate_failures do
...@@ -58,7 +54,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do ...@@ -58,7 +54,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do
expect(page).to have_content(design_activity(uploader, 'uploaded')) expect(page).to have_content(design_activity(uploader, 'uploaded'))
expect(page).to have_content(design_activity(editor, 'revised')) expect(page).to have_content(design_activity(editor, 'revised'))
expect(page).to have_content(design_activity(deleter, 'deleted')) expect(page).to have_content(design_activity(deleter, 'deleted'))
expect(page).to have_content(design_activity(archiver, 'archived'))
end end
end end
......
...@@ -978,14 +978,13 @@ RSpec.describe Event do ...@@ -978,14 +978,13 @@ RSpec.describe Event do
describe '#action_name' do describe '#action_name' do
it 'handles all valid design events' do it 'handles all valid design events' do
created, updated, destroyed, archived = %i[created updated destroyed archived].map do |trait| created, updated, destroyed = %i[created updated destroyed].map do |trait|
build(:design_event, trait).action_name build(:design_event, trait).action_name
end end
expect(created).to eq('uploaded') expect(created).to eq('uploaded')
expect(updated).to eq('revised') expect(updated).to eq('revised')
expect(destroyed).to eq('deleted') expect(destroyed).to eq('deleted')
expect(archived).to eq('archived')
end end
it 'handles correct push_action' do it 'handles correct push_action' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment