iqvoc 4.13.2 → 4.14.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -8
  3. data/Gemfile.lock +381 -331
  4. data/app/aides/inline_data_helper.rb +3 -3
  5. data/app/aides/skos_exporter.rb +1 -1
  6. data/app/assets/javascripts/iqvoc/iqvoc.js +0 -20
  7. data/app/assets/stylesheets/iqvoc/_manifest.scss +1 -0
  8. data/app/assets/stylesheets/iqvoc/_search_results.scss +14 -0
  9. data/app/controllers/collections/versions_controller.rb +12 -47
  10. data/app/controllers/collections_controller.rb +15 -8
  11. data/app/controllers/concepts/alphabetical_controller.rb +1 -1
  12. data/app/controllers/concepts/hierarchical_controller.rb +9 -13
  13. data/app/controllers/concepts/versions_controller.rb +13 -48
  14. data/app/controllers/concepts_controller.rb +19 -15
  15. data/app/controllers/concepts_movement_controller.rb +1 -1
  16. data/app/controllers/dashboard_controller.rb +5 -5
  17. data/app/controllers/imports_controller.rb +9 -6
  18. data/app/controllers/reverse_matches_controller.rb +2 -4
  19. data/app/controllers/search_results_controller.rb +13 -19
  20. data/app/helpers/application_helper.rb +0 -8
  21. data/app/helpers/link_helper.rb +13 -9
  22. data/app/helpers/rdf_helper.rb +9 -5
  23. data/app/jobs/reverse_match_job.rb +8 -4
  24. data/app/models/ability.rb +7 -7
  25. data/app/models/collection/base.rb +17 -8
  26. data/app/models/concept/base.rb +17 -7
  27. data/app/models/concept/relation/base.rb +1 -1
  28. data/app/models/concept/relation/reverse_relation_extension.rb +9 -5
  29. data/app/models/concerns/search_extension.rb +0 -17
  30. data/app/models/concerns/versioning.rb +1 -31
  31. data/app/models/dataset/adaptors/iqvoc/alphabetical_search_adaptor.rb +2 -2
  32. data/app/models/dataset/adaptors/iqvoc/http_adaptor.rb +2 -2
  33. data/app/models/dataset/adaptors/iqvoc/search_adaptor.rb +2 -2
  34. data/app/models/export.rb +1 -1
  35. data/app/models/label/base.rb +5 -5
  36. data/app/models/note/base.rb +1 -1
  37. data/app/models/user.rb +2 -0
  38. data/app/uploaders/rdf_uploader.rb +1 -1
  39. data/app/views/collections/_data.html.erb +2 -2
  40. data/app/views/collections/show_unpublished.html.erb +3 -11
  41. data/app/views/concepts/notifications/_referenced_concepts.html.erb +0 -1
  42. data/app/views/concepts/show_published.html.erb +2 -0
  43. data/app/views/concepts/show_unpublished.html.erb +5 -11
  44. data/app/views/dashboard/_table.html.erb +0 -8
  45. data/app/views/pages/version.html.erb +1 -1
  46. data/app/views/partials/concept/_edit_link_base.html.erb +2 -2
  47. data/app/views/partials/concept/relation/_edit_base.html.erb +13 -10
  48. data/app/views/search_results/_detailed_search.html.erb +27 -0
  49. data/app/views/search_results/_form.html.erb +21 -9
  50. data/app/views/search_results/index.html.erb +4 -4
  51. data/app/views/search_results/sections/_change_note.html.erb +28 -25
  52. data/app/views/search_results/sections/_collection.html.erb +5 -5
  53. data/app/views/search_results/sections/_datasets.html.erb +8 -20
  54. data/app/views/search_results/sections/_klass.html.erb +7 -9
  55. data/app/views/search_results/sections/_languages.html.erb +4 -14
  56. data/app/views/search_results/sections/_mode.html.erb +8 -10
  57. data/app/views/search_results/sections/_options.html.erb +6 -8
  58. data/app/views/search_results/sections/_terms.html.erb +13 -10
  59. data/app/views/search_results/sections/_type.html.erb +13 -13
  60. data/config/application.rb +1 -1
  61. data/config/boot.rb +1 -1
  62. data/config/database.yml +21 -15
  63. data/config/database.yml.postgresql +1 -1
  64. data/config/engine.rb +1 -0
  65. data/config/initializers/active_record.rb +2 -0
  66. data/config/initializers/content_security_policy.rb +21 -26
  67. data/config/initializers/filter_parameter_logging.rb +4 -2
  68. data/config/initializers/inflections.rb +4 -4
  69. data/config/initializers/iqvoc.rb +1 -0
  70. data/config/locales/de.yml +13 -18
  71. data/config/locales/en.yml +13 -18
  72. data/config/locales/pt.yml +0 -7
  73. data/config/routes.rb +0 -4
  74. data/db/migrate/20231012135837_remove_locked_by.rb +6 -0
  75. data/db/schema.rb +31 -34
  76. data/iqvoc.gemspec +7 -5
  77. data/lib/iqvoc/configuration/concept.rb +2 -0
  78. data/lib/iqvoc/configuration/core.rb +4 -0
  79. data/lib/iqvoc/configuration/instance_configuration.rb +2 -2
  80. data/lib/iqvoc/environments/development.rb +5 -2
  81. data/lib/iqvoc/environments/production.rb +7 -28
  82. data/lib/iqvoc/environments/test.rb +1 -1
  83. data/lib/iqvoc/version.rb +1 -1
  84. data/test/controllers/concepts_movement_controller_test.rb +0 -2
  85. data/test/controllers/reverse_match_test.rb +1 -1
  86. data/test/integration/collection_browsing_test.rb +45 -0
  87. data/test/integration/collection_circularity_test.rb +3 -3
  88. data/test/integration/concept_collection_assignment_test.rb +1 -1
  89. data/test/integration/create_concept_test.rb +15 -0
  90. data/test/integration/reverse_match_job_test.rb +39 -7
  91. data/test/integration/search_test.rb +9 -9
  92. data/test/integration/version_page_test.rb +26 -0
  93. data/test/models/concept_test.rb +37 -0
  94. data/test/models/deep_cloning_test.rb +9 -7
  95. data/test/test_helper.rb +3 -0
  96. metadata +81 -67
  97. data/app/views/search_results/sections/_note.html.erb +0 -6
  98. data/bin/bundle +0 -3
  99. data/bin/delayed_job +0 -5
  100. data/bin/rails +0 -4
  101. data/bin/rake +0 -4
  102. data/bin/setup +0 -36
  103. data/bin/update +0 -31
  104. data/bin/yarn +0 -17
