Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Improve IFC models table

Wieland Lindenthalca0b6e0bb391
diff --git a/modules/ifc_models/app/cells/ifc_models/models/row_cell.rb b/modules/ifc_models/app/cells/ifc_models/models/row_cell.rb
index 87e6114db95..d41ff49f758 100644
--- a/modules/ifc_models/app/cells/ifc_models/models/row_cell.rb
+++ b/modules/ifc_models/app/cells/ifc_models/models/row_cell.rb
@@ -6,8 +6,12 @@ module IFCModels
include ::Redmine::I18n
def title
- link_to model.title,
- ifc_models_project_ifc_model_path(model.project, model)
+ if still_processing?
+ model.title
+ else
+ link_to model.title,
+ ifc_models_project_ifc_model_path(model.project, model)
+ end
end
def updated_at
@@ -20,13 +24,17 @@ module IFCModels
end
def processing
- if model.xkt_attachment.present?
- I18n.t('ifc_models.processing_state.completed')
- else
+ if still_processing?
I18n.t('ifc_models.processing_state.in_progress')
+ else
+ I18n.t('ifc_models.processing_state.completed')
end
end
+ def still_processing?
+ model.xkt_attachment.nil? || model.metadata_attachment.nil?
+ end
+
###
def button_links
diff --git a/modules/ifc_models/app/cells/ifc_models/models/table_cell.rb b/modules/ifc_models/app/cells/ifc_models/models/table_cell.rb
index babd2de698e..ea075dcaf82 100644
--- a/modules/ifc_models/app/cells/ifc_models/models/table_cell.rb
+++ b/modules/ifc_models/app/cells/ifc_models/models/table_cell.rb
@@ -2,10 +2,10 @@ module IFCModels
module Models
class TableCell < ::TableCell
include ::IconsHelper
- columns :title, :updated_at, :uploader, :processing
+ columns :title, :created_at, :updated_at, :uploader, :processing
def initial_sort
- [:updated_at, :desc]
+ [:created_at, :asc]
end
def sortable?
@@ -27,6 +27,7 @@ module IFCModels
def headers
[
['title', caption: IFCModel.human_attribute_name(:title)],
+ ['created_at', caption: IFCModel.human_attribute_name(:created_at)],
['updated_at', caption: IFCModel.human_attribute_name(:updated_at)],
['uploader', caption: IFCModel.human_attribute_name(:uploader)],
['processing', caption: I18n.t('ifc_models.processing_state.label')],
diff --git a/modules/ifc_models/app/controllers/ifc_models/ifc_models_controller.rb b/modules/ifc_models/app/controllers/ifc_models/ifc_models_controller.rb
index 09fdb77bbc0..f11733f51b7 100644
--- a/modules/ifc_models/app/controllers/ifc_models/ifc_models_controller.rb
+++ b/modules/ifc_models/app/controllers/ifc_models/ifc_models_controller.rb
@@ -42,7 +42,7 @@ module ::IFCModels
def index
@ifc_models = @project
.ifc_models
- .order('updated_at DESC')
+ .order('created_at ASC')
.includes(:uploader, :project)
end