2016-11-08 18:26:55 +08:00
|
|
|
# Extends class holds the arrays for the models enum fields
|
|
|
|
# so that can be extended in sub modules.
|
|
|
|
|
2021-11-02 23:19:56 +08:00
|
|
|
# rubocop:disable Style/MutableConstant
|
|
|
|
|
2016-11-08 18:26:55 +08:00
|
|
|
class Extends
|
|
|
|
# To extend the enum fields in the engine you have to put in
|
|
|
|
# lib/engine_name/engine.rb file as in the example:
|
|
|
|
|
|
|
|
# > initializer 'add_additional enum values to my model' do
|
|
|
|
# > Extends::MY_ARRAY_OF_ENUM_VALUES.merge!(value1, value2, ....)
|
|
|
|
# > end
|
|
|
|
# >
|
|
|
|
|
2017-03-08 21:14:03 +08:00
|
|
|
# Extends enum types. Should not be freezed, as modules might append to this.
|
2017-03-23 22:45:02 +08:00
|
|
|
# !!!Check all addons for the correct order!!!
|
2017-02-10 21:27:20 +08:00
|
|
|
TASKS_STATES = { uncompleted: 0,
|
2017-02-13 22:42:28 +08:00
|
|
|
completed: 1 }
|
2017-02-27 20:53:46 +08:00
|
|
|
|
|
|
|
REPORT_ELEMENT_TYPES = { project_header: 0,
|
|
|
|
my_module: 1,
|
|
|
|
step: 2,
|
|
|
|
result_asset: 3,
|
|
|
|
result_table: 4,
|
|
|
|
result_text: 5,
|
|
|
|
my_module_activity: 6,
|
2019-01-07 20:29:17 +08:00
|
|
|
my_module_samples: 7, # DEPRECATED in SCI-2228, kept b/c of integer enums
|
2017-02-27 20:53:46 +08:00
|
|
|
step_checklist: 8,
|
|
|
|
step_asset: 9,
|
|
|
|
step_table: 10,
|
|
|
|
step_comments: 11,
|
|
|
|
result_comments: 12,
|
2019-01-11 16:44:34 +08:00
|
|
|
project_activity: 13, # NOT USED, kept b/c of integer enums
|
2019-01-07 20:29:17 +08:00
|
|
|
project_samples: 14, # DEPRECATED in SCI-2228, kept b/c of integer enums
|
2017-06-05 18:24:06 +08:00
|
|
|
experiment: 15,
|
2017-06-08 17:23:24 +08:00
|
|
|
# Higher number because of addons
|
2019-05-13 16:55:08 +08:00
|
|
|
my_module_repository: 17,
|
|
|
|
my_module_protocol: 18 }
|
2017-03-08 21:14:03 +08:00
|
|
|
|
2021-06-10 16:59:34 +08:00
|
|
|
ACTIVE_REPORT_ELEMENTS = %i(project_header my_module experiment my_module_repository)
|
|
|
|
|
2017-05-16 21:27:36 +08:00
|
|
|
# Data type name should match corresponding model's name
|
|
|
|
REPOSITORY_DATA_TYPES = { RepositoryTextValue: 0,
|
2018-02-07 22:28:28 +08:00
|
|
|
RepositoryDateValue: 1,
|
2018-03-10 00:04:54 +08:00
|
|
|
RepositoryListValue: 2,
|
2019-10-08 19:38:57 +08:00
|
|
|
RepositoryAssetValue: 3,
|
2019-11-18 22:21:57 +08:00
|
|
|
RepositoryStatusValue: 4,
|
2019-11-21 23:22:15 +08:00
|
|
|
RepositoryDateTimeValue: 5,
|
|
|
|
RepositoryTimeValue: 6,
|
|
|
|
RepositoryDateTimeRangeValue: 7,
|
|
|
|
RepositoryTimeRangeValue: 8,
|
2019-12-06 20:18:35 +08:00
|
|
|
RepositoryDateRangeValue: 9,
|
2019-12-09 23:38:21 +08:00
|
|
|
RepositoryChecklistValue: 10,
|
2022-01-18 20:17:05 +08:00
|
|
|
RepositoryNumberValue: 11,
|
2022-01-26 00:48:45 +08:00
|
|
|
RepositoryStockValue: 12,
|
|
|
|
RepositoryStockConsumptionValue: 13 }
|
2018-03-13 18:36:05 +08:00
|
|
|
|
|
|
|
# Data types which can be imported to repository,
|
|
|
|
# name should match record in REPOSITORY_DATA_TYPES
|
2020-02-03 22:20:01 +08:00
|
|
|
REPOSITORY_IMPORTABLE_TYPES = %i(RepositoryTextValue RepositoryListValue RepositoryNumberValue
|
|
|
|
RepositoryDateValue RepositoryDateTimeValue RepositoryTimeValue
|
2022-02-04 17:29:48 +08:00
|
|
|
RepositoryStatusValue RepositoryChecklistValue RepositoryStockValue)
|
2018-03-13 18:36:05 +08:00
|
|
|
|
2020-02-11 20:51:34 +08:00
|
|
|
REPOSITORY_IMPORT_COLUMN_PRELOADS = %i(repository_list_items repository_status_items repository_checklist_items)
|
|
|
|
|
2020-01-13 23:09:07 +08:00
|
|
|
# Extra attributes used for search in repositories, 'filed_name' => include_hash
|
2021-05-20 04:48:52 +08:00
|
|
|
REPOSITORY_EXTRA_SEARCH_ATTR = {
|
|
|
|
RepositoryTextValue: {
|
2021-07-07 23:43:51 +08:00
|
|
|
field: 'repository_text_values.data', includes: :repository_text_values
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryNumberValue: {
|
2021-07-07 23:43:51 +08:00
|
|
|
field: 'repository_number_values.data', includes: :repository_number_values
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryListValue: {
|
|
|
|
field: 'repository_list_items.data',
|
2021-07-07 23:43:51 +08:00
|
|
|
includes: { repository_list_values: :repository_list_item }
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryChecklistValue: {
|
|
|
|
field: 'repository_checklist_items.data',
|
2021-07-07 23:43:51 +08:00
|
|
|
includes: { repository_checklist_values: { repository_checklist_items_values: :repository_checklist_item } }
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryStatusValue: {
|
|
|
|
field: 'repository_status_items.status',
|
2021-07-07 23:43:51 +08:00
|
|
|
includes: { repository_status_values: :repository_status_item }
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryAssetValue: {
|
|
|
|
field: 'active_storage_blobs.filename',
|
2021-07-07 23:43:51 +08:00
|
|
|
includes: { repository_asset_values: { asset: { file_attachment: :blob } } }
|
2021-05-20 04:48:52 +08:00
|
|
|
}
|
|
|
|
}
|
2018-03-09 18:05:43 +08:00
|
|
|
|
2022-01-31 18:10:39 +08:00
|
|
|
# Extra attributes used for advanced search in repositories
|
2022-01-18 04:53:13 +08:00
|
|
|
REPOSITORY_ADVANCED_SEARCH_ATTR = {
|
2021-05-20 04:48:52 +08:00
|
|
|
RepositoryTextValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_text_values
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryNumberValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_number_values
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryListValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_list_values
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryChecklistValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_checklist_values
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryStatusValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_status_values
|
2021-05-20 04:48:52 +08:00
|
|
|
}, RepositoryAssetValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_asset_values
|
2021-12-21 19:38:52 +08:00
|
|
|
}, RepositoryDateTimeValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_date_time_values
|
2022-01-31 16:21:08 +08:00
|
|
|
}, RepositoryDateTimeRangeValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_date_time_range_values
|
2021-12-21 19:38:52 +08:00
|
|
|
}, RepositoryDateValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_date_time_values
|
2022-01-31 16:21:08 +08:00
|
|
|
}, RepositoryDateRangeValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_date_time_range_values
|
2021-12-21 19:38:52 +08:00
|
|
|
}, RepositoryTimeValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_date_time_values
|
2022-01-31 16:21:08 +08:00
|
|
|
}, RepositoryTimeRangeValue: {
|
2022-02-11 17:47:32 +08:00
|
|
|
table_name: :repository_date_time_range_values
|
2022-03-23 17:05:07 +08:00
|
|
|
}, RepositoryStockValue: {
|
|
|
|
table_name: :repository_stock_values
|
2021-05-20 04:48:52 +08:00
|
|
|
}
|
|
|
|
}
|
2018-03-09 18:05:43 +08:00
|
|
|
|
2022-02-11 17:24:29 +08:00
|
|
|
REPOSITORY_ADVANCED_SEARCH_REFERENCED_VALUE_RELATIONS = {
|
|
|
|
RepositoryListValue: 'repository_list_items',
|
|
|
|
RepositoryChecklistValue: 'repository_checklist_items',
|
|
|
|
RepositoryStatusValue: 'repository_status_items'
|
|
|
|
}
|
|
|
|
|
2022-02-01 21:39:04 +08:00
|
|
|
REPOSITORY_ADVANCED_SEARCHABLE_COLUMNS = %i(
|
|
|
|
RepositoryTextValue
|
|
|
|
RepositoryNumberValue
|
|
|
|
RepositoryListValue
|
|
|
|
RepositoryChecklistValue
|
|
|
|
RepositoryStatusValue
|
|
|
|
RepositoryAssetValue
|
|
|
|
RepositoryDateTimeValue
|
|
|
|
RepositoryDateTimeRangeValue
|
|
|
|
RepositoryDateValue
|
|
|
|
RepositoryDateRangeValue
|
|
|
|
RepositoryTimeValue
|
|
|
|
RepositoryTimeRangeValue
|
2022-03-23 17:05:07 +08:00
|
|
|
RepositoryStockValue
|
2022-02-01 21:39:04 +08:00
|
|
|
)
|
|
|
|
|
2023-11-24 21:21:11 +08:00
|
|
|
STI_PRELOAD_CLASSES = %w(LinkedRepository)
|
|
|
|
|
2020-01-24 23:33:44 +08:00
|
|
|
# Array of preload relations used in search query for repository rows
|
|
|
|
REPOSITORY_ROWS_PRELOAD_RELATIONS = []
|
2017-08-30 00:49:07 +08:00
|
|
|
|
|
|
|
# List of implemented core API versions
|
2018-10-06 17:47:23 +08:00
|
|
|
API_VERSIONS = ['v1']
|
2017-08-30 00:49:07 +08:00
|
|
|
|
|
|
|
# Array used for injecting names of additional authentication methods for API
|
2018-07-24 20:21:33 +08:00
|
|
|
API_PLUGABLE_AUTH_METHODS = [:azure_jwt_auth]
|
2017-08-30 00:49:07 +08:00
|
|
|
|
2018-10-16 21:35:02 +08:00
|
|
|
API_REPOSITORY_DATA_TYPE_MAPPINGS = { 'RepositoryTextValue' => 'text',
|
|
|
|
'RepositoryDateValue' => 'date',
|
2020-03-12 19:04:29 +08:00
|
|
|
'RepositoryNumberValue' => 'number',
|
2020-02-17 07:26:20 +08:00
|
|
|
'RepositoryTimeValue' => 'time',
|
|
|
|
'RepositoryDateTimeValue' => 'date_time',
|
|
|
|
'RepositoryDateRangeValue' => 'date_range',
|
|
|
|
'RepositoryTimeRangeValue' => 'time_range',
|
|
|
|
'RepositoryDateTimeRangeValue' => 'date_time_range',
|
2018-10-16 21:35:02 +08:00
|
|
|
'RepositoryListValue' => 'list',
|
2020-02-17 07:26:20 +08:00
|
|
|
'RepositoryChecklistValue' => 'checklist',
|
2019-10-21 17:53:18 +08:00
|
|
|
'RepositoryAssetValue' => 'file',
|
2022-04-08 20:09:00 +08:00
|
|
|
'RepositoryStatusValue' => 'status',
|
2022-04-19 22:05:17 +08:00
|
|
|
'RepositoryStockValue' => 'stock' }
|
2018-10-16 21:35:02 +08:00
|
|
|
|
2021-11-02 23:19:56 +08:00
|
|
|
OMNIAUTH_PROVIDERS = %i(linkedin customazureactivedirectory okta)
|
2018-01-18 22:25:51 +08:00
|
|
|
|
|
|
|
INITIAL_USER_OPTIONS = {}
|
2018-03-01 21:04:57 +08:00
|
|
|
|
2018-02-26 21:23:02 +08:00
|
|
|
# Hash used for mapping file extensions to custom icons,
|
|
|
|
# 'extension' => 'path_to_the_icon'
|
|
|
|
FILE_ICON_MAPPINGS = {}
|
2018-03-30 17:50:28 +08:00
|
|
|
|
|
|
|
# Hash used for mapping file extensions to custom font awesome icon classes,
|
|
|
|
# 'extension' => 'fa class'
|
|
|
|
FILE_FA_ICON_MAPPINGS = {}
|
2019-04-23 21:16:40 +08:00
|
|
|
|
|
|
|
# Mapping of rich text fileds to specific model
|
2022-05-11 18:58:10 +08:00
|
|
|
RICH_TEXT_FIELD_MAPPINGS = { 'StepText' => :text,
|
2019-04-23 21:16:40 +08:00
|
|
|
'ResultText' => :text,
|
|
|
|
'Protocol' => :description,
|
|
|
|
'MyModule' => :description }
|
2019-04-23 23:01:13 +08:00
|
|
|
|
2020-10-02 20:49:08 +08:00
|
|
|
DEFAULT_DASHBOARD_CONFIGURATION = [
|
|
|
|
{ partial: 'dashboards/current_tasks', visible: true, size: 'large-widget', position: 1 },
|
|
|
|
{ partial: 'dashboards/calendar', visible: true, size: 'small-widget', position: 2 },
|
|
|
|
{ partial: 'dashboards/recent_work', visible: true, size: 'medium-widget', position: 3 }
|
|
|
|
]
|
|
|
|
|
2019-02-26 18:01:15 +08:00
|
|
|
ACTIVITY_SUBJECT_TYPES = %w(
|
2022-02-02 17:33:02 +08:00
|
|
|
Team RepositoryBase Project Experiment MyModule Result Protocol Report RepositoryRow
|
2022-08-22 23:38:52 +08:00
|
|
|
ProjectFolder Asset Step LabelTemplate
|
2019-02-28 21:01:58 +08:00
|
|
|
).freeze
|
2019-02-26 18:01:15 +08:00
|
|
|
|
|
|
|
SEARCHABLE_ACTIVITY_SUBJECT_TYPES = %w(
|
2020-04-09 18:33:04 +08:00
|
|
|
RepositoryBase RepositoryRow Project Experiment MyModule Result Protocol Step Report
|
2019-02-28 21:01:58 +08:00
|
|
|
).freeze
|
|
|
|
|
2019-03-29 16:26:27 +08:00
|
|
|
ACTIVITY_SUBJECT_CHILDREN = {
|
2022-07-07 18:00:35 +08:00
|
|
|
repository_base: [:repository_rows],
|
2020-02-07 20:53:25 +08:00
|
|
|
repository_row: nil,
|
|
|
|
report: nil,
|
2023-08-23 22:49:17 +08:00
|
|
|
team: [:projects],
|
|
|
|
project: [:experiments],
|
2020-02-07 20:53:25 +08:00
|
|
|
experiment: [:my_modules],
|
2021-10-28 22:35:47 +08:00
|
|
|
my_module: %i(results protocols),
|
2023-09-05 22:23:42 +08:00
|
|
|
result: [:assets],
|
2020-02-07 20:53:25 +08:00
|
|
|
protocol: [:steps],
|
2021-10-28 22:35:47 +08:00
|
|
|
step: [:assets]
|
2019-08-13 04:31:47 +08:00
|
|
|
}
|
2019-03-29 16:26:27 +08:00
|
|
|
|
2020-08-04 22:40:06 +08:00
|
|
|
ACTIVITY_MESSAGE_ITEMS_TYPES =
|
|
|
|
ACTIVITY_SUBJECT_TYPES + %w(
|
2023-08-01 17:13:39 +08:00
|
|
|
User Tag RepositoryColumn RepositoryRow Step Result Asset TinyMceAsset
|
2020-12-01 21:51:26 +08:00
|
|
|
Repository MyModuleStatus RepositorySnapshot
|
2020-08-04 22:40:06 +08:00
|
|
|
).freeze
|
|
|
|
|
2019-02-25 22:21:13 +08:00
|
|
|
ACTIVITY_TYPES = {
|
|
|
|
create_project: 0,
|
|
|
|
rename_project: 1,
|
|
|
|
change_project_visibility: 2,
|
|
|
|
archive_project: 3,
|
|
|
|
restore_project: 4,
|
|
|
|
assign_user_to_project: 5,
|
|
|
|
change_user_role_on_project: 6,
|
|
|
|
unassign_user_from_project: 7,
|
|
|
|
create_module: 8,
|
|
|
|
clone_module: 9,
|
2019-04-04 01:13:00 +08:00
|
|
|
archive_module: 10,
|
2019-02-25 22:21:13 +08:00
|
|
|
restore_module: 11,
|
|
|
|
change_module_description: 12,
|
2021-10-28 22:32:05 +08:00
|
|
|
designate_user_to_my_module: 13,
|
|
|
|
undesignate_user_from_my_module: 14,
|
2019-02-25 22:21:13 +08:00
|
|
|
create_step: 15,
|
|
|
|
destroy_step: 16,
|
|
|
|
add_comment_to_step: 17,
|
|
|
|
complete_step: 18,
|
|
|
|
uncomplete_step: 19,
|
|
|
|
check_step_checklist_item: 20,
|
|
|
|
uncheck_step_checklist_item: 21,
|
|
|
|
edit_step: 22,
|
2023-09-12 15:45:34 +08:00
|
|
|
add_result_old: 23,
|
2019-02-25 22:21:13 +08:00
|
|
|
add_comment_to_result: 24,
|
2023-09-12 15:45:34 +08:00
|
|
|
archive_result_old: 25,
|
|
|
|
edit_result_old: 26,
|
2019-02-25 22:21:13 +08:00
|
|
|
create_experiment: 27,
|
|
|
|
edit_experiment: 28,
|
|
|
|
archive_experiment: 29,
|
|
|
|
clone_experiment: 30,
|
|
|
|
move_experiment: 31,
|
|
|
|
add_comment_to_project: 32,
|
|
|
|
edit_project_comment: 33,
|
|
|
|
delete_project_comment: 34,
|
|
|
|
add_comment_to_module: 35,
|
|
|
|
edit_module_comment: 36,
|
|
|
|
delete_module_comment: 37,
|
|
|
|
edit_step_comment: 38,
|
|
|
|
delete_step_comment: 39,
|
|
|
|
edit_result_comment: 40,
|
|
|
|
delete_result_comment: 41,
|
2023-09-12 15:45:34 +08:00
|
|
|
destroy_result_old: 42,
|
2019-03-27 18:24:44 +08:00
|
|
|
start_edit_wopi_file: 43, # not in use
|
|
|
|
unlock_wopi_file: 44, # not in use
|
2019-03-19 23:12:07 +08:00
|
|
|
load_protocol_to_task_from_file: 45,
|
|
|
|
load_protocol_to_task_from_repository: 46,
|
|
|
|
update_protocol_in_task_from_repository: 47,
|
2019-02-25 22:21:13 +08:00
|
|
|
create_report: 48,
|
|
|
|
delete_report: 49,
|
|
|
|
edit_report: 50,
|
2019-03-27 18:24:44 +08:00
|
|
|
assign_sample: 51, # not in use
|
|
|
|
unassign_sample: 52, # not in use
|
2019-02-25 22:21:13 +08:00
|
|
|
complete_task: 53,
|
|
|
|
uncomplete_task: 54,
|
|
|
|
assign_repository_record: 55,
|
2019-03-06 22:42:33 +08:00
|
|
|
unassign_repository_record: 56,
|
|
|
|
restore_experiment: 57,
|
|
|
|
rename_task: 58,
|
|
|
|
move_task: 59,
|
|
|
|
set_task_due_date: 61,
|
|
|
|
change_task_due_date: 62,
|
|
|
|
remove_task_due_date: 63,
|
|
|
|
add_task_tag: 64,
|
2019-04-30 16:23:09 +08:00
|
|
|
edit_tag: 65,
|
2019-04-05 22:25:22 +08:00
|
|
|
remove_task_tag: 66, # 67, 68, 69 are in addons
|
2019-03-06 22:42:33 +08:00
|
|
|
create_inventory: 70,
|
|
|
|
rename_inventory: 71,
|
|
|
|
delete_inventory: 72,
|
|
|
|
create_item_inventory: 73,
|
|
|
|
edit_item_inventory: 74,
|
|
|
|
delete_item_inventory: 75,
|
|
|
|
create_column_inventory: 76,
|
|
|
|
edit_column_inventory: 77,
|
|
|
|
delete_column_inventory: 78,
|
|
|
|
update_protocol_in_repository_from_task: 79,
|
|
|
|
create_protocol_in_repository: 80,
|
|
|
|
add_step_to_protocol_repository: 81,
|
|
|
|
edit_step_in_protocol_repository: 82,
|
|
|
|
delete_step_in_protocol_repository: 83,
|
|
|
|
edit_description_in_protocol_repository: 84,
|
|
|
|
edit_keywords_in_protocol_repository: 85,
|
|
|
|
edit_authors_in_protocol_repository: 86,
|
|
|
|
archive_protocol_in_repository: 87,
|
|
|
|
restore_protocol_in_repository: 88,
|
|
|
|
move_protocol_in_repository: 89,
|
|
|
|
import_protocol_in_repository: 90,
|
|
|
|
export_protocol_in_repository: 91,
|
|
|
|
invite_user_to_team: 92,
|
|
|
|
remove_user_from_team: 93,
|
|
|
|
change_users_role_on_team: 94,
|
|
|
|
export_projects: 95,
|
2019-04-05 22:25:22 +08:00
|
|
|
export_inventory_items: 96, # 97 is in addon
|
2019-03-19 23:12:07 +08:00
|
|
|
edit_wopi_file_on_result: 99,
|
2019-03-29 22:09:20 +08:00
|
|
|
edit_wopi_file_on_step: 100,
|
2019-04-05 22:25:22 +08:00
|
|
|
edit_wopi_file_on_step_in_repository: 101,
|
|
|
|
copy_inventory_item: 102,
|
2019-04-02 17:50:37 +08:00
|
|
|
copy_protocol_in_repository: 103,
|
|
|
|
user_leave_team: 104,
|
2019-03-29 18:24:22 +08:00
|
|
|
copy_inventory: 105,
|
2019-04-30 16:23:09 +08:00
|
|
|
export_protocol_from_task: 106,
|
2019-04-30 18:07:59 +08:00
|
|
|
import_inventory_items: 107,
|
2019-04-30 16:23:09 +08:00
|
|
|
create_tag: 108,
|
2019-06-14 22:15:30 +08:00
|
|
|
delete_tag: 109,
|
|
|
|
edit_image_on_result: 110,
|
|
|
|
edit_image_on_step: 111,
|
|
|
|
edit_image_on_step_in_repository: 112,
|
2019-07-16 18:21:20 +08:00
|
|
|
share_inventory: 113,
|
2019-08-06 21:17:13 +08:00
|
|
|
unshare_inventory: 114,
|
2019-08-09 15:47:07 +08:00
|
|
|
edit_chemical_structure_on_step: 115,
|
|
|
|
edit_chemical_structure_on_result: 116,
|
|
|
|
edit_chemical_structure_on_step_in_repository: 117,
|
|
|
|
edit_chemical_structure_on_task_protocol: 118,
|
|
|
|
edit_chemical_structure_on_protocol: 119,
|
|
|
|
edit_chemical_structure_on_task: 120,
|
|
|
|
create_chemical_structure_on_step: 121,
|
|
|
|
create_chemical_structure_on_result: 122,
|
|
|
|
create_chemical_structure_on_step_in_repository: 123,
|
|
|
|
create_chemical_structure_on_task_protocol: 124,
|
|
|
|
create_chemical_structure_on_protocol: 125,
|
|
|
|
create_chemical_structure_on_task: 126,
|
|
|
|
delete_chemical_structure_on_step: 127,
|
|
|
|
delete_chemical_structure_on_result: 128,
|
|
|
|
delete_chemical_structure_on_step_in_repository: 129,
|
|
|
|
delete_chemical_structure_on_task_protocol: 130,
|
|
|
|
delete_chemical_structure_on_protocol: 131,
|
2019-09-16 17:56:49 +08:00
|
|
|
delete_chemical_structure_on_task: 132,
|
2019-08-13 20:05:55 +08:00
|
|
|
update_share_inventory: 133,
|
|
|
|
share_inventory_with_all: 134,
|
|
|
|
unshare_inventory_with_all: 135,
|
2019-11-27 21:37:53 +08:00
|
|
|
update_share_with_all_permission_level: 136,
|
2020-03-28 00:35:24 +08:00
|
|
|
protocol_description_in_task_edited: 137,
|
|
|
|
set_task_start_date: 138,
|
|
|
|
change_task_start_date: 139,
|
2020-05-26 21:34:20 +08:00
|
|
|
remove_task_start_date: 140,
|
2020-06-24 20:04:54 +08:00
|
|
|
rename_experiment: 141,
|
2020-06-11 22:11:23 +08:00
|
|
|
archive_inventory_item: 142,
|
2020-06-19 00:07:23 +08:00
|
|
|
restore_inventory_item: 143,
|
|
|
|
archive_inventory: 144,
|
2020-08-05 15:59:58 +08:00
|
|
|
restore_inventory: 145,
|
|
|
|
export_inventory_items_assigned_to_task: 146,
|
2020-08-04 22:40:06 +08:00
|
|
|
export_inventory_snapshot_items_assigned_to_task: 147,
|
2020-12-01 21:51:26 +08:00
|
|
|
change_status_on_task_flow: 148, # 149..157 in AdddOn!
|
|
|
|
move_project: 158,
|
|
|
|
create_project_folder: 159,
|
|
|
|
move_project_folder: 160,
|
|
|
|
rename_project_folder: 161,
|
2021-05-06 20:00:33 +08:00
|
|
|
delete_project_folder: 162,
|
|
|
|
generate_pdf_report: 163,
|
2021-07-15 18:37:04 +08:00
|
|
|
generate_docx_report: 164,
|
2021-06-27 15:45:32 +08:00
|
|
|
change_user_role_on_experiment: 165,
|
2021-09-06 16:33:32 +08:00
|
|
|
change_user_role_on_my_module: 166,
|
2022-02-02 17:33:02 +08:00
|
|
|
inventory_item_stock_set: 180,
|
|
|
|
inventory_item_stock_add: 181,
|
2022-03-10 01:43:38 +08:00
|
|
|
inventory_item_stock_remove: 182,
|
2022-06-01 18:30:09 +08:00
|
|
|
task_inventory_item_stock_consumed: 183,
|
|
|
|
task_steps_rearranged: 184,
|
|
|
|
task_step_content_rearranged: 185,
|
|
|
|
protocol_steps_rearranged: 186,
|
|
|
|
protocol_step_content_rearranged: 187,
|
|
|
|
task_step_file_added: 188,
|
|
|
|
task_step_file_deleted: 189,
|
|
|
|
protocol_step_file_added: 190,
|
2022-06-02 17:15:32 +08:00
|
|
|
protocol_step_file_deleted: 191,
|
|
|
|
task_step_text_added: 192,
|
|
|
|
task_step_text_edited: 193,
|
|
|
|
task_step_text_deleted: 194,
|
|
|
|
task_step_table_added: 195,
|
|
|
|
task_step_table_edited: 196,
|
|
|
|
task_step_table_deleted: 197,
|
|
|
|
task_step_checklist_added: 198,
|
|
|
|
task_step_checklist_edited: 199,
|
|
|
|
task_step_checklist_deleted: 200,
|
|
|
|
task_step_checklist_item_added: 201,
|
|
|
|
task_step_checklist_item_edited: 202,
|
|
|
|
task_step_checklist_item_deleted: 203,
|
|
|
|
protocol_step_text_added: 204,
|
|
|
|
protocol_step_text_edited: 205,
|
|
|
|
protocol_step_text_deleted: 206,
|
|
|
|
protocol_step_table_added: 207,
|
|
|
|
protocol_step_table_edited: 208,
|
|
|
|
protocol_step_table_deleted: 209,
|
|
|
|
protocol_step_checklist_added: 210,
|
|
|
|
protocol_step_checklist_edited: 211,
|
|
|
|
protocol_step_checklist_deleted: 212,
|
|
|
|
protocol_step_checklist_item_added: 213,
|
|
|
|
protocol_step_checklist_item_edited: 214,
|
2022-08-11 20:09:01 +08:00
|
|
|
protocol_step_checklist_item_deleted: 215,
|
2022-08-22 23:38:52 +08:00
|
|
|
label_template_created: 216,
|
|
|
|
label_template_edited: 217,
|
|
|
|
label_template_deleted: 218,
|
2022-09-15 16:40:17 +08:00
|
|
|
label_template_copied: 219,
|
|
|
|
edit_protocol_name_in_repository: 220,
|
2022-09-15 19:48:41 +08:00
|
|
|
protocol_name_in_task_edited: 221,
|
2022-09-15 17:25:25 +08:00
|
|
|
task_step_duplicated: 222,
|
|
|
|
protocol_step_duplicated: 223,
|
|
|
|
task_step_text_duplicated: 224,
|
|
|
|
task_step_table_duplicated: 225,
|
|
|
|
task_step_checklist_duplicated: 226,
|
|
|
|
protocol_step_text_duplicated: 227,
|
|
|
|
protocol_step_table_duplicated: 228,
|
2023-02-21 22:25:01 +08:00
|
|
|
protocol_step_checklist_duplicated: 229,
|
|
|
|
protocol_template_published: 230,
|
|
|
|
protocol_template_revision_notes_updated: 231,
|
|
|
|
protocol_template_draft_deleted: 232,
|
|
|
|
protocol_template_access_granted: 233,
|
|
|
|
protocol_template_access_changed: 234,
|
|
|
|
protocol_template_access_revoked: 235,
|
2023-03-07 21:45:52 +08:00
|
|
|
task_protocol_save_to_template: 236,
|
2023-03-30 22:04:57 +08:00
|
|
|
protocol_template_draft_created: 237,
|
|
|
|
protocol_template_access_granted_all_team_members: 238,
|
|
|
|
protocol_template_access_changed_all_team_members: 239,
|
|
|
|
protocol_template_access_revoked_all_team_members: 240,
|
2023-06-16 19:08:02 +08:00
|
|
|
project_access_changed_all_team_members: 241,
|
|
|
|
project_grant_access_to_all_team_members: 242,
|
2023-07-06 21:01:32 +08:00
|
|
|
project_remove_access_from_all_team_members: 243,
|
|
|
|
team_sharing_tasks_enabled: 244,
|
|
|
|
team_sharing_tasks_disabled: 245,
|
|
|
|
task_link_sharing_enabled: 246,
|
|
|
|
task_link_sharing_disabled: 247,
|
2023-08-01 17:13:39 +08:00
|
|
|
shared_task_message_edited: 248,
|
2023-08-29 15:42:51 +08:00
|
|
|
task_sequence_asset_added: 249,
|
|
|
|
task_sequence_asset_edit_started: 250,
|
|
|
|
task_sequence_asset_edit_finished: 251,
|
|
|
|
task_sequence_asset_deleted: 252,
|
|
|
|
protocol_sequence_asset_added: 253,
|
|
|
|
protocol_sequence_asset_edit_started: 254,
|
|
|
|
protocol_sequence_asset_edit_finished: 255,
|
2023-09-14 19:45:40 +08:00
|
|
|
protocol_sequence_asset_deleted: 256,
|
|
|
|
result_content_rearranged: 257,
|
|
|
|
add_result: 258,
|
|
|
|
edit_result: 259,
|
|
|
|
archive_result: 260,
|
|
|
|
destroy_result: 261,
|
|
|
|
result_table_added: 262,
|
|
|
|
result_file_added: 263,
|
|
|
|
result_file_deleted: 264,
|
|
|
|
result_text_added: 265,
|
|
|
|
result_text_edited: 266,
|
|
|
|
result_text_deleted: 267,
|
|
|
|
result_table_edited: 268,
|
|
|
|
result_table_deleted: 269,
|
|
|
|
result_duplicated: 270,
|
|
|
|
result_text_duplicated: 271,
|
|
|
|
result_table_duplicated: 272,
|
2023-09-19 07:17:30 +08:00
|
|
|
result_restored: 273,
|
|
|
|
task_step_file_moved: 274,
|
|
|
|
task_step_text_moved: 275,
|
|
|
|
task_step_table_moved: 276,
|
|
|
|
task_step_checklist_moved: 277,
|
|
|
|
move_chemical_structure_on_step: 278,
|
|
|
|
protocol_step_file_moved: 279,
|
|
|
|
protocol_step_text_moved: 280,
|
|
|
|
protocol_step_table_moved: 281,
|
|
|
|
protocol_step_checklist_moved: 282,
|
|
|
|
move_chemical_structure_on_step_in_repository: 283,
|
|
|
|
result_file_moved: 284,
|
|
|
|
result_text_moved: 285,
|
|
|
|
result_table_moved: 286,
|
2023-09-27 07:45:29 +08:00
|
|
|
sequence_on_result_added: 287,
|
|
|
|
sequence_on_result_edited: 288,
|
|
|
|
sequence_on_result_deleted: 289,
|
2023-10-10 20:29:06 +08:00
|
|
|
sequence_on_result_moved: 290,
|
2023-10-24 22:22:10 +08:00
|
|
|
move_chemical_structure_on_result: 291,
|
2023-11-23 17:05:42 +08:00
|
|
|
edit_item_field_inventory: 292,
|
|
|
|
export_inventories: 293,
|
|
|
|
edit_image_on_inventory_item: 294,
|
|
|
|
edit_wopi_file_on_inventory_item: 295,
|
2023-12-21 19:33:06 +08:00
|
|
|
export_inventory_stock_consumption: 296,
|
|
|
|
inventory_item_relationships_linked: 297,
|
2024-01-15 18:57:03 +08:00
|
|
|
inventory_item_relationships_unlinked: 298,
|
|
|
|
edit_task_step_file_locally: 299,
|
|
|
|
edit_protocol_template_file_locally: 300,
|
2024-03-27 18:33:33 +08:00
|
|
|
edit_task_result_file_locally: 301,
|
2024-03-28 16:52:58 +08:00
|
|
|
task_step_file_duplicated: 302,
|
|
|
|
result_file_duplicated: 303,
|
2024-03-28 18:00:14 +08:00
|
|
|
protocol_step_file_duplicated: 304,
|
2024-03-27 18:33:33 +08:00
|
|
|
task_step_asset_renamed: 305,
|
|
|
|
result_asset_renamed: 306,
|
|
|
|
protocol_step_asset_renamed: 307
|
2019-04-05 22:25:22 +08:00
|
|
|
}
|
2019-03-26 22:29:21 +08:00
|
|
|
|
|
|
|
ACTIVITY_GROUPS = {
|
2023-06-16 19:08:02 +08:00
|
|
|
projects: [*0..7, 32, 33, 34, 95, 108, 65, 109, *158..162, 241, 242, 243],
|
2024-03-28 18:00:14 +08:00
|
|
|
task_results: [23, 26, 25, 42, 24, 40, 41, 99, 110, 122, 116, 128, *246..248, *257..273, *284..291, 301, 303, 306],
|
2020-08-04 22:40:06 +08:00
|
|
|
task: [8, 58, 9, 59, *10..14, 35, 36, 37, 53, 54, *60..63, 138, 139, 140, 64, 66, 106, 126, 120, 132,
|
2023-10-16 15:27:44 +08:00
|
|
|
148, 166],
|
2021-08-13 21:15:45 +08:00
|
|
|
task_protocol: [15, 22, 16, 18, 19, 20, 21, 17, 38, 39, 100, 111, 45, 46, 47, 121, 124, 115, 118, 127, 130, 137,
|
2024-03-28 18:00:14 +08:00
|
|
|
184, 185, 188, 189, *192..203, 221, 222, 224, 225, 226, 236, *249..252, *274..278, 299, 302, 305],
|
2022-03-10 01:43:38 +08:00
|
|
|
task_inventory: [55, 56, 146, 147, 183],
|
2021-11-12 04:30:30 +08:00
|
|
|
experiment: [*27..31, 57, 141, 165],
|
2021-05-06 20:00:33 +08:00
|
|
|
reports: [48, 50, 49, 163, 164],
|
2022-02-02 17:33:02 +08:00
|
|
|
inventories: [70, 71, 105, 144, 145, 72, 73, 74, 102, 142, 143, 75, 76, 77,
|
2023-12-21 19:33:06 +08:00
|
|
|
78, 96, 107, 113, 114, *133..136, 180, 181, 182, *292..298],
|
2019-08-09 15:47:07 +08:00
|
|
|
protocol_repository: [80, 103, 89, 87, 79, 90, 91, 88, 85, 86, 84, 81, 82,
|
2024-02-05 17:25:20 +08:00
|
|
|
83, 101, 112, 123, 125, 117, 119, 129, 131, 187, 186,
|
2023-11-27 19:54:14 +08:00
|
|
|
190, 191, *204..215, 220, 223, 227, 228, 229, *230..235,
|
2024-03-28 18:00:14 +08:00
|
|
|
*237..240, *253..256, *279..283, 300, 304, 307],
|
2023-07-06 21:01:32 +08:00
|
|
|
team: [92, 94, 93, 97, 104, 244, 245],
|
2023-08-11 15:43:16 +08:00
|
|
|
label_templates: [*216..219]
|
2019-08-13 04:31:47 +08:00
|
|
|
}
|
2019-07-11 21:40:20 +08:00
|
|
|
|
2023-02-22 22:37:39 +08:00
|
|
|
TOP_LEVEL_ASSIGNABLES = %w(Project Team Protocol Repository).freeze
|
|
|
|
|
2022-06-29 21:22:22 +08:00
|
|
|
SHARED_OBJECTS_PERMISSION_LEVELS = {
|
|
|
|
not_shared: 0,
|
|
|
|
shared_read: 1,
|
|
|
|
shared_write: 2
|
|
|
|
}.freeze
|
|
|
|
|
2019-08-09 18:44:41 +08:00
|
|
|
SHARED_INVENTORIES_PL_MAPPINGS = {
|
2019-08-29 23:17:38 +08:00
|
|
|
shared_read: 'view-only',
|
|
|
|
shared_write: 'edit'
|
2019-03-26 22:29:21 +08:00
|
|
|
}.freeze
|
2020-07-23 20:22:58 +08:00
|
|
|
|
|
|
|
DASHBOARD_BLACKLIST_ACTIVITY_TYPES = %i(export_protocol_in_repository copy_protocol_in_repository).freeze
|
2020-08-18 19:06:05 +08:00
|
|
|
|
|
|
|
DEFAULT_FLOW_NAME = 'SciNote Free default task flow'
|
|
|
|
|
|
|
|
DEFAULT_FLOW_STATUSES = [
|
2023-08-17 21:53:41 +08:00
|
|
|
{ name: 'Not started', color: '#FFFFFF' },
|
|
|
|
{ name: 'In progress', color: '#3070ED', consequences: ['MyModuleStatusConsequences::Uncompletion'] },
|
|
|
|
{ name: 'Completed', color: '#5EC66F', consequences: ['MyModuleStatusConsequences::Completion'] }
|
2020-08-18 19:06:05 +08:00
|
|
|
]
|
2021-04-06 19:56:24 +08:00
|
|
|
|
2021-05-03 17:26:29 +08:00
|
|
|
REPORT_TEMPLATES = {}
|
2021-05-21 17:04:17 +08:00
|
|
|
|
2021-03-29 15:52:57 +08:00
|
|
|
NOTIFIABLE_ACTIVITIES = %w(
|
|
|
|
assign_user_to_project
|
2021-12-01 18:17:07 +08:00
|
|
|
unassign_user_from_project
|
2021-03-29 15:52:57 +08:00
|
|
|
change_user_role_on_project
|
|
|
|
edit_module_comment
|
|
|
|
delete_module_comment
|
|
|
|
add_comment_to_module
|
2021-10-28 22:32:05 +08:00
|
|
|
designate_user_to_my_module
|
|
|
|
undesignate_user_from_my_module
|
2021-03-29 15:52:57 +08:00
|
|
|
set_task_due_date
|
|
|
|
change_task_due_date
|
|
|
|
remove_task_due_date
|
|
|
|
invite_user_to_team
|
|
|
|
remove_user_from_team
|
|
|
|
change_users_role_on_team
|
|
|
|
set_task_start_date
|
|
|
|
change_task_start_date
|
|
|
|
remove_task_start_date
|
|
|
|
change_status_on_task_flow
|
|
|
|
sign_task
|
|
|
|
revoke_one_signature
|
|
|
|
reject_signature
|
|
|
|
create_group_signature_request
|
|
|
|
create_individual_signature_request
|
|
|
|
delete_individual_signature_request
|
|
|
|
delete_group_signature_request
|
2021-05-22 19:59:27 +08:00
|
|
|
change_user_role_on_experiment
|
|
|
|
change_user_role_on_my_module
|
2021-03-29 17:31:04 +08:00
|
|
|
)
|
2021-08-13 20:07:01 +08:00
|
|
|
|
2022-08-04 19:36:14 +08:00
|
|
|
DEFAULT_LABEL_TEMPLATE = {
|
|
|
|
zpl:
|
|
|
|
<<~HEREDOC
|
|
|
|
^XA
|
|
|
|
^MTT
|
|
|
|
^MUD,300,300
|
|
|
|
^PR2
|
|
|
|
^MD30
|
|
|
|
^LH20,20
|
|
|
|
^PW310
|
|
|
|
^CF0,23
|
2022-08-08 16:06:00 +08:00
|
|
|
^FO0,0^FD{{ITEM_ID}}^FS
|
|
|
|
^FO0,20^BQN,2,4^FDMA,{{ITEM_ID}}^FS
|
|
|
|
^FO95,30^FB180,4,0,L^FD{{NAME}}^FS^FS
|
2022-08-04 19:36:14 +08:00
|
|
|
^XZ
|
|
|
|
HEREDOC
|
|
|
|
}
|
2022-08-08 16:06:00 +08:00
|
|
|
|
|
|
|
LABEL_TEMPLATE_FORMAT_MAP = {
|
|
|
|
'ZebraLabelTemplate' => 'ZPL',
|
|
|
|
'FluicsLabelTemplate' => 'Fluics'
|
|
|
|
}
|
2023-05-03 17:31:17 +08:00
|
|
|
|
2023-05-19 17:26:46 +08:00
|
|
|
EXTERNAL_SERVICES = %w(
|
|
|
|
https://www.protocols.io/
|
2023-06-06 17:32:11 +08:00
|
|
|
http://127.0.0.1:9100/
|
2023-05-22 17:43:19 +08:00
|
|
|
https://marvinjs.chemicalize.com/
|
2023-05-23 15:30:59 +08:00
|
|
|
newrelic.com
|
|
|
|
*.newrelic.com
|
2023-06-01 17:24:24 +08:00
|
|
|
*.nr-data.net
|
2023-07-28 21:31:53 +08:00
|
|
|
www.recaptcha.net/
|
|
|
|
www.gstatic.com/recaptcha/
|
2024-01-12 07:10:11 +08:00
|
|
|
extras.scinote.net
|
|
|
|
https://www.scinote.net
|
2023-05-19 17:26:46 +08:00
|
|
|
)
|
2023-10-03 20:24:39 +08:00
|
|
|
|
2023-10-24 19:51:25 +08:00
|
|
|
if Constants::ASSET_SYNC_URL && EXTERNAL_SERVICES.exclude?(Constants::ASSET_SYNC_URL)
|
2023-12-05 19:35:55 +08:00
|
|
|
asset_sync_url = URI.parse(Constants::ASSET_SYNC_URL)
|
2023-12-05 22:39:57 +08:00
|
|
|
EXTERNAL_SERVICES << "#{asset_sync_url.scheme}://#{asset_sync_url.host}:#{asset_sync_url.port}"
|
2023-10-24 19:51:25 +08:00
|
|
|
end
|
2023-10-19 17:53:18 +08:00
|
|
|
|
2023-10-03 20:24:39 +08:00
|
|
|
COLORED_BACKGROUND_ACTIONS = %w(
|
|
|
|
my_modules/protocols
|
|
|
|
my_modules/signatures
|
|
|
|
my_modules/activities
|
|
|
|
results/index
|
|
|
|
protocols/show
|
2023-10-13 16:08:39 +08:00
|
|
|
preferences/index
|
2024-01-28 19:07:06 +08:00
|
|
|
addons/index
|
2023-10-03 20:24:39 +08:00
|
|
|
)
|
2023-11-27 13:21:34 +08:00
|
|
|
|
|
|
|
DEFAULT_USER_NOTIFICATION_SETTINGS = {
|
|
|
|
my_module_designation: {
|
|
|
|
email: false,
|
|
|
|
in_app: true
|
|
|
|
},
|
|
|
|
other_smart_annotation: {
|
|
|
|
email: false,
|
|
|
|
in_app: true
|
2023-11-27 19:01:23 +08:00
|
|
|
},
|
|
|
|
always_on: {
|
|
|
|
email: true,
|
|
|
|
in_app: true
|
2023-11-27 13:21:34 +08:00
|
|
|
}
|
|
|
|
}
|
2024-01-15 21:44:14 +08:00
|
|
|
|
|
|
|
WHITELISTED_USER_SETTINGS = %w(
|
|
|
|
LabelTemplates_active_state
|
|
|
|
LabelTemplates_archived_state
|
|
|
|
ExperimentList_active_state
|
|
|
|
ExperimentList_archived_state
|
|
|
|
MyModuleList_active_state
|
|
|
|
MyModuleList_archived_state
|
|
|
|
ProjectList_active_state
|
|
|
|
ProjectList_archived_state
|
|
|
|
ProtocolTemplates_active_state
|
|
|
|
ProtocolTemplates_archived_state
|
|
|
|
ReportTemplates_active_state
|
|
|
|
ReportTemplates_archived_state
|
|
|
|
Repositories_active_state
|
|
|
|
Repositories_archived_state
|
2024-04-03 19:23:10 +08:00
|
|
|
task_step_states
|
2024-04-10 22:55:49 +08:00
|
|
|
results_order
|
|
|
|
repository_export_file_type
|
2024-01-15 21:44:14 +08:00
|
|
|
).freeze
|
2016-11-08 18:26:55 +08:00
|
|
|
end
|
2021-11-02 23:19:56 +08:00
|
|
|
|
|
|
|
# rubocop:enable Style/MutableConstant
|