@@ -75,7 +75,6 @@ en:
75
75
  of: of
76
76
  ops: Oops!
77
77
  pending: "Loading…"
78
- translation_missing_for: "translation missing for"
79
78
  type_to_search: "Type to search"
80
79
  hint_csv_input: "Multiple values can be entered comma-separated."
81
80
  form_errors: "Errors"
@@ -219,10 +218,10 @@ en:
219
218
  search_results:
220
219
  header: "Search"
221
220
  inflectionals: "inflectionals"
222
- contains: "contains"
223
- ends_with: "ends with"
224
- begins_with: "begins with"
225
- exact: "exact match"
221
+ contains: "contain keyword"
222
+ ends_with: "end with keyword"
223
+ begins_with: "start with keyword"
224
+ exact: "exactly match"
226
225
  regexp: "regular expression (advanced)"
227
226
  search_term: "Search term(s)"
228
227
  note: with note
@@ -236,23 +235,25 @@ en:
236
235
  other: "Your search for <strong>%{query}</strong> yielded the following %{count} results."
237
236
  no_results_found: "Your search yielded no results."
238
237
  submit: "Search"
238
+ detailed_search: "Detailed search"
239
239
  type: "type"
240
240
  used_as: "used as"
241
241
  expired: "include expired?"
242
- language: "language"
242
+ language: "Language"
243
243
  all: "all"
244
244
  none: "none"
245
- in: "In"
246
- for: "For"
247
- mode: "Mode"
245
+ in: "Search contains"
246
+ for: "Search in"
247
+ mode: "Search results"
248
248
  datasets: "External sources"
249
249
  change_note:
250
+ all: "Creation or update date"
250
251
  type: "type"
251
252
  created: "creation date"
252
253
  modified: "modification date"
253
254
  date: "Date range"
254
- date_from: '(from)'
255
- date_to: '(to)'
255
+ date_from: 'From'
256
+ date_to: 'To'
256
257
  user_sessions:
257
258
  header: "Login"
258
259
  login: "Login"
@@ -301,7 +302,6 @@ en:
301
302
  delete_copy: "Delete copy"
302
303
  delete_confirm: "Do you really want to delete this copy?"
303
304
  versioning_mode: "Create new version"
304
- unlock: "Unlock"
305
305
  preview_new_version: "Preview of the version in editing"
306
306
  consistency_check: "Check consistency"
307
307
  current_revision: "Current revision %{rev}"
@@ -318,7 +318,6 @@ en:
318
318
  dashboard:
319
319
  type: "Type"
320
320
  value: "Name"
321
- locking_user: "Locked by"
322
321
  follow_up: "Follow up"
323
322
  updated_at: "Updated at"
324
323
  to_review: "Submission for review"
@@ -388,11 +387,7 @@ en:
388
387
  published_with_warning: "Instance has been successfully published, but it has no relations!"
389
388
  merged_delete_error: "Label could not be deleted."
390
389
  merged_publishing_error: "Instance could not be published - please consult the consistency check."
391
- branched: "Instance copy has been created and locked."
392
- locked: "Instance has been locked."
393
- lock_error: "Instance is already locked."
394
- unlocked: "Instance has been unlocked."
395
- unlock_error: "Instance has been alraedy unlocked."
390
+ branched: "Instance copy has been created."
396
391
  to_review_success: "Sent to review."
397
392
  to_review_error: "Can't send to review."
398
393
  new_version_blank_error: "A new version does not yet exist!"
@@ -70,7 +70,6 @@ pt:
70
70
  checked_out: "Verificado"
71
71
  of: de
72
72
  pending: "Carregando…"
73
- translation_missing_for: "tradução faltando para"
74
73
  type_to_search: "Digite para buscar"
75
74
  hint_csv_input: " Vários valores podem ser inseridos separados por vírgula."
76
75
  form_errors: "Erros"
@@ -234,7 +233,6 @@ pt:
234
233
  delete: "Excluir cópia"
235
234
  delete_confirm: "Você realmente deseja excluir esta cópia?"
236
235
  versioning_mode: "Criar nova versão"
237
- unlock: "Destravar"
238
236
  preview_new_version: "Pré-visualização da versão em alteração"
239
237
  consistency_check: "Verificar consistência"
240
238
  current_revision: "Revisão atual %{rev}"
@@ -250,7 +248,6 @@ pt:
250
248
  dashboard:
251
249
  type: "Tipo"
252
250
  value: "Nome"
253
- locking_user: "Travado por"
254
251
  follow_up: "Reapresentar"
255
252
  updated_at: "Atualizado em"
256
253
  to_review: "Submissão para revisão"
@@ -301,10 +298,6 @@ pt:
301
298
  merged_delete_error: "Não foi possível excluir o rótulo!"
302
299
  merged_publishing_error: "Não foi possível lançar a instância!"
303
300
  branched: "Cópia da instância foi criada e travada."
304
- locked: "Instância foi travada."
305
- lock_error: "Instância já foi travada!"
306
- unlocked: "Instância foi destravada."
307
- unlock_error: "Instância já foi destravada!"
308
301
  to_review_success: "Enviado para revisão com sucesso."
309
302
  to_review_error: "Não foi possível enviar para revisão."
310
303
  new_version_blank_error: "Ainda não existe uma nova versão!"
data/config/routes.rb CHANGED
@@ -51,8 +51,6 @@ Rails.application.routes.draw do
51
51
 
52
52
  post 'concepts/:origin/branch' => 'concepts/versions#branch', as: 'concept_versions_branch'
53
53
  post 'concepts/:origin/merge' => 'concepts/versions#merge', as: 'concept_versions_merge'
54
- post 'concepts/:origin/lock' => 'concepts/versions#lock', as: 'concept_versions_lock'
55
- post 'concepts/:origin/unlock' => 'concepts/versions#unlock', as: 'concept_versions_unlock'
56
54
  post 'concepts/:origin/to_review' => 'concepts/versions#to_review', as: 'concept_versions_to_review'
57
55
  get 'concepts/:origin/consistency_check' => 'concepts/versions#consistency_check', as: 'concept_versions_consistency_check'
58
56
 
@@ -60,8 +58,6 @@ Rails.application.routes.draw do
60
58
 
61
59
  post 'collections/:origin/branch' => 'collections/versions#branch', as: 'collection_versions_branch'
62
60
  post 'collections/:origin/merge' => 'collections/versions#merge', as: 'collection_versions_merge'
63
- post 'collections/:origin/lock' => 'collections/versions#lock', as: 'collection_versions_lock'
64
- post 'collections/:origin/unlock' => 'collections/versions#unlock', as: 'collection_versions_unlock'
65
61
  post 'collections/:origin/to_review' => 'collections/versions#to_review', as: 'collection_versions_to_review'
66
62
  get 'collections/:origin/consistency_check' => 'collections/versions#consistency_check', as: 'collection_versions_consistency_check'
67
63
 
@@ -0,0 +1,6 @@
1
+ class RemoveLockedBy < ActiveRecord::Migration[7.0]
2
+
3
+ def change
4
+ remove_column :concepts, :locked_by
5
+ end
6
+ end
data/db/schema.rb CHANGED
@@ -10,8 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2022_01_07_114201) do
14
-
13
+ ActiveRecord::Schema[7.0].define(version: 2023_10_12_135837) do
15
14
  # These are extensions that must be enabled in order to support this database
16
15
  enable_extension "plpgsql"
17
16
 
@@ -27,8 +26,8 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
27
26
  t.string "type"
28
27
  t.integer "owner_id"
29
28
  t.integer "target_id"
30
- t.datetime "created_at"
31
- t.datetime "updated_at"
29
+ t.datetime "created_at", precision: nil
30
+ t.datetime "updated_at", precision: nil
32
31
  t.integer "rank", default: 100
33
32
  t.index ["owner_id", "target_id"], name: "ix_concept_relations_fk"
34
33
  end
@@ -39,13 +38,12 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
39
38
  t.integer "rev", default: 1
40
39
  t.date "published_at"
41
40
  t.integer "published_version_id"
42
- t.integer "locked_by"
43
41
  t.date "expired_at"
44
42
  t.date "follow_up"
45
43
  t.boolean "to_review"
46
44
  t.date "rdf_updated_at"
47
- t.datetime "created_at"
48
- t.datetime "updated_at"
45
+ t.datetime "created_at", precision: nil
46
+ t.datetime "updated_at", precision: nil
49
47
  t.boolean "top_term", default: false
50
48
  t.index ["origin"], name: "ix_concepts_on_origin"
51
49
  t.index ["published_version_id"], name: "ix_concepts_publ_version_id"
@@ -61,13 +59,13 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
61
59
  t.integer "attempts", default: 0, null: false
62
60
  t.text "handler", null: false
63
61
  t.text "last_error"
64
- t.datetime "run_at"
65
- t.datetime "locked_at"
66
- t.datetime "failed_at"
62
+ t.datetime "run_at", precision: nil
63
+ t.datetime "locked_at", precision: nil
64
+ t.datetime "failed_at", precision: nil
67
65
  t.string "locked_by"
68
66
  t.string "queue"
69
- t.datetime "created_at"
70
- t.datetime "updated_at"
67
+ t.datetime "created_at", precision: nil
68
+ t.datetime "updated_at", precision: nil
71
69
  t.string "error_message"
72
70
  t.string "delayed_reference_type"
73
71
  t.integer "delayed_reference_id"
@@ -85,9 +83,9 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
85
83
  t.boolean "success", default: false
86
84
  t.integer "file_type"
87
85
  t.string "token"
88
- t.datetime "created_at"
89
- t.datetime "updated_at"
90
- t.datetime "finished_at"
86
+ t.datetime "created_at", precision: nil
87
+ t.datetime "updated_at", precision: nil
88
+ t.datetime "finished_at", precision: nil
91
89
  t.string "default_namespace"
92
90
  t.index ["user_id"], name: "index_exports_on_user_id"
93
91
  end
@@ -96,9 +94,9 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
96
94
  t.integer "user_id"
97
95
  t.text "output"
98
96
  t.boolean "success", default: false
99
- t.datetime "created_at"
100
- t.datetime "updated_at"
101
- t.datetime "finished_at"
97
+ t.datetime "created_at", precision: nil
98
+ t.datetime "updated_at", precision: nil
99
+ t.datetime "finished_at", precision: nil
102
100
  t.string "import_file"
103
101
  t.boolean "publish"
104
102
  t.string "default_namespace"
@@ -109,8 +107,8 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
109
107
  t.string "type"
110
108
  t.integer "owner_id"
111
109
  t.integer "target_id"
112
- t.datetime "created_at"
113
- t.datetime "updated_at"
110
+ t.datetime "created_at", precision: nil
111
+ t.datetime "updated_at", precision: nil
114
112
  t.index ["owner_id", "target_id", "type"], name: "ix_labelings_fk_type"
115
113
  t.index ["type"], name: "ix_labelings_on_type"
116
114
  end
@@ -120,8 +118,8 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
120
118
  t.string "origin", limit: 4000
121
119
  t.string "language"
122
120
  t.string "value", limit: 1024
123
- t.datetime "created_at"
124
- t.datetime "updated_at"
121
+ t.datetime "created_at", precision: nil
122
+ t.datetime "updated_at", precision: nil
125
123
  t.date "published_at"
126
124
  t.index ["language"], name: "ix_labels_on_language"
127
125
  t.index ["origin"], name: "ix_labels_on_origin"
@@ -131,8 +129,8 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
131
129
  t.integer "concept_id"
132
130
  t.string "type"
133
131
  t.string "value"
134
- t.datetime "created_at"
135
- t.datetime "updated_at"
132
+ t.datetime "created_at", precision: nil
133
+ t.datetime "updated_at", precision: nil
136
134
  t.index ["concept_id", "type"], name: "ix_matches_fk_type"
137
135
  t.index ["type"], name: "ix_matches_on_type"
138
136
  end
@@ -148,8 +146,8 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
148
146
  t.integer "note_id"
149
147
  t.string "predicate", limit: 50
150
148
  t.string "value", limit: 1024
151
- t.datetime "created_at"
152
- t.datetime "updated_at"
149
+ t.datetime "created_at", precision: nil
150
+ t.datetime "updated_at", precision: nil
153
151
  t.string "namespace", limit: 50
154
152
  t.string "language"
155
153
  t.index ["note_id"], name: "ix_note_annotations_fk"
@@ -160,8 +158,8 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
160
158
  t.string "language", limit: 2
161
159
  t.string "value", limit: 4000
162
160
  t.string "type", limit: 50
163
- t.datetime "created_at"
164
- t.datetime "updated_at"
161
+ t.datetime "created_at", precision: nil
162
+ t.datetime "updated_at", precision: nil
165
163
  t.integer "owner_id"
166
164
  t.string "owner_type", null: false
167
165
  t.integer "position"
@@ -176,8 +174,8 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
176
174
  t.string "email"
177
175
  t.string "crypted_password"
178
176
  t.boolean "active"
179
- t.datetime "created_at"
180
- t.datetime "updated_at"
177
+ t.datetime "created_at", precision: nil
178
+ t.datetime "updated_at", precision: nil
181
179
  t.string "password_salt"
182
180
  t.string "persistence_token"
183
181
  t.string "perishable_token"
@@ -187,9 +185,9 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
187
185
  t.text "comment"
188
186
  t.integer "login_count", default: 0, null: false
189
187
  t.integer "failed_login_count", default: 0, null: false
190
- t.datetime "last_request_at"
191
- t.datetime "current_login_at"
192
- t.datetime "last_login_at"
188
+ t.datetime "last_request_at", precision: nil
189
+ t.datetime "current_login_at", precision: nil
190
+ t.datetime "last_login_at", precision: nil
193
191
  t.string "current_login_ip"
194
192
  t.string "last_login_ip"
195
193
  end
@@ -198,7 +196,6 @@ ActiveRecord::Schema.define(version: 2022_01_07_114201) do
198
196
  add_foreign_key "collection_members", "concepts", column: "target_id", on_update: :cascade
199
197
  add_foreign_key "concept_relations", "concepts", column: "owner_id", on_update: :cascade
200
198
  add_foreign_key "concept_relations", "concepts", column: "target_id", on_update: :cascade
201
- add_foreign_key "concepts", "users", column: "locked_by", on_update: :cascade, on_delete: :nullify
202
199
  add_foreign_key "exports", "users", on_update: :cascade, on_delete: :nullify
203
200
  add_foreign_key "imports", "users", on_update: :cascade, on_delete: :nullify
204
201
  add_foreign_key "labelings", "concepts", column: "owner_id", on_update: :cascade
data/iqvoc.gemspec CHANGED
@@ -13,9 +13,9 @@ Gem::Specification.new do |s|
13
13
  s.description = 'iQvoc - a SKOS(-XL) vocabulary management system built on the Semantic Web'
14
14
  s.license = 'Apache-2.0'
15
15
 
