2016-02-12 23:52:43 +08:00
|
|
|
Rails.application.routes.draw do
|
2018-08-17 17:59:47 +08:00
|
|
|
use_doorkeeper do
|
|
|
|
skip_controllers :applications, :authorized_applications, :token_info
|
|
|
|
end
|
2017-10-04 15:16:17 +08:00
|
|
|
|
2023-01-24 22:57:59 +08:00
|
|
|
post 'access_tokens/revoke', to: 'doorkeeper/access_tokens#revoke'
|
|
|
|
|
2019-09-17 22:11:40 +08:00
|
|
|
# Addons
|
2017-10-04 15:16:17 +08:00
|
|
|
|
|
|
|
def draw(routes_name)
|
|
|
|
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
|
|
|
|
end
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
constraints UserSubdomain do
|
2019-09-12 23:21:48 +08:00
|
|
|
devise_for :users, controllers: { registrations: 'users/registrations',
|
|
|
|
sessions: 'users/sessions',
|
|
|
|
invitations: 'users/invitations',
|
|
|
|
confirmations: 'users/confirmations',
|
2020-08-07 18:17:27 +08:00
|
|
|
omniauth_callbacks: 'users/omniauth_callbacks',
|
|
|
|
passwords: 'users/passwords' }
|
2016-11-30 23:43:33 +08:00
|
|
|
|
2020-02-13 20:51:49 +08:00
|
|
|
root 'dashboards#show'
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2023-03-22 16:42:54 +08:00
|
|
|
resources :navigations, only: [] do
|
|
|
|
collection do
|
|
|
|
get :top_menu
|
2023-04-14 17:38:28 +08:00
|
|
|
post :navigator_state
|
2023-03-22 16:42:54 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-03-10 23:21:43 +08:00
|
|
|
resources :activities, only: [:index]
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2021-07-27 21:26:18 +08:00
|
|
|
get '/jobs/:id/status', to: 'active_jobs#status'
|
|
|
|
|
2017-03-10 23:21:43 +08:00
|
|
|
get 'forbidden', to: 'application#forbidden', as: 'forbidden'
|
|
|
|
get 'not_found', to: 'application#not_found', as: 'not_found'
|
2022-07-15 16:43:07 +08:00
|
|
|
get 'unprocessable_entity', to: 'application#respond_422', as: 'unprocessable_entity'
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2019-01-08 15:07:24 +08:00
|
|
|
# JS backend helpers
|
|
|
|
get 'helpers/to_user_date_format',
|
|
|
|
to: 'application#to_user_date_format',
|
|
|
|
as: 'to_user_date_format',
|
|
|
|
defaults: { format: 'json' }
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
# Settings
|
2017-07-28 21:37:28 +08:00
|
|
|
resources :users, only: :index # needed for testing signup
|
2017-11-08 23:23:52 +08:00
|
|
|
# needed for testing edit passowrd
|
|
|
|
get '/users/password', to: 'devise_password#edit'
|
2017-07-28 21:37:28 +08:00
|
|
|
|
2017-03-10 23:21:43 +08:00
|
|
|
get 'users/settings/account/preferences',
|
|
|
|
to: 'users/settings/account/preferences#index',
|
2017-01-03 16:49:18 +08:00
|
|
|
as: 'preferences'
|
2017-10-17 19:17:49 +08:00
|
|
|
get 'users/settings/account/addons',
|
|
|
|
to: 'users/settings/account/addons#index',
|
|
|
|
as: 'addons'
|
2021-07-23 19:52:28 +08:00
|
|
|
|
2022-08-04 19:36:14 +08:00
|
|
|
resources :label_templates, only: %i(index show update create) do
|
2022-07-28 20:37:59 +08:00
|
|
|
member do
|
|
|
|
post :set_default
|
|
|
|
end
|
|
|
|
collection do
|
|
|
|
post :duplicate
|
|
|
|
post :delete
|
2022-08-04 16:51:30 +08:00
|
|
|
get :datatable
|
2022-08-10 17:35:38 +08:00
|
|
|
get :template_tags
|
2022-08-24 20:10:51 +08:00
|
|
|
get :zpl_preview
|
2022-09-27 04:58:09 +08:00
|
|
|
post :sync_fluics_templates
|
2022-07-28 20:37:59 +08:00
|
|
|
end
|
|
|
|
end
|
2022-07-27 16:10:32 +08:00
|
|
|
|
2021-07-23 20:56:21 +08:00
|
|
|
resources :label_printers, except: :show, path: 'users/settings/account/addons/label_printers' do
|
|
|
|
post :create_fluics, on: :collection
|
2021-08-02 17:11:11 +08:00
|
|
|
end
|
|
|
|
|
2022-08-04 17:14:35 +08:00
|
|
|
get 'users/settings/account/addons/label_printers/settings_zebra',
|
|
|
|
to: 'label_printers#index_zebra',
|
|
|
|
as: 'zebra_settings'
|
|
|
|
|
2021-08-02 17:11:11 +08:00
|
|
|
resources :label_printers, only: [] do
|
2021-07-27 21:26:18 +08:00
|
|
|
post :print, on: :member
|
2021-08-02 17:11:11 +08:00
|
|
|
get :update_progress_modal, on: :member
|
2021-07-23 20:56:21 +08:00
|
|
|
end
|
2021-07-23 19:52:28 +08:00
|
|
|
|
2019-11-28 06:16:25 +08:00
|
|
|
get 'users/settings/account/connected_accounts',
|
|
|
|
to: 'users/settings/account/connected_accounts#index',
|
|
|
|
as: 'connected_accounts'
|
|
|
|
delete 'users/settings/account/connected_accounts',
|
|
|
|
to: 'users/settings/account/connected_accounts#destroy',
|
|
|
|
as: 'unlink_connected_account'
|
2017-03-10 23:21:43 +08:00
|
|
|
put 'users/settings/account/preferences',
|
|
|
|
to: 'users/settings/account/preferences#update',
|
2017-01-03 16:49:18 +08:00
|
|
|
as: 'update_preferences'
|
2018-09-05 22:36:32 +08:00
|
|
|
post 'users/settings/account/preferences/togglable_settings',
|
|
|
|
to: 'users/settings/account/preferences#update_togglable_settings',
|
|
|
|
as: 'update_togglable_settings',
|
2017-01-03 23:35:25 +08:00
|
|
|
defaults: { format: 'json' }
|
2017-02-09 18:07:16 +08:00
|
|
|
|
2017-03-10 23:21:43 +08:00
|
|
|
get 'users/settings/teams',
|
|
|
|
to: 'users/settings/teams#index',
|
|
|
|
as: 'teams'
|
|
|
|
post 'users/settings/teams/datatable',
|
|
|
|
to: 'users/settings/teams#datatable',
|
|
|
|
as: 'teams_datatable'
|
|
|
|
get 'users/settings/teams/new',
|
|
|
|
to: 'users/settings/teams#new',
|
|
|
|
as: 'new_team'
|
|
|
|
post 'users/settings/teams',
|
|
|
|
to: 'users/settings/teams#create',
|
|
|
|
as: 'create_team'
|
|
|
|
get 'users/settings/teams/:id',
|
|
|
|
to: 'users/settings/teams#show',
|
|
|
|
as: 'team'
|
|
|
|
post 'users/settings/teams/:id/users_datatable',
|
|
|
|
to: 'users/settings/teams#users_datatable',
|
|
|
|
as: 'team_users_datatable'
|
|
|
|
get 'users/settings/teams/:id/name_html',
|
|
|
|
to: 'users/settings/teams#name_html',
|
|
|
|
as: 'team_name'
|
|
|
|
get 'users/settings/teams/:id/description_html',
|
|
|
|
to: 'users/settings/teams#description_html',
|
|
|
|
as: 'team_description'
|
|
|
|
put 'users/settings/teams/:id',
|
|
|
|
to: 'users/settings/teams#update',
|
|
|
|
as: 'update_team'
|
|
|
|
delete 'users/settings/teams/:id',
|
|
|
|
to: 'users/settings/teams#destroy',
|
|
|
|
as: 'destroy_team'
|
2017-02-09 21:33:12 +08:00
|
|
|
|
2017-03-10 23:21:43 +08:00
|
|
|
put 'users/settings/user_teams/:id',
|
|
|
|
to: 'users/settings/user_teams#update',
|
|
|
|
as: 'update_user_team'
|
|
|
|
get 'users/settings/user_teams/:id/leave_html',
|
|
|
|
to: 'users/settings/user_teams#leave_html',
|
|
|
|
as: 'leave_user_team_html'
|
|
|
|
get 'users/settings/user_teams/:id/destroy_html',
|
|
|
|
to: 'users/settings/user_teams#destroy_html',
|
|
|
|
as: 'destroy_user_team_html'
|
|
|
|
delete 'users/settings/user_teams/:id',
|
|
|
|
to: 'users/settings/user_teams#destroy',
|
|
|
|
as: 'destroy_user_team'
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2021-06-03 20:00:43 +08:00
|
|
|
namespace :users do
|
|
|
|
namespace :settings do
|
2023-03-22 16:42:54 +08:00
|
|
|
resources :teams, only: [] do
|
|
|
|
member do
|
|
|
|
post :switch
|
|
|
|
end
|
|
|
|
end
|
2021-06-09 18:53:11 +08:00
|
|
|
resources :webhooks, only: %i(index create update destroy) do
|
2021-06-03 20:00:43 +08:00
|
|
|
collection do
|
|
|
|
post :destroy_filter
|
|
|
|
get :filter_info
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2017-01-03 23:35:25 +08:00
|
|
|
# Invite users
|
|
|
|
devise_scope :user do
|
|
|
|
post '/invite',
|
|
|
|
to: 'users/invitations#invite_users',
|
|
|
|
as: 'invite_users'
|
2021-07-05 18:39:54 +08:00
|
|
|
get '/invitable_teams',
|
|
|
|
to: 'users/invitations#invitable_teams',
|
|
|
|
as: 'invitable_teams'
|
2017-01-03 23:35:25 +08:00
|
|
|
end
|
2016-09-29 20:49:58 +08:00
|
|
|
|
2023-04-12 17:14:53 +08:00
|
|
|
resources :user_notifications, only: :index do
|
|
|
|
collection do
|
|
|
|
get :unseen_counter
|
|
|
|
end
|
|
|
|
end
|
2016-10-03 20:40:15 +08:00
|
|
|
|
2017-03-21 23:15:11 +08:00
|
|
|
# Get Zip Export
|
|
|
|
get 'zip_exports/download/:id',
|
|
|
|
to: 'zip_exports#download',
|
|
|
|
as: 'zip_exports_download'
|
2017-03-24 19:42:50 +08:00
|
|
|
|
2018-09-17 02:28:26 +08:00
|
|
|
# Get Team Zip Export
|
|
|
|
get 'zip_exports/download_export_all_zip/:id',
|
|
|
|
to: 'zip_exports#download_export_all_zip',
|
|
|
|
as: 'zip_exports_download_export_all'
|
|
|
|
|
2017-03-27 16:38:28 +08:00
|
|
|
get 'zip_exports/file_expired',
|
|
|
|
to: 'zip_exports#file_expired',
|
|
|
|
as: 'file_expired'
|
|
|
|
|
2017-03-10 23:21:43 +08:00
|
|
|
resources :teams do
|
2017-05-24 15:29:44 +08:00
|
|
|
resources :repositories, only: %i(index create destroy update) do
|
|
|
|
collection do
|
2020-06-19 00:07:23 +08:00
|
|
|
post 'archive', to: 'repositories#archive',
|
|
|
|
defaults: { format: 'json' }
|
|
|
|
post 'restore', to: 'repositories#restore',
|
|
|
|
defaults: { format: 'json' }
|
2017-06-06 21:50:43 +08:00
|
|
|
get 'create_modal', to: 'repositories#create_modal',
|
2017-05-24 15:29:44 +08:00
|
|
|
defaults: { format: 'json' }
|
|
|
|
end
|
2017-06-01 01:24:38 +08:00
|
|
|
get 'destroy_modal', to: 'repositories#destroy_modal',
|
|
|
|
defaults: { format: 'json' }
|
|
|
|
get 'rename_modal', to: 'repositories#rename_modal',
|
|
|
|
defaults: { format: 'json' }
|
2017-06-08 00:43:48 +08:00
|
|
|
get 'copy_modal', to: 'repositories#copy_modal',
|
|
|
|
defaults: { format: 'json' }
|
2017-06-08 01:11:25 +08:00
|
|
|
post 'copy', to: 'repositories#copy',
|
|
|
|
defaults: { format: 'json' }
|
2019-08-05 19:07:29 +08:00
|
|
|
get :share_modal
|
2022-03-30 16:54:55 +08:00
|
|
|
post 'hide_reminders', to: 'repositories#hide_reminders'
|
2019-07-15 23:00:55 +08:00
|
|
|
|
2019-08-29 23:17:38 +08:00
|
|
|
resources :team_repositories, only: %i(destroy) do
|
2019-08-06 21:17:13 +08:00
|
|
|
collection do
|
2019-08-29 23:17:38 +08:00
|
|
|
post 'update'
|
2019-08-06 21:17:13 +08:00
|
|
|
end
|
|
|
|
end
|
2017-05-30 21:11:28 +08:00
|
|
|
end
|
2020-07-15 00:48:18 +08:00
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
member do
|
2018-04-10 19:19:53 +08:00
|
|
|
post 'parse_sheet', defaults: { format: 'json' }
|
2017-06-06 22:12:34 +08:00
|
|
|
post 'export_repository', to: 'repositories#export_repository'
|
2018-10-12 04:55:35 +08:00
|
|
|
post 'export_projects'
|
2020-12-08 23:07:26 +08:00
|
|
|
get 'sidebar'
|
2018-11-16 20:37:32 +08:00
|
|
|
get 'export_projects_modal'
|
2017-03-10 23:21:43 +08:00
|
|
|
# Used for atwho (smart annotations)
|
|
|
|
get 'atwho_users', to: 'at_who#users'
|
2020-09-04 22:48:53 +08:00
|
|
|
get 'atwho_menu', to: 'at_who#menu'
|
2018-04-03 02:38:56 +08:00
|
|
|
get 'atwho_rep_items', to: 'at_who#rep_items'
|
2017-03-10 23:21:43 +08:00
|
|
|
get 'atwho_projects', to: 'at_who#projects'
|
|
|
|
get 'atwho_experiments', to: 'at_who#experiments'
|
|
|
|
get 'atwho_my_modules', to: 'at_who#my_modules'
|
|
|
|
get 'atwho_menu_items', to: 'at_who#menu_items'
|
2017-01-03 16:49:18 +08:00
|
|
|
end
|
2019-06-11 23:04:59 +08:00
|
|
|
|
2019-06-13 14:49:03 +08:00
|
|
|
# External protocols routes
|
|
|
|
get 'list_external_protocol', to: 'external_protocols#index'
|
2019-06-13 17:17:08 +08:00
|
|
|
get 'show_external_protocol', to: 'external_protocols#show'
|
2019-06-13 06:17:32 +08:00
|
|
|
get 'build_external_protocol', to: 'external_protocols#new'
|
2019-06-13 07:02:44 +08:00
|
|
|
post 'import_external_protocol', to: 'external_protocols#create'
|
2019-06-13 14:49:03 +08:00
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
match '*path',
|
2017-03-10 23:21:43 +08:00
|
|
|
to: 'teams#routing_error',
|
2017-01-03 16:49:18 +08:00
|
|
|
via: [:get, :post, :put, :patch]
|
|
|
|
end
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2021-04-20 19:35:40 +08:00
|
|
|
resources :reports, only: [:index, :new, :create, :update] do
|
2021-03-23 22:20:40 +08:00
|
|
|
member do
|
|
|
|
get :document_preview
|
2021-04-13 22:36:52 +08:00
|
|
|
get :save_pdf_to_inventory_modal, defaults: { format: 'json' }
|
|
|
|
post :save_pdf_to_inventory_item, defaults: { format: 'json' }
|
2021-03-23 22:20:40 +08:00
|
|
|
end
|
2021-04-06 21:27:12 +08:00
|
|
|
collection do
|
|
|
|
get :project_contents
|
|
|
|
end
|
2021-03-23 22:20:40 +08:00
|
|
|
end
|
2018-04-18 22:47:52 +08:00
|
|
|
get 'reports/datatable', to: 'reports#datatable'
|
2021-04-06 19:56:24 +08:00
|
|
|
get 'reports/new_template_values', to: 'reports#new_template_values', defaults: { format: 'json' }
|
2018-05-16 15:31:19 +08:00
|
|
|
post 'reports/available_repositories', to: 'reports#available_repositories',
|
|
|
|
defaults: { format: 'json' }
|
2018-05-17 17:21:34 +08:00
|
|
|
post 'available_asset_type_columns',
|
|
|
|
to: 'repository_columns#available_asset_type_columns',
|
|
|
|
defaults: { format: 'json' }
|
2018-04-18 22:47:52 +08:00
|
|
|
post 'reports/destroy', to: 'reports#destroy'
|
|
|
|
|
2020-02-13 20:50:29 +08:00
|
|
|
resource :dashboard, only: :show do
|
2020-02-14 19:07:40 +08:00
|
|
|
resource :current_tasks, module: 'dashboard', only: :show do
|
2020-02-17 17:47:10 +08:00
|
|
|
get :project_filter
|
|
|
|
get :experiment_filter
|
2020-02-14 19:07:40 +08:00
|
|
|
end
|
2020-02-25 00:09:10 +08:00
|
|
|
|
|
|
|
namespace :quick_start, module: :dashboard, controller: :quick_start do
|
2020-03-05 06:26:01 +08:00
|
|
|
get :project_filter
|
|
|
|
get :experiment_filter
|
2020-02-25 00:09:10 +08:00
|
|
|
post :create_task
|
|
|
|
end
|
2020-02-28 21:37:27 +08:00
|
|
|
|
2020-02-21 00:02:38 +08:00
|
|
|
resource :calendar, module: 'dashboard', only: [:show] do
|
|
|
|
get :day
|
|
|
|
end
|
2020-03-06 20:51:18 +08:00
|
|
|
|
|
|
|
resource :recent_works, module: 'dashboard', only: [:show]
|
2020-02-13 20:50:29 +08:00
|
|
|
end
|
|
|
|
|
2021-04-18 18:23:29 +08:00
|
|
|
namespace :access_permissions do
|
2021-05-09 00:06:07 +08:00
|
|
|
resources :projects, defaults: { format: 'json' } do
|
2021-12-01 23:23:24 +08:00
|
|
|
put :update_default_public_user_role, on: :member
|
2021-05-09 00:06:07 +08:00
|
|
|
end
|
2023-02-23 21:57:38 +08:00
|
|
|
|
|
|
|
resources :protocols, defaults: { format: 'json' } do
|
|
|
|
put :update_default_public_user_role, on: :member
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :experiments, only: %i(show update edit)
|
|
|
|
resources :my_modules, only: %i(show update edit)
|
2021-04-18 18:23:29 +08:00
|
|
|
end
|
|
|
|
|
2023-04-21 21:25:52 +08:00
|
|
|
namespace :navigator do
|
|
|
|
resources :project_folders, only: %i(show) do
|
|
|
|
member do
|
|
|
|
get :tree
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :projects, only: %i(show index) do
|
|
|
|
member do
|
|
|
|
get :tree
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :experiments, only: %i(show) do
|
|
|
|
member do
|
|
|
|
get :tree
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :my_modules, only: %i(show) do
|
|
|
|
member do
|
|
|
|
get :tree
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-12-29 05:49:52 +08:00
|
|
|
resources :projects, except: [:destroy] do
|
2017-01-03 16:49:18 +08:00
|
|
|
resources :project_comments,
|
|
|
|
path: '/comments',
|
2021-09-22 17:28:32 +08:00
|
|
|
only: %i(create index update destroy)
|
2017-01-03 16:49:18 +08:00
|
|
|
# Activities popup (JSON) for individual project in projects index,
|
|
|
|
# as well as all activities page for single project (HTML)
|
2017-03-10 23:21:43 +08:00
|
|
|
resources :project_activities, path: '/activities', only: [:index]
|
2017-01-03 16:49:18 +08:00
|
|
|
resources :tags, only: [:create, :update, :destroy]
|
2022-12-19 18:55:38 +08:00
|
|
|
post :create_tag
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
resources :reports,
|
|
|
|
path: '/reports',
|
2018-04-18 22:47:52 +08:00
|
|
|
only: %i(edit update create) do
|
2021-03-16 20:47:23 +08:00
|
|
|
member do
|
2021-04-14 21:45:51 +08:00
|
|
|
post 'generate_pdf', to: 'reports#generate_pdf'
|
|
|
|
post 'generate_docx', to: 'reports#generate_docx'
|
2021-04-14 20:40:13 +08:00
|
|
|
get 'status', to: 'reports#status', format: %w(json)
|
2021-03-16 20:47:23 +08:00
|
|
|
end
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
collection do
|
2021-06-10 16:59:34 +08:00
|
|
|
get 'new', to: 'reports#new'
|
2017-01-03 16:49:18 +08:00
|
|
|
end
|
|
|
|
end
|
2021-02-03 21:23:38 +08:00
|
|
|
resources :experiments, only: %i(new create), defaults: { format: 'json' } do
|
|
|
|
collection do
|
|
|
|
post 'archive_group' # archive group of experements
|
2021-02-09 22:47:15 +08:00
|
|
|
post 'restore_group' # restore group of experementss
|
2021-02-03 21:23:38 +08:00
|
|
|
end
|
|
|
|
end
|
2017-01-03 16:49:18 +08:00
|
|
|
member do
|
|
|
|
# Notifications popup for individual project in projects index
|
|
|
|
get 'notifications'
|
2022-09-02 19:57:52 +08:00
|
|
|
get 'permissions'
|
2021-02-02 18:17:29 +08:00
|
|
|
get 'experiments_cards'
|
|
|
|
get 'sidebar'
|
2022-09-02 19:47:45 +08:00
|
|
|
get 'actions_dropdown'
|
2021-02-11 18:50:59 +08:00
|
|
|
put 'view_type'
|
2017-01-03 16:49:18 +08:00
|
|
|
end
|
2017-03-10 23:21:43 +08:00
|
|
|
|
2020-10-26 23:17:39 +08:00
|
|
|
collection do
|
2020-11-24 22:42:06 +08:00
|
|
|
get 'cards', to: 'projects#cards'
|
2020-11-25 01:10:58 +08:00
|
|
|
get 'users_filter'
|
2020-12-29 05:49:52 +08:00
|
|
|
post 'archive_group'
|
2021-01-10 04:27:19 +08:00
|
|
|
post 'restore_group'
|
2021-02-11 18:50:59 +08:00
|
|
|
put 'view_type', to: 'teams#view_type'
|
2023-04-26 17:20:10 +08:00
|
|
|
get 'actions_toolbar'
|
2020-10-26 23:17:39 +08:00
|
|
|
end
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
2020-12-14 22:54:18 +08:00
|
|
|
resources :project_folders, only: %i(create new update edit) do
|
2020-11-20 18:06:19 +08:00
|
|
|
get 'cards', to: 'projects#cards'
|
2020-11-04 16:54:23 +08:00
|
|
|
|
2021-01-06 22:02:26 +08:00
|
|
|
collection do
|
2020-11-04 16:54:23 +08:00
|
|
|
post 'move_to', to: 'project_folders#move_to', defaults: { format: 'json' }
|
2021-01-06 22:02:26 +08:00
|
|
|
get 'move_to_modal', to: 'project_folders#move_to_modal', defaults: { format: 'json' }
|
2021-01-22 02:42:25 +08:00
|
|
|
post 'destroy', to: 'project_folders#destroy', as: 'destroy', defaults: { format: 'json' }
|
2023-05-04 20:59:16 +08:00
|
|
|
get 'destroy_modal', to: 'project_folders#destroy_modal', defaults: { format: 'json' }
|
2020-11-04 16:54:23 +08:00
|
|
|
end
|
2020-11-20 18:06:19 +08:00
|
|
|
end
|
2020-12-04 19:58:23 +08:00
|
|
|
get 'project_folders/:project_folder_id', to: 'projects#index', as: :project_folder_projects
|
2020-11-20 18:06:19 +08:00
|
|
|
|
2021-01-28 04:53:39 +08:00
|
|
|
resources :experiments, only: %i(show edit update) do
|
2021-02-09 22:47:15 +08:00
|
|
|
collection do
|
|
|
|
get 'edit', action: :edit
|
|
|
|
get 'clone_modal', action: :clone_modal
|
|
|
|
get 'move_modal', action: :move_modal
|
2023-04-26 21:51:22 +08:00
|
|
|
get 'actions_toolbar'
|
2021-02-09 22:47:15 +08:00
|
|
|
end
|
2017-01-03 16:49:18 +08:00
|
|
|
member do
|
2022-09-02 19:57:52 +08:00
|
|
|
get 'permissions'
|
2022-09-02 23:49:55 +08:00
|
|
|
get 'actions_dropdown'
|
2023-01-10 18:08:49 +08:00
|
|
|
put :view_type
|
2022-10-20 16:42:38 +08:00
|
|
|
get :table
|
|
|
|
get :load_table
|
2022-11-23 21:42:02 +08:00
|
|
|
get :move_modules_modal
|
|
|
|
post :move_modules
|
2023-01-12 18:31:04 +08:00
|
|
|
get :my_modules
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'canvas' # Overview/structure for single experiment
|
|
|
|
# AJAX-loaded canvas edit mode (from canvas)
|
|
|
|
get 'canvas/edit', to: 'canvas#edit'
|
|
|
|
get 'canvas/full_zoom', to: 'canvas#full_zoom' # AJAX-loaded canvas zoom
|
|
|
|
# AJAX-loaded canvas zoom
|
|
|
|
get 'canvas/medium_zoom', to: 'canvas#medium_zoom'
|
2017-03-10 23:21:43 +08:00
|
|
|
get 'canvas/small_zoom', to: 'canvas#small_zoom' # AJAX-loaded canvas zoom
|
2017-01-03 16:49:18 +08:00
|
|
|
post 'canvas', to: 'canvas#update' # Save updated canvas action
|
|
|
|
get 'module_archive' # Module archive for single experiment
|
2019-01-12 00:20:04 +08:00
|
|
|
get 'my_module_tags', to: 'my_module_tags#canvas_index'
|
2021-01-28 04:53:39 +08:00
|
|
|
post 'archive' # archive experiment
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'clone_modal' # return modal with clone options
|
|
|
|
post 'clone' # clone experiment
|
|
|
|
get 'move_modal' # return modal with move options
|
|
|
|
post 'move' # move experiment
|
|
|
|
get 'fetch_workflow_img' # Get udated workflow img
|
2022-09-29 05:18:36 +08:00
|
|
|
get 'modules/new', to: 'my_modules#new'
|
|
|
|
post 'modules', to: 'my_modules#create'
|
2020-12-29 00:44:47 +08:00
|
|
|
post 'restore_my_modules', to: 'my_modules#restore_group'
|
2021-09-16 15:55:59 +08:00
|
|
|
get 'sidebar'
|
2022-11-09 20:54:19 +08:00
|
|
|
get :assigned_users_to_tasks
|
2022-11-14 18:31:53 +08:00
|
|
|
post :archive_my_modules
|
2022-12-01 22:08:59 +08:00
|
|
|
post :batch_clone_my_modules
|
2022-12-19 18:55:38 +08:00
|
|
|
get :search_tags
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
# Show action is a popup (JSON) for individual module in full-zoom canvas,
|
2017-03-10 23:21:43 +08:00
|
|
|
# as well as 'module info' page for single module (HTML)
|
|
|
|
resources :my_modules, path: '/modules', only: [:show, :update] do
|
2022-12-06 21:51:11 +08:00
|
|
|
post 'save_table_state', on: :collection, defaults: { format: 'json' }
|
2022-12-06 23:58:59 +08:00
|
|
|
|
2023-05-04 17:29:19 +08:00
|
|
|
collection do
|
|
|
|
get 'actions_toolbar'
|
|
|
|
end
|
|
|
|
|
2022-11-07 18:49:25 +08:00
|
|
|
member do
|
|
|
|
get :permissions
|
2022-11-22 22:01:12 +08:00
|
|
|
get :actions_dropdown
|
2022-12-01 22:08:59 +08:00
|
|
|
get :provisioning_status
|
2022-11-07 18:49:25 +08:00
|
|
|
end
|
2019-03-06 16:18:45 +08:00
|
|
|
resources :my_module_tags, path: '/tags', only: [:index, :create, :destroy] do
|
2019-05-13 22:53:58 +08:00
|
|
|
collection do
|
2019-03-06 16:18:45 +08:00
|
|
|
get :search_tags
|
|
|
|
end
|
2019-05-13 22:53:58 +08:00
|
|
|
member do
|
2019-03-06 16:18:45 +08:00
|
|
|
post :destroy_by_tag_id
|
|
|
|
end
|
|
|
|
end
|
2020-04-08 22:24:59 +08:00
|
|
|
resources :user_my_modules, path: '/users', only: %i(index create destroy) do
|
|
|
|
collection do
|
2023-03-21 18:29:23 +08:00
|
|
|
get :designated_users
|
2020-04-08 22:24:59 +08:00
|
|
|
end
|
2021-10-14 17:49:27 +08:00
|
|
|
member do
|
|
|
|
get :search
|
|
|
|
end
|
2020-04-08 22:24:59 +08:00
|
|
|
end
|
2020-07-22 15:45:56 +08:00
|
|
|
|
|
|
|
resource :status_flow, controller: :my_module_status_flow, only: :show
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
resources :my_module_comments,
|
|
|
|
path: '/comments',
|
2021-09-22 17:28:32 +08:00
|
|
|
only: %i(create index update destroy)
|
2020-04-07 01:52:41 +08:00
|
|
|
|
2020-04-29 01:12:17 +08:00
|
|
|
get :repositories_dropdown_list, controller: :my_module_repositories
|
|
|
|
get :repositories_list_html, controller: :my_module_repositories
|
2020-04-21 20:49:36 +08:00
|
|
|
|
2020-04-29 01:12:17 +08:00
|
|
|
resources :repositories, controller: :my_module_repositories, only: :update do
|
2020-04-08 03:02:16 +08:00
|
|
|
member do
|
2020-04-22 23:55:22 +08:00
|
|
|
get :full_view_table
|
|
|
|
post :index_dt
|
2020-07-17 21:17:09 +08:00
|
|
|
post :export_repository
|
2020-04-29 21:13:38 +08:00
|
|
|
get :assign_repository_records_modal, as: :assign_modal
|
|
|
|
get :update_repository_records_modal, as: :update_modal
|
2022-01-28 18:10:56 +08:00
|
|
|
get :consume_modal
|
|
|
|
post :update_consumption
|
2020-04-08 03:02:16 +08:00
|
|
|
end
|
2020-05-13 18:58:31 +08:00
|
|
|
end
|
2020-04-21 20:49:36 +08:00
|
|
|
|
2020-05-13 18:58:31 +08:00
|
|
|
resources :repository_snapshots, controller: :my_module_repository_snapshots, only: %i(destroy show) do
|
|
|
|
member do
|
|
|
|
get :full_view_table
|
|
|
|
post :index_dt
|
2020-08-05 15:59:58 +08:00
|
|
|
post :export_repository_snapshot
|
2020-05-13 18:58:31 +08:00
|
|
|
get :status
|
2020-04-09 21:14:55 +08:00
|
|
|
end
|
2020-04-21 20:49:36 +08:00
|
|
|
|
2020-05-13 18:58:31 +08:00
|
|
|
collection do
|
|
|
|
get ':repository_id/full_view_sidebar',
|
|
|
|
to: 'my_module_repository_snapshots#full_view_sidebar',
|
|
|
|
as: :full_view_sidebar
|
|
|
|
post ':repository_id', to: 'my_module_repository_snapshots#create', as: ''
|
|
|
|
end
|
2020-04-08 03:02:16 +08:00
|
|
|
end
|
2020-04-07 01:52:41 +08:00
|
|
|
|
2020-05-13 18:58:31 +08:00
|
|
|
post :select_default_snapshot, to: 'my_module_repository_snapshots#select'
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
resources :result_texts, only: [:new, :create]
|
|
|
|
resources :result_assets, only: [:new, :create]
|
|
|
|
resources :result_tables, only: [:new, :create]
|
|
|
|
member do
|
|
|
|
# AJAX popup accessed from full-zoom canvas for single module,
|
|
|
|
# as well as full activities view (HTML) for single module
|
|
|
|
get 'description'
|
2022-05-09 17:40:31 +08:00
|
|
|
get 'canvas_dropdown_menu'
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'activities'
|
2019-03-28 17:55:48 +08:00
|
|
|
post 'activities'
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'activities_tab' # Activities in tab view for single module
|
|
|
|
get 'due_date'
|
2020-09-11 22:08:03 +08:00
|
|
|
get 'status_state'
|
2019-03-20 18:41:36 +08:00
|
|
|
patch 'description',
|
|
|
|
to: 'my_modules#update_description',
|
|
|
|
as: 'update_description'
|
2019-03-14 23:08:52 +08:00
|
|
|
patch 'protocol_description',
|
|
|
|
to: 'my_modules#update_protocol_description',
|
|
|
|
as: 'update_protocol_description'
|
2020-07-15 00:48:18 +08:00
|
|
|
patch 'state', to: 'my_modules#update_state', as: 'update_state'
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'protocols' # Protocols view for single module
|
2022-04-21 21:12:34 +08:00
|
|
|
get 'protocol', to: 'my_modules#protocol', as: 'protocol'
|
2022-04-26 20:13:17 +08:00
|
|
|
patch 'protocol', to: 'my_modules#update_protocol', as: 'update_protocol'
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'results' # Results view for single module
|
|
|
|
get 'archive' # Archive view for single module
|
|
|
|
end
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2017-03-10 23:21:43 +08:00
|
|
|
# Those routes are defined outside of member block
|
|
|
|
# to preserve original id parameters in URL.
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'tags/edit', to: 'my_module_tags#index_edit'
|
|
|
|
get 'users/edit', to: 'user_my_modules#index_edit'
|
2016-07-28 17:30:34 +08:00
|
|
|
end
|
|
|
|
|
2022-10-24 19:07:10 +08:00
|
|
|
resources :steps, only: %i(index update destroy show) do
|
2022-05-30 19:45:51 +08:00
|
|
|
resources :step_orderable_elements do
|
|
|
|
post :reorder, on: :collection
|
|
|
|
end
|
2017-01-03 16:49:18 +08:00
|
|
|
resources :step_comments,
|
|
|
|
path: '/comments',
|
2021-09-22 17:28:32 +08:00
|
|
|
only: %i(create index update destroy)
|
2022-08-22 20:02:19 +08:00
|
|
|
resources :tables, controller: 'step_elements/tables', only: %i(create destroy update) do
|
|
|
|
member do
|
|
|
|
post :duplicate
|
|
|
|
end
|
|
|
|
end
|
|
|
|
resources :texts, controller: 'step_elements/texts', only: %i(create destroy update) do
|
|
|
|
member do
|
|
|
|
post :duplicate
|
|
|
|
end
|
|
|
|
end
|
2022-05-30 19:45:51 +08:00
|
|
|
resources :checklists, controller: 'step_elements/checklists', only: %i(create destroy update) do
|
2022-08-22 20:02:19 +08:00
|
|
|
member do
|
|
|
|
post :duplicate
|
|
|
|
end
|
2022-05-30 19:45:51 +08:00
|
|
|
resources :checklist_items, controller: 'step_elements/checklist_items', only: %i(create update destroy) do
|
2022-07-14 21:09:28 +08:00
|
|
|
patch :toggle, on: :member
|
2022-05-26 20:02:02 +08:00
|
|
|
post :reorder, on: :collection
|
|
|
|
end
|
2022-05-11 21:51:26 +08:00
|
|
|
end
|
2017-01-03 16:49:18 +08:00
|
|
|
member do
|
2022-04-29 18:29:42 +08:00
|
|
|
get 'elements'
|
2022-05-12 18:05:41 +08:00
|
|
|
get 'attachments'
|
2022-05-19 14:51:39 +08:00
|
|
|
post 'upload_attachment'
|
2017-01-03 16:49:18 +08:00
|
|
|
post 'toggle_step_state'
|
2019-06-11 16:08:33 +08:00
|
|
|
post 'update_view_state'
|
2020-10-28 18:45:47 +08:00
|
|
|
post 'update_asset_view_mode'
|
2022-08-23 23:54:33 +08:00
|
|
|
post 'duplicate'
|
2017-01-03 16:49:18 +08:00
|
|
|
end
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
2019-02-13 20:06:14 +08:00
|
|
|
# System notifications routes
|
2023-04-24 18:29:45 +08:00
|
|
|
resources :system_notifications, only: %i(show) do
|
2019-02-13 20:06:14 +08:00
|
|
|
collection do
|
|
|
|
post 'mark_as_seen'
|
2019-02-19 18:08:59 +08:00
|
|
|
get 'unseen_counter'
|
2019-02-13 20:06:14 +08:00
|
|
|
end
|
2019-02-15 20:07:29 +08:00
|
|
|
member do
|
|
|
|
post 'mark_as_read'
|
|
|
|
end
|
2019-02-13 20:06:14 +08:00
|
|
|
end
|
|
|
|
|
2017-04-19 15:11:52 +08:00
|
|
|
# tinyMCE image uploader endpoint
|
2019-07-16 19:40:54 +08:00
|
|
|
resources :tiny_mce_assets, only: [:create] do
|
|
|
|
member do
|
|
|
|
get :download
|
2019-07-16 21:51:44 +08:00
|
|
|
get :marvinjs, to: 'tiny_mce_assets#marvinjs_show'
|
|
|
|
put :marvinjs, to: 'tiny_mce_assets#marvinjs_update'
|
|
|
|
end
|
|
|
|
collection do
|
|
|
|
post :marvinjs, to: 'tiny_mce_assets#marvinjs_create'
|
2019-07-16 19:40:54 +08:00
|
|
|
end
|
|
|
|
end
|
2017-04-19 15:11:52 +08:00
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
resources :results, only: [:update, :destroy] do
|
|
|
|
resources :result_comments,
|
|
|
|
path: '/comments',
|
2021-09-22 17:28:32 +08:00
|
|
|
only: %i(create index update destroy)
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
resources :result_texts, only: [:edit, :update, :destroy]
|
|
|
|
get 'result_texts/:id/download' => 'result_texts#download',
|
2017-03-10 23:21:43 +08:00
|
|
|
as: :result_text_download
|
2017-01-03 16:49:18 +08:00
|
|
|
resources :result_assets, only: [:edit, :update, :destroy]
|
|
|
|
resources :result_tables, only: [:edit, :update, :destroy]
|
|
|
|
get 'result_tables/:id/download' => 'result_tables#download',
|
2017-03-10 23:21:43 +08:00
|
|
|
as: :result_table_download
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2022-06-06 19:56:22 +08:00
|
|
|
resources :protocols, only: %i(index show edit create update) do
|
2022-10-24 19:07:10 +08:00
|
|
|
resources :steps, only: [:create] do
|
2022-05-30 19:45:51 +08:00
|
|
|
post :reorder, on: :collection
|
|
|
|
end
|
2017-01-03 16:49:18 +08:00
|
|
|
member do
|
2023-02-13 16:50:39 +08:00
|
|
|
post :publish
|
|
|
|
post :destroy_draft
|
2023-02-22 21:59:48 +08:00
|
|
|
post :save_as_draft
|
2023-04-11 18:50:14 +08:00
|
|
|
get 'version_comment', to: 'protocols#version_comment'
|
2021-12-01 18:16:45 +08:00
|
|
|
get 'print', to: 'protocols#print'
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'linked_children', to: 'protocols#linked_children'
|
|
|
|
post 'linked_children_datatable',
|
|
|
|
to: 'protocols#linked_children_datatable'
|
2022-12-09 19:44:41 +08:00
|
|
|
get 'versions_modal', to: 'protocols#versions_modal'
|
2019-04-24 19:34:56 +08:00
|
|
|
patch 'description', to: 'protocols#update_description'
|
2023-01-05 18:42:59 +08:00
|
|
|
put 'name', to: 'protocols#update_name'
|
2022-06-06 19:56:22 +08:00
|
|
|
patch 'authors', to: 'protocols#update_authors'
|
2017-01-03 16:49:18 +08:00
|
|
|
patch 'keywords', to: 'protocols#update_keywords'
|
|
|
|
get 'unlink_modal', to: 'protocols#unlink_modal'
|
|
|
|
post 'unlink', to: 'protocols#unlink'
|
|
|
|
get 'revert_modal', to: 'protocols#revert_modal'
|
|
|
|
post 'revert', to: 'protocols#revert'
|
|
|
|
get 'update_parent_modal', to: 'protocols#update_parent_modal'
|
|
|
|
post 'update_parent', to: 'protocols#update_parent'
|
|
|
|
get 'update_from_parent_modal', to: 'protocols#update_from_parent_modal'
|
|
|
|
post 'update_from_parent', to: 'protocols#update_from_parent'
|
|
|
|
post 'load_from_repository_datatable',
|
|
|
|
to: 'protocols#load_from_repository_datatable'
|
|
|
|
get 'load_from_repository_modal',
|
|
|
|
to: 'protocols#load_from_repository_modal'
|
|
|
|
post 'load_from_repository', to: 'protocols#load_from_repository'
|
|
|
|
post 'load_from_file', to: 'protocols#load_from_file'
|
2017-09-15 21:52:55 +08:00
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'copy_to_repository_modal', to: 'protocols#copy_to_repository_modal'
|
|
|
|
post 'copy_to_repository', to: 'protocols#copy_to_repository'
|
|
|
|
get 'protocol_status_bar', to: 'protocols#protocol_status_bar'
|
|
|
|
get 'updated_at_label', to: 'protocols#updated_at_label'
|
2022-06-24 17:21:47 +08:00
|
|
|
post 'delete_steps'
|
2022-12-06 22:54:50 +08:00
|
|
|
get :permissions
|
2023-01-26 19:39:11 +08:00
|
|
|
put :update_version_comment
|
2017-01-03 16:49:18 +08:00
|
|
|
end
|
|
|
|
collection do
|
|
|
|
post 'datatable', to: 'protocols#datatable'
|
|
|
|
post 'archive', to: 'protocols#archive'
|
|
|
|
post 'restore', to: 'protocols#restore'
|
2023-02-28 20:11:49 +08:00
|
|
|
post 'clone', to: 'protocols#clone'
|
2017-01-03 16:49:18 +08:00
|
|
|
post 'import', to: 'protocols#import'
|
2018-03-16 17:53:05 +08:00
|
|
|
post 'protocolsio_import_create',
|
|
|
|
to: 'protocols#protocolsio_import_create'
|
2017-09-15 21:52:55 +08:00
|
|
|
post 'protocolsio_import_save', to: 'protocols#protocolsio_import_save'
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'export', to: 'protocols#export'
|
2022-12-19 20:18:24 +08:00
|
|
|
get 'protocolsio', to: 'protocols#protocolsio_index'
|
2017-01-03 16:49:18 +08:00
|
|
|
end
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
2020-11-21 03:25:28 +08:00
|
|
|
resources :comments, only: %i(index create update destroy)
|
2020-11-20 19:29:40 +08:00
|
|
|
|
2022-09-29 20:43:06 +08:00
|
|
|
resources :repository_rows, only: %i() do
|
|
|
|
member do
|
|
|
|
get :rows_to_print
|
|
|
|
post :print
|
|
|
|
get :print_zpl
|
|
|
|
post :validate_label_template_columns
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-06-06 23:35:29 +08:00
|
|
|
resources :repositories do
|
|
|
|
post 'repository_index',
|
2018-03-16 17:53:05 +08:00
|
|
|
to: 'repository_rows#index',
|
2017-06-06 23:35:29 +08:00
|
|
|
as: 'table_index',
|
|
|
|
defaults: { format: 'json' }
|
2020-01-14 18:13:19 +08:00
|
|
|
member do
|
2021-12-07 22:28:20 +08:00
|
|
|
get :assigned_my_modules
|
2021-12-15 22:16:12 +08:00
|
|
|
get :repository_users
|
2020-01-14 18:13:19 +08:00
|
|
|
get :load_table
|
|
|
|
end
|
2017-06-06 23:35:29 +08:00
|
|
|
# Save repository table state
|
|
|
|
post 'state_save',
|
|
|
|
to: 'user_repositories#save_table_state',
|
|
|
|
as: 'save_table_state',
|
|
|
|
defaults: { format: 'json' }
|
|
|
|
# Load repository table state
|
|
|
|
post 'state_load',
|
|
|
|
to: 'user_repositories#load_table_state',
|
|
|
|
as: 'load_table_state',
|
|
|
|
defaults: { format: 'json' }
|
|
|
|
# Delete records from repository
|
|
|
|
post 'delete_records',
|
|
|
|
to: 'repository_rows#delete_records',
|
|
|
|
as: 'delete_records',
|
|
|
|
defaults: { format: 'json' }
|
2018-04-11 23:17:19 +08:00
|
|
|
post 'copy_records',
|
|
|
|
to: 'repository_rows#copy_records',
|
|
|
|
defaults: { format: 'json' }
|
2020-06-10 01:18:30 +08:00
|
|
|
post 'archive_records',
|
|
|
|
to: 'repository_rows#archive_records',
|
|
|
|
defaults: { format: 'json' }
|
|
|
|
post 'restore_records',
|
|
|
|
to: 'repository_rows#restore_records',
|
|
|
|
defaults: { format: 'json' }
|
2018-03-22 16:35:36 +08:00
|
|
|
get 'repository_columns/:id/destroy_html',
|
2018-03-23 23:00:33 +08:00
|
|
|
to: 'repository_columns#destroy_html',
|
|
|
|
as: 'columns_destroy_html'
|
2018-06-12 21:28:03 +08:00
|
|
|
get 'available_columns',
|
|
|
|
to: 'repository_columns#available_columns',
|
|
|
|
as: 'available_columns',
|
|
|
|
defaults: { format: 'json' }
|
2020-05-15 23:46:59 +08:00
|
|
|
get :table_toolbar
|
|
|
|
get :status
|
2017-06-06 23:35:29 +08:00
|
|
|
|
2021-11-23 05:48:36 +08:00
|
|
|
resources :repository_columns, only: %i(index new edit destroy) do
|
|
|
|
collection do
|
|
|
|
get :describe_all
|
|
|
|
end
|
|
|
|
end
|
2021-12-02 21:18:13 +08:00
|
|
|
resources :repository_table_filters, only: %i(index show create update destroy)
|
2020-05-18 20:12:06 +08:00
|
|
|
resources :repository_rows, only: %i(create show update) do
|
2020-04-24 21:43:10 +08:00
|
|
|
member do
|
|
|
|
get :assigned_task_list
|
2022-03-09 21:13:48 +08:00
|
|
|
get :active_reminder_repository_cells
|
2020-04-24 21:43:10 +08:00
|
|
|
end
|
2022-01-20 19:44:57 +08:00
|
|
|
member do
|
|
|
|
get 'repository_stock_value/new', to: 'repository_stock_values#new', as: 'new_repository_stock'
|
|
|
|
get 'repository_stock_value/edit', to: 'repository_stock_values#edit', as: 'edit_repository_stock'
|
|
|
|
post 'repository_stock_value', to: 'repository_stock_values#create_or_update', as: 'update_repository_stock'
|
|
|
|
end
|
|
|
|
resources :repository_stock_values, only: %i(new create edit update)
|
2022-03-11 19:38:45 +08:00
|
|
|
resources :repository_cells, only: :hide_reminder do
|
|
|
|
post :hide_reminder, to: 'hidden_repository_cell_reminders#create'
|
|
|
|
end
|
2020-04-24 21:43:10 +08:00
|
|
|
end
|
2020-05-18 20:12:06 +08:00
|
|
|
|
|
|
|
collection do
|
2020-06-04 20:39:56 +08:00
|
|
|
get :sidebar
|
2020-05-18 20:12:06 +08:00
|
|
|
post 'available_rows', to: 'repository_rows#available_rows', defaults: { format: 'json' }
|
|
|
|
end
|
2017-06-06 23:35:29 +08:00
|
|
|
|
2017-06-13 14:10:10 +08:00
|
|
|
member do
|
2018-04-10 19:19:53 +08:00
|
|
|
post 'parse_sheet', defaults: { format: 'json' }
|
2017-06-13 14:10:10 +08:00
|
|
|
post 'import_records'
|
|
|
|
end
|
2019-10-11 01:03:41 +08:00
|
|
|
namespace :repository_columns do
|
2020-02-04 23:05:16 +08:00
|
|
|
resources :text_columns, only: %i(create update)
|
|
|
|
resources :number_columns, only: %i(create update)
|
|
|
|
resources :asset_columns, only: %i(create update)
|
|
|
|
resources :date_columns, only: %i(create update)
|
|
|
|
resources :date_time_columns, only: %i(create update)
|
|
|
|
resources :list_columns, only: %i(create update) do
|
2019-12-10 22:48:53 +08:00
|
|
|
member do
|
|
|
|
get 'items'
|
|
|
|
end
|
|
|
|
end
|
2020-02-04 23:05:16 +08:00
|
|
|
resources :checklist_columns, only: %i(create update) do
|
2019-12-10 22:48:53 +08:00
|
|
|
member do
|
|
|
|
get 'items'
|
|
|
|
end
|
|
|
|
end
|
2022-01-18 20:17:05 +08:00
|
|
|
resources :stock_columns, only: %i(create update) do
|
|
|
|
member do
|
|
|
|
get 'items'
|
|
|
|
end
|
|
|
|
end
|
2020-02-04 23:05:16 +08:00
|
|
|
resources :status_columns, only: %i(create update) do
|
2019-12-23 21:34:11 +08:00
|
|
|
member do
|
|
|
|
get 'items'
|
|
|
|
end
|
|
|
|
end
|
2019-10-11 01:03:41 +08:00
|
|
|
end
|
2017-06-06 23:35:29 +08:00
|
|
|
end
|
|
|
|
|
2023-03-21 23:44:24 +08:00
|
|
|
resources :connected_devices, controller: 'users/connected_devices', only: %i(destroy)
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'search' => 'search#index'
|
|
|
|
get 'search/new' => 'search#new', as: :new_search
|
2016-07-21 19:11:15 +08:00
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
# We cannot use 'resources :assets' because assets is a reserved route
|
|
|
|
# in Rails (assets pipeline) and causes funky behavior
|
2018-03-30 17:50:28 +08:00
|
|
|
get 'files/:id/preview',
|
|
|
|
to: 'assets#file_preview',
|
|
|
|
as: 'asset_file_preview'
|
2020-12-16 19:13:42 +08:00
|
|
|
get 'files/:id/pdf_preview', to: 'assets#pdf_preview', as: 'asset_pdf_preview'
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'files/:id/view', to: 'assets#view', as: 'view_asset'
|
2019-08-09 20:56:00 +08:00
|
|
|
get 'files/:id/file_url', to: 'assets#file_url', as: 'asset_file_url'
|
2020-05-27 22:59:28 +08:00
|
|
|
get 'files/:id/download', to: 'assets#download', as: 'asset_download'
|
2017-01-03 16:49:18 +08:00
|
|
|
get 'files/:id/edit', to: 'assets#edit', as: 'edit_asset'
|
2020-08-28 17:05:52 +08:00
|
|
|
patch 'files/:id/toggle_view_mode', to: 'assets#toggle_view_mode', as: 'toggle_view_mode'
|
2021-03-22 19:55:05 +08:00
|
|
|
get 'files/:id/load_asset', to: 'assets#load_asset', as: 'load_asset'
|
2018-10-19 16:00:58 +08:00
|
|
|
post 'files/:id/update_image', to: 'assets#update_image',
|
|
|
|
as: 'update_asset_image'
|
2020-11-04 20:08:40 +08:00
|
|
|
delete 'files/:id/', to: 'assets#destroy', as: 'asset_destroy'
|
2019-03-16 03:59:15 +08:00
|
|
|
post 'files/create_wopi_file',
|
|
|
|
to: 'assets#create_wopi_file',
|
|
|
|
as: 'create_wopi_file'
|
2019-06-19 21:19:47 +08:00
|
|
|
post 'files/:id/start_edit_image', to: 'assets#create_start_edit_image_activity', as: 'start_edit_image'
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
devise_scope :user do
|
|
|
|
get 'avatar/:id/:style' => 'users/registrations#avatar', as: 'avatar'
|
2018-02-26 18:05:05 +08:00
|
|
|
get 'users/sign_up_provider' => 'users/registrations#new_with_provider'
|
2020-07-13 15:51:04 +08:00
|
|
|
get 'users/two_factor_recovery' => 'users/sessions#two_factor_recovery'
|
2021-05-05 02:51:34 +08:00
|
|
|
get 'users/two_factor_auth' => 'users/sessions#two_factor_auth'
|
2022-08-08 18:24:50 +08:00
|
|
|
get 'users/expire_in' => 'users/sessions#expire_in'
|
|
|
|
post 'users/revive_session' => 'users/sessions#revive_session'
|
2020-06-30 20:16:00 +08:00
|
|
|
post 'users/authenticate_with_two_factor' => 'users/sessions#authenticate_with_two_factor'
|
2020-07-13 15:51:04 +08:00
|
|
|
post 'users/authenticate_with_recovery_code' => 'users/sessions#authenticate_with_recovery_code'
|
2020-06-30 20:16:00 +08:00
|
|
|
post 'users/complete_sign_up_provider' => 'users/registrations#create_with_provider'
|
2020-07-01 17:07:33 +08:00
|
|
|
|
|
|
|
post 'users/2fa_enable' => 'users/registrations#two_factor_enable'
|
|
|
|
post 'users/2fa_disable' => 'users/registrations#two_factor_disable'
|
|
|
|
get 'users/2fa_qr_code' => 'users/registrations#two_factor_qr_code'
|
2017-01-03 16:49:18 +08:00
|
|
|
end
|
2017-08-30 00:49:07 +08:00
|
|
|
|
|
|
|
namespace :api, defaults: { format: 'json' } do
|
2018-01-22 23:52:48 +08:00
|
|
|
get 'health', to: 'api#health'
|
2017-08-30 00:49:07 +08:00
|
|
|
get 'status', to: 'api#status'
|
2021-10-28 00:17:38 +08:00
|
|
|
namespace :service do
|
2022-05-19 15:08:05 +08:00
|
|
|
post 'projects_json_export', to: 'projects_json_export#projects_json_export'
|
2022-07-12 16:13:47 +08:00
|
|
|
resources :teams, only: [] do
|
2021-10-28 00:17:38 +08:00
|
|
|
post 'clone_experiment' => 'experiments#clone'
|
2022-07-12 16:13:47 +08:00
|
|
|
|
|
|
|
resources :protocols, only: [] do
|
|
|
|
post 'reorder_steps' => 'protocols#reorder_steps'
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :steps, only: [] do
|
|
|
|
post 'reorder_elements' => 'steps#reorder_elements'
|
|
|
|
end
|
2021-10-28 00:17:38 +08:00
|
|
|
end
|
|
|
|
end
|
2021-05-30 00:40:26 +08:00
|
|
|
if Rails.configuration.x.core_api_v1_enabled
|
2018-08-24 18:11:28 +08:00
|
|
|
namespace :v1 do
|
|
|
|
resources :teams, only: %i(index show) do
|
2020-09-22 17:56:12 +08:00
|
|
|
resources :inventories, only: %i(index create show update destroy) do
|
2018-08-24 22:41:26 +08:00
|
|
|
resources :inventory_columns,
|
|
|
|
only: %i(index create show update destroy),
|
|
|
|
path: 'columns',
|
2018-10-03 19:22:11 +08:00
|
|
|
as: :columns do
|
|
|
|
resources :inventory_list_items,
|
|
|
|
only: %i(index create show update destroy),
|
|
|
|
path: 'list_items',
|
|
|
|
as: :list_items
|
2020-02-17 07:26:20 +08:00
|
|
|
resources :inventory_checklist_items,
|
|
|
|
only: %i(index create show update destroy),
|
|
|
|
path: 'checklist_items',
|
|
|
|
as: :checklist_items
|
2019-10-21 16:38:20 +08:00
|
|
|
resources :inventory_status_items,
|
|
|
|
only: %i(index create show update destroy),
|
|
|
|
path: 'status_items',
|
|
|
|
as: :status_items
|
2022-04-08 20:09:00 +08:00
|
|
|
resources :inventory_stock_unit_items,
|
|
|
|
only: %i(index create show update destroy),
|
|
|
|
path: 'stock_unit_items',
|
|
|
|
as: :stock_unit_items
|
2018-10-03 19:22:11 +08:00
|
|
|
end
|
2018-08-24 17:26:49 +08:00
|
|
|
resources :inventory_items,
|
|
|
|
only: %i(index create show update destroy),
|
|
|
|
path: 'items',
|
2018-10-05 06:18:42 +08:00
|
|
|
as: :items do
|
|
|
|
resources :inventory_cells,
|
|
|
|
only: %i(index create show update destroy),
|
|
|
|
path: 'cells',
|
|
|
|
as: :cells
|
|
|
|
end
|
2018-08-22 17:38:39 +08:00
|
|
|
end
|
2020-09-16 22:34:35 +08:00
|
|
|
resources :projects, only: %i(index show create update) do
|
2021-05-29 21:28:10 +08:00
|
|
|
resources :user_assignments,
|
|
|
|
only: %i(index show create update destroy),
|
|
|
|
controller: :project_user_assignments,
|
|
|
|
path: 'users',
|
|
|
|
as: :users
|
2020-09-22 17:56:12 +08:00
|
|
|
resources :project_comments, only: %i(index show), path: 'comments', as: :comments
|
2018-10-10 23:35:09 +08:00
|
|
|
get 'activities', to: 'projects#activities'
|
2020-09-22 17:56:12 +08:00
|
|
|
resources :reports, only: %i(index show), path: 'reports', as: :reports
|
2020-09-17 05:15:24 +08:00
|
|
|
resources :experiments, only: %i(index show create update) do
|
2021-05-23 23:31:02 +08:00
|
|
|
resources :user_assignments,
|
2021-06-06 15:54:47 +08:00
|
|
|
only: %i(index show update),
|
2021-05-23 23:31:02 +08:00
|
|
|
controller: :experiment_user_assignments
|
2018-10-07 15:45:24 +08:00
|
|
|
resources :task_groups, only: %i(index show)
|
2021-11-17 19:11:22 +08:00
|
|
|
resources :connections, only: %i(index show create destroy)
|
2020-07-02 23:03:29 +08:00
|
|
|
resources :tasks, only: %i(index show create update) do
|
2021-05-23 23:31:02 +08:00
|
|
|
resources :user_assignments,
|
2021-06-06 15:54:47 +08:00
|
|
|
only: %i(index show update),
|
2021-05-23 23:31:02 +08:00
|
|
|
controller: :task_user_assignments
|
2022-03-30 20:33:26 +08:00
|
|
|
resources :task_inventory_items, only: %i(index show update),
|
2018-10-07 16:07:37 +08:00
|
|
|
path: 'items',
|
|
|
|
as: :items
|
2018-11-28 21:14:45 +08:00
|
|
|
resources :task_users, only: %i(index show),
|
2018-10-07 16:20:01 +08:00
|
|
|
path: 'users',
|
|
|
|
as: :users
|
2018-10-07 17:10:41 +08:00
|
|
|
resources :task_tags, only: %i(index show),
|
|
|
|
path: 'tags',
|
|
|
|
as: :tags
|
2022-06-03 16:09:42 +08:00
|
|
|
resources :task_assignments, only: %i(index create destroy),
|
|
|
|
path: 'task_assignments',
|
|
|
|
as: :task_assignments
|
2020-08-07 22:51:57 +08:00
|
|
|
resources :protocols, only: %i(index show) do
|
2020-09-22 17:56:12 +08:00
|
|
|
resources :steps, only: %i(index show create update destroy) do
|
2019-09-19 22:12:15 +08:00
|
|
|
resources :assets, only: %i(index show create), path: 'attachments'
|
2020-09-22 17:56:12 +08:00
|
|
|
resources :checklists, only: %i(index show create update destroy), path: 'checklists' do
|
|
|
|
resources :checklist_items,
|
|
|
|
only: %i(index show create update destroy),
|
|
|
|
as: :items,
|
|
|
|
path: 'items'
|
2020-07-02 23:03:29 +08:00
|
|
|
end
|
2020-09-22 17:56:12 +08:00
|
|
|
resources :tables, only: %i(index show create update destroy), path: 'tables'
|
2022-06-27 18:30:45 +08:00
|
|
|
resources :step_texts, only: %i(index show create update destroy), path: 'step_texts'
|
2019-09-19 22:12:15 +08:00
|
|
|
end
|
2019-09-17 19:02:38 +08:00
|
|
|
end
|
2019-09-24 18:41:45 +08:00
|
|
|
resources :results, only: %i(index create show update)
|
2018-10-07 17:49:11 +08:00
|
|
|
get 'activities', to: 'tasks#activities'
|
2018-09-07 19:36:55 +08:00
|
|
|
end
|
2018-09-06 21:38:48 +08:00
|
|
|
end
|
2018-09-05 15:55:04 +08:00
|
|
|
end
|
2020-11-23 14:09:10 +08:00
|
|
|
resources :project_folders, only: %i(index show create update)
|
2022-12-02 21:54:05 +08:00
|
|
|
resources :users, only: %i(index)
|
2018-09-07 18:54:09 +08:00
|
|
|
end
|
|
|
|
resources :users, only: %i(show) do
|
|
|
|
resources :user_identities,
|
2018-10-07 19:07:27 +08:00
|
|
|
only: %i(index create show update destroy),
|
|
|
|
path: 'identities',
|
|
|
|
as: :identities
|
2018-08-24 18:11:28 +08:00
|
|
|
end
|
2020-08-20 21:49:48 +08:00
|
|
|
|
2021-05-29 21:28:10 +08:00
|
|
|
resources :user_roles, only: :index
|
2020-08-20 21:49:48 +08:00
|
|
|
resources :workflows, only: %i(index show) do
|
|
|
|
resources :workflow_statuses, path: :statuses, only: %i(index)
|
|
|
|
end
|
2018-07-31 19:40:27 +08:00
|
|
|
end
|
|
|
|
end
|
2017-08-30 00:49:07 +08:00
|
|
|
end
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
2016-08-03 21:31:25 +08:00
|
|
|
|
2019-03-06 17:34:04 +08:00
|
|
|
resources :global_activities, only: [:index] do
|
2019-04-09 15:08:27 +08:00
|
|
|
collection do
|
2019-08-08 21:51:08 +08:00
|
|
|
get :project_filter
|
|
|
|
get :experiment_filter
|
|
|
|
get :my_module_filter
|
|
|
|
get :inventory_filter
|
|
|
|
get :inventory_item_filter
|
|
|
|
get :report_filter
|
|
|
|
get :protocol_filter
|
2019-04-09 15:08:27 +08:00
|
|
|
get :team_filter
|
|
|
|
get :user_filter
|
2021-05-31 19:32:31 +08:00
|
|
|
post :save_activity_filter
|
2019-04-09 15:08:27 +08:00
|
|
|
end
|
2019-02-26 18:01:15 +08:00
|
|
|
end
|
2019-02-14 20:20:32 +08:00
|
|
|
|
2019-04-30 23:32:55 +08:00
|
|
|
resources :marvin_js_assets, only: %i(create update destroy show) do
|
|
|
|
collection do
|
|
|
|
get :team_sketches
|
|
|
|
end
|
2019-08-09 15:47:07 +08:00
|
|
|
member do
|
|
|
|
post :start_editing
|
|
|
|
end
|
2019-04-30 23:32:55 +08:00
|
|
|
end
|
2019-04-27 04:59:38 +08:00
|
|
|
|
2021-06-24 01:48:44 +08:00
|
|
|
resources :bio_eddie_assets, only: %i(create update) do
|
2021-07-01 18:03:25 +08:00
|
|
|
collection do
|
|
|
|
get :license
|
|
|
|
end
|
2021-06-24 01:48:44 +08:00
|
|
|
member do
|
|
|
|
post :start_editing
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-08-26 20:50:54 +08:00
|
|
|
resources :bmt_filters, only: %i(index create destroy)
|
|
|
|
|
2021-08-17 00:29:55 +08:00
|
|
|
match '/marvin4js-license.cxl', to: 'bio_eddie_assets#license', via: :get
|
|
|
|
|
2021-06-30 23:04:19 +08:00
|
|
|
match 'biomolecule_toolkit/*path', to: 'bio_eddie_assets#bmt_request',
|
|
|
|
via: %i(get post put delete),
|
2021-08-27 22:02:11 +08:00
|
|
|
defaults: { format: 'json' },
|
|
|
|
as: 'bmt_request'
|
2021-06-30 23:04:19 +08:00
|
|
|
|
2019-03-08 17:29:51 +08:00
|
|
|
post 'global_activities', to: 'global_activities#index'
|
|
|
|
|
2017-01-03 16:49:18 +08:00
|
|
|
constraints WopiSubdomain do
|
|
|
|
# Office integration
|
|
|
|
get 'wopi/files/:id/contents', to: 'wopi#file_contents_get_endpoint'
|
|
|
|
post 'wopi/files/:id/contents', to: 'wopi#file_contents_post_endpoint'
|
|
|
|
get 'wopi/files/:id', to: 'wopi#file_get_endpoint', as: 'wopi_rest_endpoint'
|
|
|
|
post 'wopi/files/:id', to: 'wopi#post_file_endpoint'
|
|
|
|
end
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|