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
DESIGN_ICONS = {
'created' => 'upload',
'updated' => 'pencil',
'destroyed' => ICON_NAMES_BY_EVENT_TYPE['destroyed'],
'archived' => 'archive'
'destroyed' => ICON_NAMES_BY_EVENT_TYPE['destroyed']
}.freeze
def design_event_icon(action, size: 24)
......
......@@ -24,15 +24,14 @@ class Event < ApplicationRecord
left: 9, # User left project
destroyed: 10,
expired: 11, # User left project due to expiry
approved: 12,
archived: 13 # Recoverable deletion
approved: 12
).freeze
private_constant :ACTIONS
WIKI_ACTIONS = [:created, :updated, :destroyed].freeze
DESIGN_ACTIONS = [:created, :updated, :destroyed, :archived].freeze
DESIGN_ACTIONS = [:created, :updated, :destroyed].freeze
TARGET_TYPES = HashWithIndifferentAccess.new(
issue: Issue,
......@@ -437,8 +436,7 @@ class Event < ApplicationRecord
{
created: _('uploaded'),
updated: _('revised'),
destroyed: _('deleted'),
archived: _('archived')
destroyed: _('deleted')
}
end
......
......@@ -14378,7 +14378,6 @@ Event action.
| Value | Description |
| ----- | ----------- |
| <a id="eventactionapproved"></a>`APPROVED` | Approved action. |
| <a id="eventactionarchived"></a>`ARCHIVED` | Archived action. |
| <a id="eventactionclosed"></a>`CLOSED` | Closed action. |
| <a id="eventactioncommented"></a>`COMMENTED` | Commented action. |
| <a id="eventactioncreated"></a>`CREATED` | Created action. |
......
......@@ -17,7 +17,6 @@ FactoryBot.define do
trait(:left) { action { :left } }
trait(:destroyed) { action { :destroyed } }
trait(:expired) { action { :expired } }
trait(:archived) { action { :archived } }
trait(:approved) { action { :approved } }
factory :closed_issue_event do
......
......@@ -8,7 +8,6 @@ RSpec.describe 'Projects > Activity > User sees design Activity', :js do
let_it_be(:uploader) { create(:user) }
let_it_be(:editor) { create(:user) }
let_it_be(:deleter) { create(:user) }
let_it_be(:archiver) { create(:user) }
def design_activity(user, action)
[user.name, user.to_reference, action, 'design'].join(' ')
......@@ -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, :updated, author: editor, **common_attrs)
create(:design_event, :destroyed, author: deleter, **common_attrs)
create(:design_event, :archived, author: archiver, **common_attrs)
end
before 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(editor, 'revised'))
expect(page).to have_content(design_activity(deleter, 'deleted'))
expect(page).to have_content(design_activity(archiver, 'archived'))
end
it 'allows filtering out the design events', :aggregate_failures 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(editor, 'revised'))
expect(page).not_to have_content(design_activity(deleter, 'deleted'))
expect(page).not_to have_content(design_activity(archiver, 'archived'))
end
it 'allows filtering in the design events', :aggregate_failures 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(editor, 'revised'))
expect(page).to have_content(design_activity(deleter, 'deleted'))
expect(page).to have_content(design_activity(archiver, 'archived'))
end
end
......
......@@ -978,14 +978,13 @@ RSpec.describe Event do
describe '#action_name' 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
end
expect(created).to eq('uploaded')
expect(updated).to eq('revised')
expect(destroyed).to eq('deleted')
expect(archived).to eq('archived')
end
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