16
- s.add_dependency 'rails', '~> 6.1.5', '>= 6.1.5.1'
17
- s.add_dependency 'puma', '< 6.0'
18
- s.add_dependency 'bootsnap', '>= 1.4.4'
16
+ s.add_dependency 'rails', '~> 7.0.8'
17
+ s.add_dependency 'puma'
18
+ s.add_dependency 'bootsnap'
19
19
  s.add_dependency 'bundler'
20
20
  s.add_dependency 'kaminari'
21
21
  s.add_dependency 'authlogic'
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency 'iq_rdf'
25
25
  s.add_dependency 'json'
26
26
  s.add_dependency 'rails_autolink'
27
- s.add_dependency 'faraday', '0.9.0'
27
+ s.add_dependency 'faraday'
28
28
  s.add_dependency 'faraday_middleware'
29
29
  s.add_dependency 'bootstrap_form', '~> 4.0'
30
30
  s.add_dependency 'iq_triplestorage'
@@ -34,14 +34,16 @@ Gem::Specification.new do |s|
34
34
  s.add_dependency 'deep_cloneable'
35
35
  s.add_dependency 'apipie-rails'
36
36
  s.add_dependency 'maruku'
37
+ s.add_dependency 'net-http'
37
38
  s.add_dependency 'database_cleaner', '~> 1.8.5'
38
39
  s.add_dependency 'delayed_job_active_record'
39
40
  s.add_dependency 'carrierwave'
41
+ s.add_dependency 'carrierwave-i18n'
40
42
  s.add_dependency 'rack-mini-profiler'
41
43
  s.add_dependency 'faucet_pipeline_rails'
42
44
 
43
45
  s.files = %w(LICENSE README.md CHANGELOG.md Gemfile Gemfile.lock Rakefile iqvoc.gemspec) +
44
- Dir.glob('{app,bin,config,db,lib}/**/*')
46
+ Dir.glob('{app,config,db,lib}/**/*')
45
47
  s.test_files = Dir['{test}/**/*']
46
48
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
47
49
  s.require_paths = ['lib']
@@ -12,6 +12,7 @@ module Iqvoc
12
12
  :broader_relation_class_name, :further_relation_class_names,
13
13
  :pref_labeling_class_name,
14
14
  :alt_labeling_class_name,
15
+ :hidden_labeling_class_name,
15
16
  :match_class_names,
16
17
  :note_class_names,
17
18
  :notation_class_names,
@@ -27,6 +28,7 @@ module Iqvoc
27
28
 
28
29
  self.pref_labeling_class_name = 'Labeling::SKOS::PrefLabel'
29
30
  self.alt_labeling_class_name = 'Labeling::SKOS::AltLabel'
31
+ self.hidden_labeling_class_name = 'Labeling::SKOS::HiddenLabel'
30
32
 
31
33
  self.note_class_names = [
32
34
  Iqvoc.change_note_class_name,
@@ -11,6 +11,7 @@ module Iqvoc
11
11
  :default_rdf_namespace_helper_modules,
12
12
  :default_rdf_namespace_helper_methods,
13
13
  :rdf_namespaces,
14
+ :rdf_show_change_notes,
14
15
  :change_note_class_name,
15
16
  :first_level_class_configuration_modules,
16
17
  :navigation_items,
@@ -103,6 +104,9 @@ module Iqvoc
103
104
  iqvoc: 'http://try.iqvoc.net/schema#'
104
105
  }
105
106
 
107
+ # This flag determines if the changes notes should be included in the RDF representation of a Concept/Label/Collection.
108
+ self.rdf_show_change_notes = true
109
+
106
110
  # The class to use for automatic generation of change notes on every save
107
111
  self.change_note_class_name = 'Note::SKOS::ChangeNote'
108
112
 
@@ -116,8 +116,8 @@ module Iqvoc
116
116
  if value == nil
117
117
  raise TypeError, 'nil values not supported'
118
118
  end
119
- # 0.class enables support for Ruby 2.4 Fixnum/Bignum into Integer class merge
120
- unless [TrueClass, FalseClass, String, 0.class, Float, Array].include?(value.class)
119
+
120
+ unless [TrueClass, FalseClass, String, Integer, Float, Array].include?(value.class)
121
121
  raise TypeError, 'complex values not supported'
122
122
  end
123
123
  end
@@ -16,15 +16,18 @@ module Iqvoc::Environments
16
16
  # Show full error reports.
17
17
  config.consider_all_requests_local = true
18
18
 
19
+ # Enable server timing
20
+ config.server_timing = true
21
+
19
22
  # Enable/disable caching. By default caching is disabled.
20
23
  # Run rails dev:cache to toggle caching.
21
- if Rails.root.join('tmp', 'caching-dev.txt').exist?
24
+ if Rails.root.join("tmp/caching-dev.txt").exist?
22
25
  config.action_controller.perform_caching = true
23
26
  config.action_controller.enable_fragment_cache_logging = true
24
27
 
25
28
  config.cache_store = :memory_store
26
29
  config.public_file_server.headers = {
27
- 'Cache-Control' => "public, max-age=#{2.days.to_i}"
30
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
28
31
  }
29
32
  else
30
33
  config.action_controller.perform_caching = false
@@ -24,22 +24,22 @@ module Iqvoc::Environments
24
24
 
25
25
  # Disable serving static files from the `/public` folder by default since
26
26
  # Apache or NGINX already handles this.
27
- config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
27
+ config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
28
28
 
29
29
  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
30
- # config.asset_host = 'http://assets.example.com'
30
+ # config.asset_host = "http://assets.example.com"
31
31
 
32
32
  # Specifies the header that your server uses for sending files.
33
- # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
34
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
33
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
34
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
35
35
 
36
36
  # Store uploaded files on the local file system (see config/storage.yml for options).
37
37
  config.active_storage.service = :local
38
38
 
39
39
  # Mount Action Cable outside main process or domain.
40
40
  # config.action_cable.mount_path = nil
41
- # config.action_cable.url = 'wss://example.com/cable'
42
- # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
41
+ # config.action_cable.url = "wss://example.com/cable"
42
+ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
43
43
 
44
44
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
45
  # config.force_ssl = true
@@ -82,7 +82,7 @@ module Iqvoc::Environments
82
82
 
83
83
  # Use a different logger for distributed setups.
84
84
  # require "syslog/logger"
85
- # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
85
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
86
86
 
87
87
  if ENV["RAILS_LOG_TO_STDOUT"].present?
88
88
  logger = ActiveSupport::Logger.new(STDOUT)
@@ -92,26 +92,5 @@ module Iqvoc::Environments
92
92
 
93
93
  # Do not dump schema after migrations.
94
94
  config.active_record.dump_schema_after_migration = false
95
-
96
- # Inserts middleware to perform automatic connection switching.
97
- # The `database_selector` hash is used to pass options to the DatabaseSelector
98
- # middleware. The `delay` is used to determine how long to wait after a write
99
- # to send a subsequent read to the primary.
100
- #
101
- # The `database_resolver` class is used by the middleware to determine which
102
- # database is appropriate to use based on the time delay.
103
- #
104
- # The `database_resolver_context` class is used by the middleware to set
105
- # timestamps for the last write to the primary. The resolver uses the context
106
- # class timestamps to determine how long to wait before reading from the
107
- # replica.
108
- #
109
- # By default Rails will store a last write timestamp in the session. The
110
- # DatabaseSelector middleware is designed as such you can define your own
111
- # strategy for connection switching and pass that into the middleware through
112
- # these configuration options.
113
- # config.active_record.database_selector = { delay: 2.seconds }
114
- # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
115
- # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
116
95
  end
117
96
  end
@@ -15,7 +15,7 @@ module Iqvoc::Environments
15
15
  # Configure public file server for tests with Cache-Control for performance.
16
16
  config.public_file_server.enabled = true
17
17
  config.public_file_server.headers = {
18
- 'Cache-Control' => "public, max-age=#{1.hour.to_i}"
18
+ "Cache-Control" => "public, max-age=#{1.hour.to_i}"
19
19
  }
20
20
 
21
21
  # Show full error reports and disable caching.
data/lib/iqvoc/version.rb CHANGED
@@ -15,5 +15,5 @@
15
15
  # limitations under the License.
16
16
 
17
17
  module Iqvoc
18
- VERSION = "4.13.2"
18
+ VERSION = "4.14.5"
19
19
  end
@@ -17,8 +17,6 @@
17
17
  require File.join(File.expand_path(File.dirname(__FILE__)), '../test_helper')
18
18
 
19
19
  class ConceptsMovementControllerTest < ActionController::TestCase
20
- require 'authlogic/test_case'
21
-
22
20
  setup do
23
21
  activate_authlogic
24
22
 
@@ -43,7 +43,7 @@ class ReverseMatchTest < ActionController::TestCase
43
43
  RDFAPI.devour c, 'skos:prefLabel', '"Airsoft"@en'
44
44
  c.publish
45
45
  c.save
46
- new_version = c.branch @admin
46
+ new_version = c.branch
47
47
  new_version.save
48
48
  end
49
49
 
@@ -0,0 +1,45 @@
1
+ # encoding: UTF-8
2
+
3
+ # Copyright 2011-2022 innoQ Deutschland GmbH
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require File.join(File.expand_path(File.dirname(__FILE__)), '../integration_test_helper')
18
+
19
+ class CollectionBrowsingTest < ActionDispatch::IntegrationTest
20
+ setup do
21
+ login('administrator')
22
+
23
+ @indoor = Iqvoc::Collection.base_class.new.publish.tap do |c|
24
+ RDFAPI.devour c, 'skos:prefLabel', '"Indoors"@en'
25
+ c.save
26
+ end
27
+
28
+ @outdoor = Iqvoc::Collection.base_class.new.publish.tap do |c|
29
+ RDFAPI.devour c, 'skos:prefLabel', '"Outdoors"@en'
30
+ c.save
31
+ end
32
+ end
33
+
34
+ test 'collection listing' do
35
+ visit collections_path(lang: 'en')
36
+ assert page.has_content?("#{@indoor.pref_label}")
37
+ assert page.has_content?("#{@outdoor.pref_label}")
38
+ end
39
+
40
+ test 'showing published collection' do
41
+ visit collection_path(@indoor, lang: 'en')
42
+ assert page.has_content?('Collections')
43
+ assert page.has_content?("#{@indoor.pref_label}")
44
+ end
45
+ end
@@ -20,11 +20,11 @@ class CollectionCircularityTest < ActionDispatch::IntegrationTest
20
20
  setup do
21
21
  login('administrator')
22
22
 
23
- @coll1 = Iqvoc::Collection.base_class.new.lock_by_user(@user.id).tap { |c| c.save }
23
+ @coll1 = Iqvoc::Collection.base_class.new.tap { |c| c.save }
24
24
  RDFAPI.devour @coll1, 'skos:prefLabel', '"coll1"@en'
25
- @coll2 = Iqvoc::Collection.base_class.new.lock_by_user(@user.id).tap { |c| c.save }
25
+ @coll2 = Iqvoc::Collection.base_class.new.tap { |c| c.save }
26
26
  RDFAPI.devour @coll2, 'skos:prefLabel', '"coll2"@en'
27
- @coll3 = Iqvoc::Collection.base_class.new.lock_by_user(@user.id).tap { |c| c.save }
27
+ @coll3 = Iqvoc::Collection.base_class.new.tap { |c| c.save }
28
28
  RDFAPI.devour @coll3, 'skos:prefLabel', '"coll3"@en'
29
29
 
30
30
  @concept1 = Concept::SKOS::Base.new.publish.tap { |c| c.save }
@@ -43,7 +43,7 @@ class ConceptCollectionAssignmentTest < ActionDispatch::IntegrationTest
43
43
  visit concept_path(concept, lang: 'en', format: 'html')
44
44
 
45
45
  click_link_or_button 'Create new version'
46
- assert page.has_content? 'Instance copy has been created and locked.'
46
+ assert page.has_content? 'Instance copy has been created.'
47
47
  collection_origins = [@sports_coll, @hobbies_coll].map(&:origin).join(', ')
48
48
  fill_in 'concept_assigned_collection_origins', with: collection_origins
49
49
 
@@ -30,6 +30,21 @@ class CreateConceptTest < ActionDispatch::IntegrationTest
30
30
  save_check_and_publish
31
31
  end
32
32
 
33
+ test 'send to review with inconsistent concept' do
34
+ login('administrator')
35
+ visit dashboard_path(lang: 'en')
36
+ click_link_or_button 'New Concept'
37
+
38
+ # Create invalid preflabel
39
+ fill_in 'concept_labelings_by_text_labeling_skos_pref_labels_en', with: 'Foo,Foo'
40
+ click_link_or_button 'Save'
41
+
42
+ # Consistency check should run when sending the concept to review.
43
+ click_link_or_button 'Send to review'
44
+ assert page.has_content? 'Instance is inconsistent.'
45
+ assert page.has_content? 'There must be only one preferred Label per language.'
46
+ end
47
+
33
48
  private
34
49
 
35
50
  def save_check_and_publish