Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Commits
1746759f
Commit
1746759f
authored
1 year ago
by
Gyan Gupta
Committed by
Anusha Ranganathan
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Added tabs for Archive and Tombstoned
parent
ae2e670f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!270
Added tabs for Archive and Tombstoned
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hyrax/app/controllers/hyrax/admin/workflows_controller.rb
+40
-0
40 additions, 0 deletions
hyrax/app/controllers/hyrax/admin/workflows_controller.rb
hyrax/app/views/hyrax/admin/workflows/index.html.erb
+170
-0
170 additions, 0 deletions
hyrax/app/views/hyrax/admin/workflows/index.html.erb
with
210 additions
and
0 deletions
hyrax/app/controllers/hyrax/admin/workflows_controller.rb
0 → 100644
+
40
−
0
View file @
1746759f
# frozen_string_literal: true
module
Hyrax
# Presents a list of works in workflow
class
Admin::WorkflowsController
<
ApplicationController
before_action
:ensure_authorized!
with_themed_layout
'dashboard'
class_attribute
:deposited_workflow_state_name
,
:archived_workflow_state_name
# Works that are in this workflow state (see workflow json template) are excluded from the
# status list and display in the "Published" tab
self
.
deposited_workflow_state_name
=
'published'
def
index
add_breadcrumb
t
(
:'hyrax.controls.home'
),
root_path
add_breadcrumb
t
(
:'hyrax.dashboard.breadcrumbs.admin'
),
hyrax
.
dashboard_path
add_breadcrumb
t
(
:'hyrax.admin.sidebar.tasks'
),
'#'
add_breadcrumb
t
(
:'hyrax.admin.sidebar.workflow_review'
),
request
.
path
@status_list
=
actionable_objects
.
reject
(
&
:published?
).
select
{
|
object
|
under_review?
(
object
.
workflow_state
)
}
@published_list
=
ActiveFedora
::
Base
.
where
(
workflow_state_name_ssim:
'published'
)
@archived_list
=
ActiveFedora
::
Base
.
where
(
workflow_state_name_ssim:
'archived'
)
@tombstoned_list
=
ActiveFedora
::
Base
.
where
(
is_tombstoned_ssim:
'true'
)
end
private
def
ensure_authorized!
authorize!
:review
,
:submissions
end
def
actionable_objects
@actionable_objects
||=
Hyrax
::
Workflow
::
ActionableObjects
.
new
(
user:
current_user
)
end
def
under_review?
(
workflow_state
)
[
"pending_review_from_publication_manager"
,
"changes_required_from_publication_manager"
,
"pending_review_from_crc_manager"
,
"changes_required_from_crc_manager"
,
"pending_review_from_group_manager"
,
"changes_required_from_group_manager"
].
include?
(
workflow_state
)
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
hyrax/app/views/hyrax/admin/workflows/index.html.erb
0 → 100644
+
170
−
0
View file @
1746759f
<%
provide
:page_header
do
%>
<h1><span
class=
"glyphicon glyphicon-ok-circle"
></span>
<%=
t
(
'.header'
)
%>
</h1>
<%
end
%>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-default tabs"
>
<ul
class=
"nav nav-tabs"
role=
"tablist"
>
<li
class=
"active"
>
<a
href=
"#under-review"
role=
"tab"
data-toggle=
"tab"
>
<%=
t
(
'.tabs.under_review'
)
%>
</a>
</li>
<li>
<a
href=
"#published"
role=
"tab"
data-toggle=
"tab"
>
<%=
t
(
'.tabs.published'
)
%>
</a>
</li>
<li>
<a
href=
"#archived"
role=
"tab"
data-toggle=
"tab"
>
<%=
t
(
'.tabs.archived'
)
%>
</a>
</li>
<li>
<a
href=
"#tombstoned"
role=
"tab"
data-toggle=
"tab"
>
<%=
t
(
'.tabs.tombstoned'
)
%>
</a>
</li>
</ul>
<div
class=
"tab-content"
>
<div
id=
"under-review"
class=
"tab-pane active"
>
<div
class=
"panel panel-default labels"
>
<div
class=
"panel-body"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-condensed table-striped datatable"
>
<thead>
<tr>
<th
width=
"40%"
>
Work
</th>
<th
width=
"20%"
>
Depositor
</th>
<th
width=
"20%"
>
Submission Date
</th>
<th
width=
"20%"
>
Status
</th>
</tr>
</thead>
<tbody>
<%
@status_list
.
each
do
|
document
|
%>
<tr>
<td>
<%=
link_to
document
,
[
main_app
,
document
]
%>
</td>
<td>
<%=
safe_join
(
document
.
creator
,
tag
(
:br
))
%>
</td>
<td>
<%=
document
.
date_modified
%>
</td>
<td>
<span
class=
"state state-pending"
>
<%=
document
.
workflow_state
%>
</span>
</td>
</tr>
<%
end
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div
id=
"published"
class=
"tab-pane"
>
<div
class=
"panel panel-default labels"
>
<div
class=
"panel-body"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-condensed table-striped datatable"
>
<thead>
<tr>
<th
width=
"40%"
>
Work
</th>
<th
width=
"20%"
>
Depositor
</th>
<th
width=
"20%"
>
Submission Date
</th>
<th
width=
"20%"
>
Status
</th>
</tr>
</thead>
<tbody>
<%
@published_list
.
each
do
|
document
|
%>
<tr>
<td>
<%=
link_to
document
,
[
main_app
,
document
]
%>
</td>
<td>
<%=
safe_join
(
document
.
creator
.
to_a
,
tag
(
:br
))
%>
</td>
<td>
<%=
document
.
date_modified
%>
</td>
<td>
<span
class=
"state state-pending"
>
Published
</span>
</td>
</tr>
<%
end
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div
id=
"archived"
class=
"tab-pane"
>
<div
class=
"panel panel-default labels"
>
<div
class=
"panel-body"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-condensed table-striped datatable"
>
<thead>
<tr>
<th
width=
"40%"
>
Work
</th>
<th
width=
"20%"
>
Depositor
</th>
<th
width=
"20%"
>
Submission Date
</th>
<th
width=
"20%"
>
Status
</th>
</tr>
</thead>
<tbody>
<%
@archived_list
.
each
do
|
document
|
%>
<tr>
<td>
<%=
link_to
document
.
title
[
0
],
main_app
.
polymorphic_path
(
document
)
%>
</td>
<td>
<%=
safe_join
(
document
.
creator
.
to_a
,
tag
(
:br
))
%>
</td>
<td>
<%=
document
.
date_modified
%>
</td>
<td>
<span
class=
"state state-pending"
>
Archived
</span>
</td>
</tr>
<%
end
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div
id=
"tombstoned"
class=
"tab-pane"
>
<div
class=
"panel panel-default labels"
>
<div
class=
"panel-body"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-condensed table-striped datatable"
>
<thead>
<tr>
<th
width=
"40%"
>
Work
</th>
<th
width=
"20%"
>
Depositor
</th>
<th
width=
"20%"
>
Submission Date
</th>
<th
width=
"20%"
>
Status
</th>
</tr>
</thead>
<tbody>
<%
@tombstoned_list
.
each
do
|
document
|
%>
<tr>
<td>
<%=
link_to
document
.
title
[
0
],
main_app
.
polymorphic_path
(
document
)
%>
</td>
<td>
<%=
safe_join
(
document
.
creator
.
to_a
,
tag
(
:br
))
%>
</td>
<td>
<%=
document
.
date_modified
%>
</td>
<td>
<span
class=
"state state-pending"
>
Tombstoned
</span>
</td>
</tr>
<%
end
%>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment